Skip to content

Commit

Permalink
v14.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
boehlerlukas committed Dec 24, 2024
1 parent 9fc4254 commit c4f7af0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/cjs/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/esm/index.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion published/14.1.2/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion published/latest/index.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/ScreenCapture.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const loadCSSUrlResources = (data, basePath, remote) => {
try {
var resourcePath = matchedUrl;
if (basePath) {
resourcePath = basePath + "/" + matchedUrl;
resourcePath = new URL(matchedUrl, basePath + "/").href;
}

// Try to fetch external resource.
Expand Down Expand Up @@ -255,11 +255,14 @@ const downloadAllCSSUrlResources = (clone, remote) => {
const baseTags = document.getElementsByTagName("base");
var basePathURL = baseTags.length
? baseTags[0].href.substr(location.origin.length, 999)
: window.location.href;
: window.location.href.split(/[?#]/)[0];

if (styleSheet.href) {
basePathURL = styleSheet.href;
}

const basePath = basePathURL.substring(0, basePathURL.lastIndexOf("/"));

promises.push(
loadCSSUrlResources(cssTextContent, basePath, remote).then(
(replacedStyle) => {
Expand Down

0 comments on commit c4f7af0

Please sign in to comment.