howto: noScript block inline JS but not external scripts
Posted: Mon Oct 17, 2011 2:27 pm
Hello,
I'm trying to understand how noScript blocks inline JavaScript within a page. Am I right to say that it uses configurable security policies (CAPS) to turn off Javascript globally, and then enables Javascript on a per page/domain basis?
It then uses content policies (with nsIContentPolicy) to prevent external scripts from being loaded. So when clicking on "Allow all this page" it turns on Javascript using a configurable security policy for this page only, and then allows for the loading of external scripts with nsIContentPolicy as well?
However, I'm trying to understand how you allow or disallow the loading of inline JavaScript (on page). Is this only an on/off option based on the page url such as using caps to enable the page only?
Is there a way to disallow the execution of inline javascript (such as: <script>alert('hello');</script>) while still allowing the loading/execution of external scripts (as <script src="myscript.js"></script>) on a page? If so, how does it do it?
Many thanks!
I'm trying to understand how noScript blocks inline JavaScript within a page. Am I right to say that it uses configurable security policies (CAPS) to turn off Javascript globally, and then enables Javascript on a per page/domain basis?
It then uses content policies (with nsIContentPolicy) to prevent external scripts from being loaded. So when clicking on "Allow all this page" it turns on Javascript using a configurable security policy for this page only, and then allows for the loading of external scripts with nsIContentPolicy as well?
However, I'm trying to understand how you allow or disallow the loading of inline JavaScript (on page). Is this only an on/off option based on the page url such as using caps to enable the page only?
Is there a way to disallow the execution of inline javascript (such as: <script>alert('hello');</script>) while still allowing the loading/execution of external scripts (as <script src="myscript.js"></script>) on a page? If so, how does it do it?

Many thanks!