@percy/dom 1.26.0 → 1.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/bundle.js +5 -3
  2. package/package.json +2 -2
package/dist/bundle.js CHANGED
@@ -116,7 +116,7 @@
116
116
  // build a URL for the serialized asset
117
117
  let [, ext] = mimetype.split('/');
118
118
  let path = `/__serialized__/${uid}.${ext}`;
119
- let url = new URL(path, document.URL).toString();
119
+ let url = rewriteLocalhostURL(new URL(path, document.URL).toString());
120
120
 
121
121
  // return the url, base64 content, and mimetype
122
122
  return {
@@ -129,8 +129,7 @@
129
129
  // build a URL for the serialized asset
130
130
  let [, ext] = mimetype.split('/');
131
131
  let path = `/__serialized__/${uid}.${ext}`;
132
- let url = new URL(path, document.URL).toString();
133
-
132
+ let url = rewriteLocalhostURL(new URL(path, document.URL).toString());
134
133
  // return the url, text content, and mimetype
135
134
  return {
136
135
  url,
@@ -154,6 +153,9 @@
154
153
  tempStyle.remove();
155
154
  return sheet;
156
155
  }
156
+ function rewriteLocalhostURL(url) {
157
+ return url.replace(/(http[s]{0,1}:\/\/)localhost[:\d+]*/, '$1render.percy.local');
158
+ }
157
159
 
158
160
  // Returns a mostly random uid.
159
161
  function uid() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/dom",
3
- "version": "1.26.0",
3
+ "version": "1.26.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,5 +35,5 @@
35
35
  "devDependencies": {
36
36
  "interactor.js": "^2.0.0-beta.10"
37
37
  },
38
- "gitHead": "0792d3978ca2169a45e8788eba012a61f81f5159"
38
+ "gitHead": "9c89383d6e1a9aa41f0c83f8e4b9ddcdf827583b"
39
39
  }