2014-06-25 09:12:07 +04:00
|
|
|
/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- /
|
2013-03-26 07:20:30 +04:00
|
|
|
/* vim: set shiftwidth=4 tabstop=8 autoindent cindent expandtab: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
const NS_GFXINFO_CONTRACTID = "@mozilla.org/gfx/info;1";
|
|
|
|
|
|
|
|
var gContainingWindow = null;
|
|
|
|
|
|
|
|
var gBrowser;
|
|
|
|
|
2013-06-29 07:26:28 +04:00
|
|
|
function OnDocumentLoad(evt) {
|
2013-08-02 01:55:28 +04:00
|
|
|
if (evt.target != gBrowser.contentDocument || evt.target.location == "about:blank")
|
2013-06-29 07:26:28 +04:00
|
|
|
return;
|
2013-08-02 01:55:28 +04:00
|
|
|
gBrowser.removeEventListener("load", OnDocumentLoad, true);
|
2013-03-26 07:20:30 +04:00
|
|
|
gContainingWindow.close();
|
|
|
|
}
|
|
|
|
|
|
|
|
this.OnRecordingLoad = function OnRecordingLoad(win) {
|
|
|
|
if (win === undefined || win == null) {
|
|
|
|
win = window;
|
|
|
|
}
|
|
|
|
if (gContainingWindow == null && win != null) {
|
|
|
|
gContainingWindow = win;
|
|
|
|
}
|
|
|
|
|
|
|
|
gBrowser = gContainingWindow.document.getElementById("browser");
|
|
|
|
|
2018-02-28 20:51:34 +03:00
|
|
|
var gfxInfo = (NS_GFXINFO_CONTRACTID in Cc) && Cc[NS_GFXINFO_CONTRACTID].getService(Ci.nsIGfxInfo);
|
2013-03-26 07:20:30 +04:00
|
|
|
var info = gfxInfo.getInfo();
|
2013-06-29 07:26:28 +04:00
|
|
|
dump(info.AzureContentBackend + "\n");
|
2013-03-26 07:20:30 +04:00
|
|
|
if (info.AzureContentBackend == "none") {
|
|
|
|
alert("Page recordings may only be made with Azure content enabled.");
|
|
|
|
gContainingWindow.close();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-08-02 01:55:28 +04:00
|
|
|
gBrowser.addEventListener("load", OnDocumentLoad, true);
|
2013-03-26 07:20:30 +04:00
|
|
|
|
|
|
|
var args = window.arguments[0].wrappedJSObject;
|
|
|
|
|
|
|
|
gBrowser.loadURI(args.uri);
|
2013-06-29 07:26:28 +04:00
|
|
|
};
|