| Index: include.preload.js |
| =================================================================== |
| --- a/include.preload.js |
| +++ b/include.preload.js |
| @@ -76,25 +76,22 @@ |
| ext.backgroundPage.sendMessage({type: "add-sitekey", token: attr}); |
| } |
| -function hasInlineURL(element, attribute) |
| -{ |
| - var value = element.getAttribute(attribute); |
| - return value == null || /^\s*(javascript:|about:|$)/i.test(value); |
| -} |
| - |
| function isInlineFrame(element) |
| { |
| - switch (element.localName) |
| + var contentDocument; |
| + try |
| { |
| - case "iframe": |
| - return hasInlineURL(element, "src") || element.hasAttribute("srcdoc"); |
| - case "frame": |
| - return hasInlineURL(element, "src"); |
| - case "object": |
| - return hasInlineURL(element, "data") && element.contentDocument; |
| - default: |
| - return false; |
| + contentDocument = element.contentDocument; |
| } |
| + catch (e) |
| + { |
| + return false; // third-party |
| + } |
| + |
| + if (!contentDocument) |
| + return false; // not a frame |
| + |
| + return contentDocument.location.protocol == "about:"; |
|
kzar
2015/02/09 16:52:11
Previously we would return true if the URL started
Sebastian Noack
2015/02/09 17:10:00
Previously, we checked against the raw attribute v
|
| } |
| function resolveURL(url) |