From the Chrome Extension Docs...
Content scripts are JavaScript files that run in the context of web pages.
By using the standard DOM, they can read details of the web pages the browser visits, or make changes to them.
JS is running in your app that you didn't put there.
window.onerror = function( message, file, line ) {
var formattedMessage = '[' + file + ':' + line + '] ' + message;
_gaq.push( [ '_trackEvent',
'Exceptions',
'Application',
formattedMessage,
null,
true ] );
}
[chrome://freecorder/content/js/content.js:9]
TypeError: freecorder.extension is undefined
[chrome://afterthedeadline/content/atd.js:687]
TypeError: can't access dead object
[chrome://ffvkbd/content/ikavvklistener.js:0]
Script error.
[D:\Program Files (x86)\Kingsoft\PowerWordDict\
plugin\firefox\resources\grabword.js:71]
TypeError: event.target is undefined
[http://bens-awesome-app.com:1]
ReferenceError: Can't find variable: Reader2
[http://bens-awesome-app.com:1]
SyntaxError: Unexpected string '^^^'
Mostly harmless, except when they...
AdBlock blocks ads (...duh)
yepnope({
load: [ 'vendor.js',
'lib.js',
'app.js',
'googleadservices.com/conversion.js' ],
complete: function () {
app.init();
}
});
body
<body screen_capture_injected="true">
Lets users write & run any arbitrary JS
var clippy = document.getElementById('clippy');
clippy.classList.add('being-helpful');
var wtfIHateClippySoMuch = document.getElementById('clippy');
wtfIHateClippySoMuch.parentNode.removeChild( wtfIHateClippySoMuch );
Our app:
var clippy = document.getElementById('clippy');
clippy.classList.add('being-helpful');
You will never test your JS in every context in which it will run.
Don't care about <noscript>
users?
Do it for <brokenscript>
users!
It's nice to know.
Unreproducible bugs
===
some browser extension (probably)
Slides: github.com/bensmithett
Twitter: @bensmithett