Skip to content
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

[Safari] Tampermonkey cannot show installed userscripts #778

Closed
oscar-c opened this issue Oct 15, 2019 · 27 comments
Closed

[Safari] Tampermonkey cannot show installed userscripts #778

oscar-c opened this issue Oct 15, 2019 · 27 comments
Labels
Milestone

Comments

@oscar-c
Copy link

oscar-c commented Oct 15, 2019

Expected Behavior

When switch to "Installed usercripts" tab, TM shows installed userscripts.

Actual Behavior

The "Please wait..." prompt is there spinning forever, rendering the entire UI inoperable.

Specifications

  • Safari: 13.0.2
  • TM: 4.9.6037 (MAS Version)
  • OS: macOS 10.15 Beta (19A582a) (the Golden Master)

AND

  • Safari: 12.1.2
  • TM: 4.9.6037 (MAS Version)
  • OS: macOS 10.14.6

Note

I get this behavor after I imported some backup from TM 4.7. The backup includes some customized script.

And I want to know if there is a way to "factory reset" TM so I can investigate which specific userscript(s) caused the problem. I tried to uninstall/reinstall but the data is still there.

@derjanb
Copy link
Member

derjanb commented Oct 15, 2019

And I want to know if there is a way to "factory reset" TM so I can investigate which specific userscript(s) caused the problem.

Good point. I'll add a factory reset button to the host app's window. :)

You can reset the extension settings by executing this at a terminal:

rm -r Library/Containers/net.tampermonkey.*

@epsimatic
Copy link

epsimatic commented Oct 15, 2019

Not opening another issue, but I have my problem with importing backup triaged.

Might be a slightly different issue.

tl;dr: { "scripts": [ {"file_url": ...}]} breaks import and script list

Steps to reproduce:

  1. Reset Tampermonkey by deleting ~/Library/Containers/net.tampermonkey.SafariApp.Extension
  2. Start Safari
  3. Open Tampermonkey preferences
  4. Import file:
    a). tampermonkey-backup-bad.txt
    b). tampermonkey-backup-good.txt
  5. Confirm adding script
    • Expected behaviour: script imports, -bad and good files with minimal differences
    • Actual behaviour: -good backup loads, -bad backup hangs
  6. Open Tampermonkey options, try open tabs.
    • Expected behaviour: able to open any tab, see the imported script in scripts
    • Actual behaviour: -good is good, -bad makes you unable to open scripts tab

Logs attached:

log-good.txt
log-bad.txt

@epsimatic
Copy link

epsimatic commented Oct 15, 2019

Temporary workaround for importing backup:

  • reformat (lint) JSON data in tampermonkey-backup-....txt file to a readable state
  • remove "file_url": ... from every script
  • save and import

@oscar-c
Copy link
Author

oscar-c commented Oct 15, 2019

I've found the culprit, in my case at least: https://greasyfork.org/en/scripts/34153-pixiv-plus

Regarless of being imported or installed freshly from greasyfork, it always causes infinite loading on the MAS version.

@paulzhang1992
Copy link

I tried to reset the extension settings. Installing any script will result in the loading situatio on installed script

@YuntianCheng
Copy link

Temporary workaround:

  • reformat (lint) JSON file to a readable state
  • remove "file_url": ... from every script
  • save and import

I have this issue but none of scripts I have installed has the "file_url" line

@oscar-c
Copy link
Author

oscar-c commented Oct 16, 2019

And I want to know if there is a way to "factory reset" TM so I can investigate which specific userscript(s) caused the problem.

Good point. I'll add a factory reset button to the host app's window. :)

You can reset the extension settings by executing this at a terminal:

rm -r Library/Containers/net.tampermonkey.*

Should be

rm -r ~/Library/Containers/net.tampermonkey.*

@bengarland
Copy link

I tried to reset the extension settings. Installing any script will result in the loading situatio on installed script

Same here. I tried installing a single script (Wanikani Override), which does not have file_url in it, and it will not load the Dashboard.

@derjanb derjanb added the bug label Oct 16, 2019
@derjanb derjanb added this to the 4.9 milestone Oct 16, 2019
@cylott
Copy link

cylott commented Oct 16, 2019

