javascript - Accessing webpage script from content script -
I try to execute an Jquery): Understand that 'myfunc' in the script-in-page The function that you want to be able to perform. Try using the function now: Edit 2: You may also: onclick () event of a code (
& lt) I am doing; A & gt; ), but it does not take the visitor anywhere, it executes the javascript code, however, how can I execute the code, due to that content script, the scripts on that webpage can not be accessed Let's go The code that should be executed uses custom functions, which are declared in the webpage.
var script = $ ("#webscript"); (or any other way of getting a script tag that contains the code)
var myfunc = null; // Function-name declare (probably not even necessary) eval (script.html ()); // where myfunc has been announced and your myfunc variable has been specified
myfunc ( );
var copyScript = document.createElement ('script' ); CopyScript.type = 'text / javascript'; CopyScript.text = script.html (); Document.head.appendChild (copyScript);
Comments
Post a Comment