Cazka / diepAPI

An API for https://diep.io
MIT License
15 stars 8 forks source link

Questioning use of _window #42

Open Cazka opened 2 years ago

Cazka commented 2 years ago

We are using the variable _window instead of window to reference the global object.

Using this one liner, we make sure that _window is referencing the real global object.

const _window = 'undefined' == typeof unsafeWindow ? window : unsafeWindow;

Problem is that this one liner is not included in the library and have to be placed manually.

Is it possible to include that one liner in the src folder so that it is included in the built library?

Cazka commented 2 years ago

we could also overwrite window to unsafeWindow at the start of the userscript.

if("undefined" != typeof unsafeWindow) {
    //trust me bro
    window = unsafeWindow;
}

this actually works

Cazka commented 1 year ago

we could also overwrite window to unsafeWindow at the start of the userscript.

if("undefined" != typeof unsafeWindow) {
    //trust me bro
    window = unsafeWindow;
}

this actually works

seems to be fixed in a new tampermonkey version