[RESOLVED] FF30 addon-sdk toolbar, noscript blocks
Posted: Wed Jul 16, 2014 10:23 pm
The addon-sdk now has an api to add a browser toolbar:
https://developer.mozilla.org/en-US/Add ... ui_toolbar
HTML content can be added to the toolbar, which is inserted as an iframe -- this last bit of functionality did not work until Firefox 30.
NoScript prevents scripts from executing in this iframe, and prevents communication from this iframe using postMessage. I have a sample extension here:
http://mashing.org/noscript-firefox30-toolbar/test.xpi
To test:
* Start Firefox 30+ with a new profile.
* Install the test extension.
You will see a new toolbar. It should be yellow. There is a button that will generate postMessage requests. This should be working, and you can verify this by looking for console.log messages in the browser console.
* Install NoScript and restart
With the default configuration, NoScript prevents the javascript in the iframe from running at all, so the Toolbar will be grey and the test button will not be enlivened.
* Configure NoScript to "Allow Scripts Globally" and restart
The iframe javascript should now execute, so the Toolbar will be yellow again. However, clicking the test button will not result in any console.log messages. This is because the postMessage never made it through to the main extension code.
NoScript does not appear to log anything to explain why this content is being blocked. I tried turning off every configuration option I could find, nothing short of disabling NoScript works.
Finally, the in the logs you will also see a giant stack dump from the sdk loader. I won't paste the whole stack. This only happens once NoScript is installed. I have not looked into this, but it makes me wonder if something in the loader is getting monkey-patched.
TypeError: from is not an object
Stack trace:
[object Object] core.js:90
TypeError: from is not an object
Stack trace:
[object Object]
Can anyone help me figure out what is happening?
https://developer.mozilla.org/en-US/Add ... ui_toolbar
HTML content can be added to the toolbar, which is inserted as an iframe -- this last bit of functionality did not work until Firefox 30.
NoScript prevents scripts from executing in this iframe, and prevents communication from this iframe using postMessage. I have a sample extension here:
http://mashing.org/noscript-firefox30-toolbar/test.xpi
To test:
* Start Firefox 30+ with a new profile.
* Install the test extension.
You will see a new toolbar. It should be yellow. There is a button that will generate postMessage requests. This should be working, and you can verify this by looking for console.log messages in the browser console.
* Install NoScript and restart
With the default configuration, NoScript prevents the javascript in the iframe from running at all, so the Toolbar will be grey and the test button will not be enlivened.
* Configure NoScript to "Allow Scripts Globally" and restart
The iframe javascript should now execute, so the Toolbar will be yellow again. However, clicking the test button will not result in any console.log messages. This is because the postMessage never made it through to the main extension code.
NoScript does not appear to log anything to explain why this content is being blocked. I tried turning off every configuration option I could find, nothing short of disabling NoScript works.
Finally, the in the logs you will also see a giant stack dump from the sdk loader. I won't paste the whole stack. This only happens once NoScript is installed. I have not looked into this, but it makes me wonder if something in the loader is getting monkey-patched.
TypeError: from is not an object
Stack trace:
[object Object] core.js:90
TypeError: from is not an object
Stack trace:
[object Object]
Can anyone help me figure out what is happening?