Skip to content

Commit

Permalink
Skip trying to find effective context for about:srcdoc frames
Browse files Browse the repository at this point in the history
`about:srcdoc` frames are their own origin, trying to
use the origin of the parent context causes an
exception to be thrown when accessing location.href.
  • Loading branch information
gorhill committed Nov 21, 2020
1 parent 4b943cf commit 8d3c491
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/contentscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ vAPI.contentScript = true;
try {
while (
context !== self.top &&
context.location.protocol === 'about:'
context.location.href.startsWith('about:blank')
) {
context = context.parent;
}
Expand Down

0 comments on commit 8d3c491

Please sign in to comment.