Same here. Happy to see the App store version and grateful it exists, but it doesn't work, at all. I tried to import my scripts and now it just spins and spins. I've tried the "factory reset" and deleting every folder and file it made in my ~/Library with no luck. Advice appreciated.

@epsimatic
Copy link

Same here. Happy to see the App store version and grateful it exists, but it doesn't work, at all. I tried to import my scripts and now it just spins and spins. I've tried the "factory reset" and deleting every folder and file it made in my ~/Library with no luck. Advice appreciated.

Have you tried to remove file_url from backup file before import? #778 (comment)

@robbielj
Copy link

robbielj commented Oct 16, 2019

Removing file_url solves the issue for now, while scripts cannot update via the file url. Configuring update url of script after importing will cause the same "please wait" scenario.
hope there will be a fix soon.

@liyilin88923
Copy link

I tried to reset the extension settings. Installing any script will result in the loading situatio on installed script

Same to me. I didn't import any previous userscripts but still encounter this problem once I install a new script. Since I didn't install the Pixiv Plus, so I guess other scripts also create this problem.

@robbielj
Copy link

robbielj commented Oct 16, 2019

I tried to reset the extension settings. Installing any script will result in the loading situatio on installed script

Same to me. I didn't import any previous userscripts but still encounter this problem once I install a new script. Since I didn't install the Pixiv Plus, so I guess other scripts also create this problem.

this is because the newly installed script has file_url field. TM uses that for auto-updating scripts.
you may try copying the whole script into the tampermonkey editor and save, to see whether that will work.

@Chandler-Lu
Copy link

