Created
April 13, 2012 02:59
-
-
Save devinrhode2/2373209 to your computer and use it in GitHub Desktop.
String concatentation errors suck!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var script = document.createElement('script'); | |
script.innerHTML = | |
'if (window.top !== window) { '+ | |
' var subFrame = document.createElement("script"); '+ | |
' subFrame.src = "'+chrome.extension.getURL('specific/sub_frame.js')+'";'+ | |
' document.documentElement.appendChild(subFrame); ' | |
'}'; | |
document.documentElement.appendChild(script); | |
//gives "unexpected end of input", with no line numbers! | |
someStyleElement.innerHTML = | |
'html {display: none; /*trolling*/}' + | |
+'div {display: block !important; }' | |
+'foo{color: black;}'; | |
//Silently gives: "html {display: none; /*trolling*/}NaNfoo{color: black;}" FARDGE! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment