Files
tubestation/browser/extensions/screenshots/webextension/assertIsBlankDocument.js
Jared Hirsch b641c88726 Bug 1381132 - Export Screenshots 10.7.0 to Firefox; r=kmag
MozReview-Commit-ID: 49iAxm2BiQA
2017-07-17 16:49:34 -07:00

13 lines
423 B
JavaScript

/** For use inside an iframe onload function, throws an Error if iframe src is not blank.html
Should be applied *inside* catcher.watchFunction
*/
this.assertIsBlankDocument = function assertIsBlankDocument(doc) {
if (doc.documentURI !== browser.extension.getURL("blank.html")) {
let exc = new Error('iframe URL does not match expected blank.html');
exc.foundURL = doc.documentURI;
throw exc;
}
}
null;