Created
September 15, 2013 13:31
-
-
Save otiai10/6570791 to your computer and use it in GitHub Desktop.
chrome.runtime.sendMessageの第一引数の型はanyのはずなのに、{callback:function(){}}がどこかでundefinedにされてわたってくる。valueが文字列であるようなキーは生きてる。ということで最後の手段、eval
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 s = "console.log('evalつかってみるよー');"; | |
eval(s);// > evalつかってみるよー | |
// スコープは? | |
var s2 = "console.log(s);"; | |
eval(s2); | |
// > console.log('evalつかってみるよー'); | |
// evalした瞬間に有効な変数名を参照できるのですね |
Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' chrome-extension-resource:".
シニタイ
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
こんなこともできたw
なんでもできますね...うれしいやらかなしいやら...