Skip to content

Not working for some userscripts #12

@plateaukao

Description

@plateaukao

Hi, @warren-bank

I installed userscript (https://greasyfork.org/en/scripts/457196-immersive-translate/code), and trying to make it work.
In the Chrome debug console, it will complain:

Uncaught ReferenceError: unsafeWindow is not defined
    at <anonymous>:1:16
    at <anonymous>:1:405

I did see it's declared in

private static final String JSUNSAFEWINDOW = "var unsafeWindow = (function() { var el = document.createElement('p'); el.setAttribute('onclick', 'return window;'); return el.onclick(); }()); window.wrappedJSObject = unsafeWindow;\n";

Due to my lack knowledge of javascript, I am not sure whether it's because some GM APIs are missing, so it can't work properly. Could you help to look at the script, and give me some hint where this might go wrong?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions