@applitools/dom-snapshot
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -1,2 +0,2 @@ | ||
/* @applitools/dom-snapshot@2.1.0 */ | ||
/* @applitools/dom-snapshot@2.1.1 */ | ||
@@ -60,7 +60,3 @@ function __processPage() { | ||
function isInlineFrame(frame) { | ||
return ( | ||
frame && | ||
frame.contentDocument && | ||
(!/^https?:$/.test(frame.contentDocument.location.protocol) || frame.src === 'about:blank') | ||
); | ||
return !/^https?:.+/.test(frame.src); | ||
} | ||
@@ -70,2 +66,13 @@ | ||
function isAccessibleFrame(frame) { | ||
try { | ||
const doc = frame.contentDocument; | ||
return !!(doc && doc.defaultView && doc.defaultView.frameElement); | ||
} catch (err) { | ||
// for CORS frames | ||
} | ||
} | ||
var isAccessibleFrame_1 = isAccessibleFrame; | ||
function domNodesToCdt(docNode, url) { | ||
@@ -125,3 +132,7 @@ const cdt = [{nodeType: Node.DOCUMENT_NODE}]; | ||
if (elementNode.nodeName === 'IFRAME' && isInlineFrame_1(elementNode)) { | ||
if ( | ||
elementNode.nodeName === 'IFRAME' && | ||
isAccessibleFrame_1(elementNode) && | ||
isInlineFrame_1(elementNode) | ||
) { | ||
frameBase = getFrameBaseUrl(elementNode); | ||
@@ -589,12 +600,4 @@ dummyUrl = absolutizeUrl_1(`?applitools-iframe=${uuid_1()}`, frameBase || url); | ||
); | ||
return iframes.filter(f => isAccessibleFrame(f) && !isInlineFrame_1(f)).map(f => f.contentDocument); | ||
} | ||
function isAccessibleFrame(frame) { | ||
try { | ||
const doc = frame.contentDocument; | ||
return !!(doc && doc.defaultView && doc.defaultView.frameElement); | ||
} catch (err) { | ||
// for CORS frames | ||
} | ||
return iframes.filter(f => isAccessibleFrame_1(f) && !isInlineFrame_1(f)).map(f => f.contentDocument); | ||
} | ||
@@ -601,0 +604,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* @applitools/dom-snapshot@2.1.0 */ | ||
/* @applitools/dom-snapshot@2.1.1 */ | ||
@@ -112,7 +112,3 @@ function __processPageAndPoll() { | ||
function isInlineFrame(frame) { | ||
return ( | ||
frame && | ||
frame.contentDocument && | ||
(!/^https?:$/.test(frame.contentDocument.location.protocol) || frame.src === 'about:blank') | ||
); | ||
return !/^https?:.+/.test(frame.src); | ||
} | ||
@@ -122,2 +118,13 @@ | ||
function isAccessibleFrame(frame) { | ||
try { | ||
const doc = frame.contentDocument; | ||
return !!(doc && doc.defaultView && doc.defaultView.frameElement); | ||
} catch (err) { | ||
// for CORS frames | ||
} | ||
} | ||
var isAccessibleFrame_1 = isAccessibleFrame; | ||
function domNodesToCdt(docNode, url) { | ||
@@ -177,3 +184,7 @@ const cdt = [{nodeType: Node.DOCUMENT_NODE}]; | ||
if (elementNode.nodeName === 'IFRAME' && isInlineFrame_1(elementNode)) { | ||
if ( | ||
elementNode.nodeName === 'IFRAME' && | ||
isAccessibleFrame_1(elementNode) && | ||
isInlineFrame_1(elementNode) | ||
) { | ||
frameBase = getFrameBaseUrl(elementNode); | ||
@@ -641,12 +652,4 @@ dummyUrl = absolutizeUrl_1(`?applitools-iframe=${uuid_1()}`, frameBase || url); | ||
); | ||
return iframes.filter(f => isAccessibleFrame(f) && !isInlineFrame_1(f)).map(f => f.contentDocument); | ||
} | ||
function isAccessibleFrame(frame) { | ||
try { | ||
const doc = frame.contentDocument; | ||
return !!(doc && doc.defaultView && doc.defaultView.frameElement); | ||
} catch (err) { | ||
// for CORS frames | ||
} | ||
return iframes.filter(f => isAccessibleFrame_1(f) && !isInlineFrame_1(f)).map(f => f.contentDocument); | ||
} | ||
@@ -653,0 +656,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* @applitools/dom-snapshot@2.1.0 */ | ||
/* @applitools/dom-snapshot@2.1.1 */ | ||
@@ -112,7 +112,3 @@ function __processPageAndSerialize() { | ||
function isInlineFrame(frame) { | ||
return ( | ||
frame && | ||
frame.contentDocument && | ||
(!/^https?:$/.test(frame.contentDocument.location.protocol) || frame.src === 'about:blank') | ||
); | ||
return !/^https?:.+/.test(frame.src); | ||
} | ||
@@ -122,2 +118,13 @@ | ||
function isAccessibleFrame(frame) { | ||
try { | ||
const doc = frame.contentDocument; | ||
return !!(doc && doc.defaultView && doc.defaultView.frameElement); | ||
} catch (err) { | ||
// for CORS frames | ||
} | ||
} | ||
var isAccessibleFrame_1 = isAccessibleFrame; | ||
function domNodesToCdt(docNode, url) { | ||
@@ -177,3 +184,7 @@ const cdt = [{nodeType: Node.DOCUMENT_NODE}]; | ||
if (elementNode.nodeName === 'IFRAME' && isInlineFrame_1(elementNode)) { | ||
if ( | ||
elementNode.nodeName === 'IFRAME' && | ||
isAccessibleFrame_1(elementNode) && | ||
isInlineFrame_1(elementNode) | ||
) { | ||
frameBase = getFrameBaseUrl(elementNode); | ||
@@ -641,12 +652,4 @@ dummyUrl = absolutizeUrl_1(`?applitools-iframe=${uuid_1()}`, frameBase || url); | ||
); | ||
return iframes.filter(f => isAccessibleFrame(f) && !isInlineFrame_1(f)).map(f => f.contentDocument); | ||
} | ||
function isAccessibleFrame(frame) { | ||
try { | ||
const doc = frame.contentDocument; | ||
return !!(doc && doc.defaultView && doc.defaultView.frameElement); | ||
} catch (err) { | ||
// for CORS frames | ||
} | ||
return iframes.filter(f => isAccessibleFrame_1(f) && !isInlineFrame_1(f)).map(f => f.contentDocument); | ||
} | ||
@@ -653,0 +656,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* @applitools/dom-snapshot@2.1.0 */ | ||
/* @applitools/dom-snapshot@2.1.1 */ | ||
'use strict'; | ||
@@ -57,7 +57,3 @@ | ||
function isInlineFrame(frame) { | ||
return ( | ||
frame && | ||
frame.contentDocument && | ||
(!/^https?:$/.test(frame.contentDocument.location.protocol) || frame.src === 'about:blank') | ||
); | ||
return !/^https?:.+/.test(frame.src); | ||
} | ||
@@ -67,2 +63,13 @@ | ||
function isAccessibleFrame(frame) { | ||
try { | ||
const doc = frame.contentDocument; | ||
return !!(doc && doc.defaultView && doc.defaultView.frameElement); | ||
} catch (err) { | ||
// for CORS frames | ||
} | ||
} | ||
var isAccessibleFrame_1 = isAccessibleFrame; | ||
function domNodesToCdt(docNode, url) { | ||
@@ -122,3 +129,7 @@ const cdt = [{nodeType: Node.DOCUMENT_NODE}]; | ||
if (elementNode.nodeName === 'IFRAME' && isInlineFrame_1(elementNode)) { | ||
if ( | ||
elementNode.nodeName === 'IFRAME' && | ||
isAccessibleFrame_1(elementNode) && | ||
isInlineFrame_1(elementNode) | ||
) { | ||
frameBase = getFrameBaseUrl(elementNode); | ||
@@ -586,12 +597,4 @@ dummyUrl = absolutizeUrl_1(`?applitools-iframe=${uuid_1()}`, frameBase || url); | ||
); | ||
return iframes.filter(f => isAccessibleFrame(f) && !isInlineFrame_1(f)).map(f => f.contentDocument); | ||
} | ||
function isAccessibleFrame(frame) { | ||
try { | ||
const doc = frame.contentDocument; | ||
return !!(doc && doc.defaultView && doc.defaultView.frameElement); | ||
} catch (err) { | ||
// for CORS frames | ||
} | ||
return iframes.filter(f => isAccessibleFrame_1(f) && !isInlineFrame_1(f)).map(f => f.contentDocument); | ||
} | ||
@@ -598,0 +601,0 @@ |
{ | ||
"name": "@applitools/dom-snapshot", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -6,2 +6,3 @@ /* eslint-disable no-use-before-define */ | ||
const isInlineFrame = require('./isInlineFrame'); | ||
const isAccessibleFrame = require('./isAccessibleFrame'); | ||
@@ -62,3 +63,7 @@ function domNodesToCdt(docNode, url) { | ||
if (elementNode.nodeName === 'IFRAME' && isInlineFrame(elementNode)) { | ||
if ( | ||
elementNode.nodeName === 'IFRAME' && | ||
isAccessibleFrame(elementNode) && | ||
isInlineFrame(elementNode) | ||
) { | ||
frameBase = getFrameBaseUrl(elementNode); | ||
@@ -65,0 +70,0 @@ dummyUrl = absolutizeUrl(`?applitools-iframe=${uuid()}`, frameBase || url); |
'use strict'; | ||
const flat = require('./flat'); | ||
const isInlineFrame = require('./isInlineFrame'); | ||
const isAccessibleFrame = require('./isAccessibleFrame'); | ||
@@ -9,14 +10,6 @@ function extractFrames(documents = [document]) { | ||
); | ||
return iframes.filter(f => isAccessibleFrame(f) && !isInlineFrame(f)).map(f => f.contentDocument); | ||
} | ||
function isAccessibleFrame(frame) { | ||
try { | ||
const doc = frame.contentDocument; | ||
return !!(doc && doc.defaultView && doc.defaultView.frameElement); | ||
} catch (err) { | ||
// for CORS frames | ||
} | ||
} | ||
module.exports = extractFrames; |
'use strict'; | ||
function isInlineFrame(frame) { | ||
return ( | ||
frame && | ||
frame.contentDocument && | ||
(!/^https?:$/.test(frame.contentDocument.location.protocol) || frame.src === 'about:blank') | ||
); | ||
return !/^https?:.+/.test(frame.src); | ||
} | ||
module.exports = isInlineFrame; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
587841
43
12494