-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
userscript loading on every tab? #1041
Comments
I haven't really looked into this enough to be confident that i understand what's going on here, Currently, luakit does indeed (de)activate a given userscript globally. I notice that the file you link to appears to contain three userscripts stuck together. It looks to me like maybe the script |
On Tue, 16 May 2023 18:39:10 -0700 taobert ***@***.***> wrote:
I haven't really looked into this enough to be confident that i
understand what's going on here, so please take the following with a
grain of salt.
Currently, luakit does indeed (de)activate a given userscript
globally. (A pull request to change that to per-tab might be
considered, but i'm personally not convinced it'd be valuable.)
However, userscripts _can_ be restricted to certain domains by
changing the userscript header. The file you link to explicitly
enables the script for all domains (`// @include *`).
I notice that the file you link to appears to contain three
userscripts stuck together. My guess is that you found that link in
the GreaseMonkey/TamperMonkey section of the Installation table on
[the main wikEd
page](https://en.wikipedia.org/wiki/User:Cacycle/wikEd). My further
suspicion is that (Grease|Tamper)Monkey have infrastructure to split
multiple scripts into discrete files (though perhaps the link is just
broken). I don't believe that luakit has such infrastructure, and so
the individual scripts may need to be installed separately. (It looks
like they're listed in a table on [the installation
page](https://en.wikipedia.org/wiki/User:Cacycle/wikEd_installation)
in the "Integrated into a wiki farm" section.)
Hello @taobert,
It seems, i cant install individual scripts.
It looks to me like maybe the script `wikEd.js` tests that the page
is a wiki by looking for `window.mw`. It also seems to include
`wikEdDiff.js`. `wikEdDiff.js` doesn't do any testing, and attempts
to access a global `mw` variable. My guess is that since you have
`wikEdDiff.js` concatenated onto the end of `wikEd.js`, some
safeguard breaks down, and a variable that doesn't exist gets
referenced, causing your error. I haven't tested, so i can't confirm
that the inclusion of `wikEdDiff.js` will work correctly in luakit.
It looks to me though, like it may be grabbed from Cacycle's user
page, so you might only need to install the `wikEd.js` file.
reported upstream
:
https://meta.wikimedia.org/wiki/User_talk:Cacycle#wiked_issue_on_luakit
* lets see how will dev respond
|
Well you should be able to download the individual files, put them in your scripts directory, and rename wikEd.js as wikEd.user.js.
Well, that's very efficient, but possibly premature -- it might not be their problem. |
On Wed, 17 May 2023 01:47:32 -0700 taobert ***@***.***> wrote:
> It seems, i cant install individual scripts.
Well you should be able to download the individual files, put them in
your scripts directory, and rename wikEd.js as wikEd.user.js.
wikEd.js [given under table heading:
Source wiki page (integrated into
a wiki farm)] given at
https://en.wikipedia.org/wiki/User:Cacycle/wikEd_installation#On-wiki_installation_code
is same as greasemonkey script given on same page.
You
should also be able to split the file you already downloaded with a
text editor. But maybe you don't need to, maybe
all-the-scripts-together is how it should be.
Does it work as-is on
sites that you'd expect it to work on?
It is working correctly.
… > reported upstream
Well, that's very efficient, but possibly premature -- it might not
be their problem. Though, i'd have expected a more restrictive
***@***.***` range. Perhaps the developer can rebut some of my
assumptions above.
|
In my hands, wikEd.js from the table (i've added "?action=raw" to strip off wikipedia's framing) is 19237 lines, and contains one userscript header:
By contrast, the greasemonkey install link produces 25384 lines and three userscript headers:
Well then my failure to grasp what may well be a standard greasemonkey format may be a red herring, |
Current Behavior:
userscript loading on every tab
Desired Behavior:
should not load on every tab
How can we reproduce it (step by step):
Environment:
Linux Distribution & Version: debian bookworm
Output of
luakit --version
:luakit 2.3.3
built with webkit 2.38.2 (installed version: 2.40.1)
Note about webkit issues:
If you're reporting a rendering issue, please test it with the gnome
browser ephiphany as well. If the issue occurs there too, we're very
likely not able to help. These issues should be reported to webkit:
https://bugs.webkit.org
The text was updated successfully, but these errors were encountered: