Skip to content

Commit c4f7af0

Browse files
committed
v14.1.2
1 parent 9fc4254 commit c4f7af0

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

build/cjs/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/esm/index.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

published/14.1.2/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

published/latest/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ScreenCapture.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const loadCSSUrlResources = (data, basePath, remote) => {
7373
try {
7474
var resourcePath = matchedUrl;
7575
if (basePath) {
76-
resourcePath = basePath + "/" + matchedUrl;
76+
resourcePath = new URL(matchedUrl, basePath + "/").href;
7777
}
7878

7979
// Try to fetch external resource.
@@ -255,11 +255,14 @@ const downloadAllCSSUrlResources = (clone, remote) => {
255255
const baseTags = document.getElementsByTagName("base");
256256
var basePathURL = baseTags.length
257257
? baseTags[0].href.substr(location.origin.length, 999)
258-
: window.location.href;
258+
: window.location.href.split(/[?#]/)[0];
259+
259260
if (styleSheet.href) {
260261
basePathURL = styleSheet.href;
261262
}
263+
262264
const basePath = basePathURL.substring(0, basePathURL.lastIndexOf("/"));
265+
263266
promises.push(
264267
loadCSSUrlResources(cssTextContent, basePath, remote).then(
265268
(replacedStyle) => {

0 commit comments

Comments
 (0)