userscripts
userscripts copied to clipboard
Not working on my iPhone 6s+
System Information:
macOS or iOS version: 15.6 Userscripts version: 1.2.2 (27) Safari version: 15.6 Mobile Is this issue related to script injection? Yes Did the test script (pasted above) successfully run on your machine? No
I added a script like Namulink.user.js but it doesn't work. It doesn't seem to work on my iPhone 6s+.
Did the test script (pasted above) successfully run on your machine? No
The test script didn't work?
@quoid Adding any scripts, including test scripts, doesn't work. For example, namulink.user.js removes the PoweLink ad from namu.wiki, but it doesn't work either.
@Githubmaniak
Thanks for the reply. Let's focus on the test script for now.
What exactly doesn't work with it?
- can you see the extension popup/menu?
- does the test script show there?
- does it not execute?
Any more details and screenshots would be helpful.
Thanks.
@quoid
When I restart safari, the scripts including test.user.js in userscripts are displayed in the list, but nothing works and when I refresh, the list fails to load.
@Githubmaniak
can you try this script please?
// ==UserScript==
// @name TestScript2
// @description This is your new file, start writing code
// @match <all_urls>
// @noframes
// ==/UserScript==
alert("This is a test script");
the original test script logs to the console (you wont see that in mobile)
and it also doesn't match to google.com
domains
the test script I pasted above should work on google.com
domains and show an alert
@quoid
Before that the script doesn't work on naver.com either, but this script works! But complex ad blocking scripts like namulink.user.js and microshield.user.js don't work on my iPhone 6S+.
Before that the script doesn't work on naver.com either, but this script works! But complex ad blocking scripts like namulink.user.js and microshield.user.js don't work on my iPhone 6S+.
Can you link those userscripts?
There could be a compatibility issue. This userscript manager doesn't have all of the same APIs are others. If you send me the links, I can check to see what might be causing the issue.
Thanks
@quoid https://github.com/List-KR/NamuLink, https://github.com/List-KR/microShield
@Githubmaniak
Problems:
-
Is using
unsafeWindow
. There is no equivalent for Safari. #252 -
This check:
const win = unsafeWindow != undefined ? unsafeWindow : window
is better asconst win = typeof unsafeWindow != "undefined" ? unsafeWindow : window
, since attempting to see if a possibly undeclared variable isundefined
can throw an error... -
The script will be injected into the
content
context because it has an@grant
value, however sinceunsafeWindow
is invalid, perhaps this shouldn't happen - #307
microShield has the same issue as 1 but has a proper check for unsafeWindow
.
I can see the scripts get injected when these issues are resolved.
closing due to inactivity, feel free to reopen if needed @Githubmaniak