You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unlike tamperMonkey this tool does not seem to provide means to use the global JS context on the top window (in which it is injected) and thus I see no way to access the globally defined APIs added by the site's creators and those are added explicitly for allowing user scripting via such tools.
Example:
Server sent JS file:
window.someFunction = function() { ... }
Tamperish script
document.onreadystatechange = function(e) {
if (document.readyState === 'complete') {
window.someFunction(); // DOES NOT WORK as the symbol is missing.
}
}
The text was updated successfully, but these errors were encountered:
After some digging and remembering the 'good old days' a working solution (although not great IMHO) is to prepare the line(s) of script you want to be able to call in the original host context as text and put it in a script tag in the Body of the document. It would look like this:
(function(){functionexecuteInTopContext(str){lets=document.createElement('script');s.textContent=str;document.body.appendChild(s);setTimeout(function(){document.body.removeChild(s);},100);}executeInTopContext(// This will work because the script is executed in the original context of the web site.`window.my_custom_website_provided_function(${some_variable_from_tamperish_context});`);})();
Unlike tamperMonkey this tool does not seem to provide means to use the global JS context on the top window (in which it is injected) and thus I see no way to access the globally defined APIs added by the site's creators and those are added explicitly for allowing user scripting via such tools.
Example:
Server sent JS file:
Tamperish script
The text was updated successfully, but these errors were encountered: