a chrome code does not work
Posted: Mon Jun 11, 2012 3:57 am
The following code would not run if NoScript installed.
The problem does not happen if disabled NoScript.
Step to Reproduce:
1. Run Firefox with clean profile
2. Install NoScript2.4.5 and restart
3. Set devtools.chrome.enabled to true in about:config
4. Open any web page
5. Open Scrachpad(Shift+F4)
6. Set Environment > browser
7. Paste the following
8. Execute > Run (Ctrl+R)
Actual results:
an empty tab is opened
Expected results:
a tab is opened with canvas (captured image for step4)
The problem does not happen if disabled NoScript.
Step to Reproduce:
1. Run Firefox with clean profile
2. Install NoScript2.4.5 and restart
3. Set devtools.chrome.enabled to true in about:config
4. Open any web page
5. Open Scrachpad(Shift+F4)
6. Set Environment > browser
7. Paste the following
Code: Select all
(function(){
var win = content;
var tab = gBrowser.addTab( "about:blank");
var browser = gBrowser.getBrowserForTab(tab);
browser.addEventListener('load', function(event) {
browser.removeEventListener('load', arguments.callee, true);
var doc = browser.contentDocument;
var canvas = doc.body.appendChild(doc.createElement('canvas'));
canvas.style.display = 'inline';
canvas.width = 200;
canvas.height = 200;
var ctx = canvas.getContext("2d");
ctx.drawWindow(win, 0, 0, 200, 200, "rgb(255,255,255)");
gBrowser.selectedTab = tab;
}, true);
})();Actual results:
an empty tab is opened
Expected results:
a tab is opened with canvas (captured image for step4)