Background. Js:
Var var_t="var variable";
Chrome. ContextMenus. Create ({
Title: "right-click menu,"
Id: "1",
Onclick: function () {
Chrome. Tabs. ExecuteScript (null, {file: "js/AutoFill js"});
}
});
AutoFill. Js:
Alert (var_t);
Here just to illustrate how to use, just write the alert (var_t); Runtime, chrome error, var_t undefined,
CodePudding user response:
AutoFill. Visit js var_t, make sure you var_t is a global variableCodePudding user response:
Thank you, I don't so defined is the global variable?