Use regex ("file_url".*?(user.js",)) to remove all file_url field.
And hope it will fix soon.

@liyilin88923
Copy link

I tried to reset the extension settings. Installing any script will result in the loading situatio on installed script

Same to me. I didn't import any previous userscripts but still encounter this problem once I install a new script. Since I didn't install the Pixiv Plus, so I guess other scripts also create this problem.

this is because the newly installed script has file_url field. TM uses that for auto-updating scripts.
you may try copying the whole script into the tampermonkey editor and save, to see whether that will work.

Thanks, I'll try that and see if it works.

@bengarland
Copy link

Dumb question, but where does Tampermonkey actually install the scripts on my Mac? They're not in ~/Library/Application Scripts/net.tampermonkey.SafariApp (or the related *.Extension folder). I've looked everywhere and can't find them. The Tampermonkey Options page is also no help.

@bengarland
Copy link

Here's what I did to fix the Dashboard loading error. I don't know if every step is necessary, but it worked:

  1. Do NOT install scripts automatically by clicking an Install button on Greasyfork or wherever. Do NOT import scripts. Copy the raw js code for the script to your clipboard, then go to the Dashboard (it will load if you have zero scripts installed yet). Hit the + sign to add a new script. Paste the code into the editor. Go to File - Save To Disk in the editor window.

  2. Then go to Actions column on the Dashboard, and select the Edit icon (paper with pencil) next to the script. This will bring you back to the Editor. Select the Settings tab. UN-check "Check for Updates" and click the Save button directly underneath it (this may not be necessary, but since someone else has mentioned issues with the file_url that points to where Tampermonkey checks for script updates, I thought it may be the issue).

  3. Optional: If you have a script that needs to load first before all other scripts, make sure to change it to Helvetapaper script not working #1 in the Position drop-down menu at the very top of the script Settings page.

  4. You can now close the Dashboard tab. Go to the Tampermonkey icon in your Safari toolbar and click it and select Dashboard. The Dashboard should now load properly.

@liyilin88923
Copy link

I'm glad to report that after I upgraded the tampermonkey to 4.9.6041 today from the Mac Appstore, the "installed userscripts" tab started to show normally. Problem solved!

Thanks to the developer and all the others who helped!

@YuntianCheng
Copy link

I'm glad to report that after I upgraded the tampermonkey to 4.9.6041 today from the Mac Appstore, the "installed userscripts" tab started to show normally. Problem solved!

Thanks to the developer and all the others who helped!

I have not received the update yet. And the App Store has a bug that some applications which has been installed on my Mac show a download logo in the Mac Store

@derjanb
Copy link
Member

derjanb commented Oct 17, 2019

Yes, 6041 was reviewed and published this night. It should definitely fix

I've found the culprit, in my case at least: https://greasyfork.org/en/scripts/34153-pixiv-plus

but I'm not sure about

tl;dr: { "scripts": [ {"file_url": ...}]} breaks import and script list

because this worked here fine all the time.

Can someone with the file_url issue and 6041 confirm whether it's working or not please? Thanks.

@liyilin88923
Copy link

Yes, 6041 was reviewed and published this night. It should definitely fix

I've found the culprit, in my case at least: https://greasyfork.org/en/scripts/34153-pixiv-plus

but I'm not sure about

tl;dr: { "scripts": [ {"file_url": ...}]} breaks import and script list

because this worked here fine all the time.

Can someone with the file_url issue and 6041 confirm whether it's working or not please? Thanks.

I already got the 6041 and the installed scripts tab functioned normally after I install some scripts directly from the greasyfork.org

@liyilin88923
Copy link

I'm glad to report that after I upgraded the tampermonkey to 4.9.6041 today from the Mac Appstore, the "installed userscripts" tab started to show normally. Problem solved!
Thanks to the developer and all the others who helped!

I have not received the update yet. And the App Store has a bug that some applications which has been installed on my Mac show a download logo in the Mac Store

Maybe you could search the tampermonkey by name in the store window? Perhaps the update button will show there.

Plus, the Mac Appstore does have some weird problems sometimes, like the one you described. I guess the MAS just doesn't as good as the one on iOS.

@YuntianCheng
Copy link

I'm glad to report that after I upgraded the tampermonkey to 4.9.6041 today from the Mac Appstore, the "installed userscripts" tab started to show normally. Problem solved!
Thanks to the developer and all the others who helped!

I have not received the update yet. And the App Store has a bug that some applications which has been installed on my Mac show a download logo in the Mac Store

Maybe you could search the tampermonkey by name in the store window? Perhaps the update button will show there.

Plus, the Mac Appstore does have some weird problems sometimes, like the one you described. I guess the MAS just doesn't as good as the one on iOS.

Thanks, I find the update button by searching it, but tampermonkey did not upgrade at all after I clicked the update button. I think I have to reboot my Mac now.

@epsimatic
Copy link

Thanks, I find the update button by searching it, but tampermonkey did not upgrade at all after I clicked the update button. I think I have to reboot my Mac now.

Same issue here. It only updates successfully if Safari is closed at the moment of update. So, close Safari, update, launch Safari.

Can someone with the file_url issue and 6041 confirm whether it's working or not please? Thanks.

I've updated, tried importing tampermonkey-backup-bad.txt from my report above — Successful

Imported my big backup — Successful

Issue is solved for me, Thank you Jan!

@derjanb
Copy link
Member

derjanb commented Oct 17, 2019

😅

@derjanb derjanb closed this as completed Oct 17, 2019
@YuntianCheng
Copy link

Thanks, I find the update button by searching it, but tampermonkey did not upgrade at all after I clicked the update button. I think I have to reboot my Mac now.

Same issue here. It only updates successfully if Safari is closed at the moment of update. So, close Safari, update, launch Safari.

Can someone with the file_url issue and 6041 confirm whether it's working or not please? Thanks.

I've updated, tried importing tampermonkey-backup-bad.txt from my report above — Successful

Imported my big backup — Successful

Issue is solved for me, Thank you Jan!

Yes, I have updated successfully. I can finally enter the installed page.

@gabrielferrari714
Copy link

Thanks, I find the update button by searching it, but tampermonkey did not upgrade at all after I clicked the update button. I think I have to reboot my Mac now.

Same issue here. It only updates successfully if Safari is closed at the moment of update. So, close Safari, update, launch Safari.

Can someone with the file_url issue and 6041 confirm whether it's working or not please? Thanks.

I've updated, tried importing tampermonkey-backup-bad.txt from my report above — Successful
Imported my big backup — Successful
Issue is solved for me, Thank you Jan!

Yes, I have updated successfully. I can finally enter the installed page.

Issue is solved here.
I have updated successfully (with Safari closed). Now I can enter the installed page.
Thank you so much, Jan. 🙏🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests