raingart / Nova-YouTube-extension

Apache License 2.0
198 stars 9 forks source link

[Question] Greasemonkey #81

Closed sjehuda closed 1 year ago

sjehuda commented 1 year ago

Hello,

What's missing in @Greasemonkey for it to be supported as well?

Kindly, Schimon

raingart commented 1 year ago

Greasemonkey cannot access global variables on the settings site page. example if include and already inside Greasemonkey try to get the text NOVA_DATA then the variable is undefined

raingart commented 1 year ago

I'm sorry that I can make a version that even starts. Can't even access (read) youtube variables

Screenshot from 2023-04-09 14-25-49

sjehuda commented 1 year ago

On Sun, 09 Apr 2023 03:38:39 -0700 raingart @.***> wrote:

to install click "RAW" https://gist.github.com/raingart/f6e70e3f1ee242cbc14e401ffcc398c9

Thank you.

I didn't install it yet.

I'll install and test it.

In any case, please don't do something just for me, because I use Invidious, Piped and (name any other video downloader).

sjehuda commented 1 year ago

On Sun, 09 Apr 2023 02:58:37 -0700 raingart @.***> wrote:

Greasemonkey cannot access global variables on the settings site page. example if include and already inside Greasemonkey try to get the text NOVA_DATA then the variable is undefined

What about using localStorage? These setting, albeit might be exposed to hostname (privacy issue)

This is my attempt to store per-site (by hostname) settings https://openuserjs.org/scripts/sjehuda/Dimmer_(localStorage)

raingart commented 1 year ago

I tested running Nova config itself (because the settings themselves are required to run) but after that I found out that greasemonkey is deprived of access to Youtube page variables. Initially, plugins were written with the calculation of their availability on the page. That is, nothing works. Neither the configuration nor the launch of functions inside plugins. I don't see the point in wasting my time now on a major rework to adapt to the abandoned greasemonkey. The author initially acted strangely. I came up with an API different from the rest of the monkey, limited access to windows and variables. I see no reason to use greasemonkey.

raingart commented 1 year ago

localStorage - as a layer for passing the configuration around artificial restrictions. Also, give open access to Nova's configuration which could corrupt any other script?

raingart commented 1 year ago

here is the test ver. Should start. I made a substitution of the main variable that applies everywhere but I have not tested it and take it as a demo version that it is possible to run (partial)

raingart commented 1 year ago

Invidious, Piped and (name any other video downloader).

Yes, I know. Even a couple of times I thought about making a version of Nova for them. Personally, I used piped.video. If Youtube had originally looked like this and had the same functions, then Nova would never have appeared. I also advise you to watch Chinese YouTube - Bilibili. Even it has more functionality than YouTube

sjehuda commented 1 year ago

On Sun, 09 Apr 2023 08:16:05 -0700 raingart @.***> wrote:

localStorage - as a layer for passing the configuration around artificial restrictions. Also, give open access to Nova's configuration which could corrupt any other script?

Yes, indeed. Using localStorage means that any other userscript (and I guess any script by hostname) can change settings, so this is probably not an appropriate solution, and might pose risks.

sjehuda commented 1 year ago

On Sun, 09 Apr 2023 08:11:34 -0700 raingart @.***> wrote:

I see no reason to use greasemonkey.

Good.

I think we need to begin a common Userscript forum that will coordinate the available APIs which userscript managers support.

The incompatibility poses a risk for people to use corporate web browsers instead of dwb, Epiphany, Falkon, Otter Browser, Uzbl and other web browsers.


The use of Tampermonkey at the moment looks like a central business that potentially devours the smaller counterparts which might lead to centralization of important decisions, which is mostly not good.

I'm using Falkon web browser which seems not to support all libraries called by @require, so I write same code in multiple userscripts instead of using @require https://bugs.kde.org/show_bug.cgi?id=468066

Please also see my argument concerning GM.xmlHttpRequest at https://openuserjs.org/discuss/nocors_metadata_block

raingart commented 1 year ago

I forgot that there are active Chinese forks of Greasemonkey https://github.com/scriptscat/scriptcat/releases/tag/v0.12.0

raingart commented 1 year ago

During testing, I found out that with Nova

Other monkeys are unknown to me or I can't remember them. And it is not known how many of them will survive after Manifest.v3. Because Chromium has native support for userscript as extensions. But without GM_API support