quoid / userscripts

An open-source userscript manager for Safari
https://quoid.github.io/userscripts/
GNU General Public License v3.0
3.19k stars 179 forks source link

iOS + iPadOS Support #135

Closed Kartik-715 closed 2 years ago

Kartik-715 commented 3 years ago

With the release of iPadOS and iOS 15, do you have plans to migrate this extension to a safari web extension? Could be pretty useful!

quoid commented 2 years ago

@elh-rotem

I can not replicate the issue you describe when the error that was in your original userscript is corrected. I suspect there's an issue with how the userscript was coded.

If you need more help, please open a new ticket as I do not think this is related to ipad/ios specifically.

https://user-images.githubusercontent.com/7660254/140205098-eaef6a03-3a3f-42c0-a76a-5e91801d0e40.MP4

EthanG45 commented 2 years ago

@quoid TestFlight for the Mac just released and looks like Userscripts iOS is accidentally(?) marked as available for Apple Silicon Macs. Just an FYI.

image
quoid commented 2 years ago

Thanks for letting me know @EthanG45, that's certainly not purposeful. I will see what I can do later today to correct that.

quoid commented 2 years ago

I will be dispatching a new version, which resets the build numbers soon. The reason for this change is that the first app distributed through Testflight was called "Userscripts iOS" because I had not "associated" with the macOS version. However, I corrected that by creating an iOS version of the macOS app and both are using the same bundle id now. Everyone testing will soon get a possibly confusing invite to test "Userscripts" for iOS which should be accepted if you want to continue testing.

You should probably delete the previous install before installing the new version.

I will be expiring the first version(s) that was sent out shortly after sending the invites for the new version.

I apologize for the confusion.

PS - I am working on getting v4.x of the macOS app on Testing as well. Hopefully that beta will be set up through Testflight soon enough.

quoid commented 2 years ago

Also, @cynix - the semicolon issue is fixed in the latest build

vjjj4688 commented 2 years ago

I tried to download several scripts in the happy fork, but these scripts can't be used. I don't know why, the scripts can only be seen in the top extension, but they can't take effect

quoid commented 2 years ago

@vjjj4688

I tried to download several scripts in the happy fork

What is happy fork?

Is you having an issue with the new version of the app or the old? This is easy to tell by the current build number, which is shown in the iOS app, example -> v0.1 (x)

vjjj4688 commented 2 years ago

sorry,https://greasyfork.org/,I mean this script download website,I am using the latest version of 0.1 (2),It doesn't work like previous versions

quoid commented 2 years ago

@vjjj4688

Thanks for the clarification.

It doesn't work like previous versions

That is odd, it is the same app with a different bundle id. However things could have gotten messed up since the old version uses a similar app.group container.

Please try the following:

If you are certain these scripts were all working in the previous version and you have checked the above, you can delete the new version and re-install and continue to use the old version that was working for you while I wait to see if this is an issue with everyone or just you.

I will not invalidate the old version until I am sure others are able to use the new version in the same way they used the old version.

vjjj4688 commented 2 years ago

@vjjj4688

Thanks for the clarification.

It doesn't work like previous versions

That is odd, it is the same app with a different bundle id. However things could have gotten messed up since the old version uses a similar app.group container.

Please try the following:

  • Make sure you deleted the other version of the app
  • Ensure the proper directory is showing in the iOS app
  • Re-select the directory in the iOS (choose it again after hitting the blue button)
  • Make sure the new extension has the proper permissions (In settings go to Safar i > Extensions > Userscripts)

    • it should be allowed on all website always

If you are certain these scripts were all working in the previous version and you have checked the above, you can delete the new version and re-install and continue to use the old version that was working for you while I wait to see if this is an issue with everyone or just you.

I will not invalidate the old version until I am sure others are able to use the new version in the same way they used the old version.

sorry,I used translation software, so you may have misunderstood what I meant,I mean, the last version and this version, they both do not work properly,I can see the script in the address bar of safari,But it doesn't actually run successfully,I'm sure I've given all permissions and the script is fully available on the pc ![Uploading FC2F31E2-610C-408E-83E7-35AEFAFC96DE.png…]()

vjjj4688 commented 2 years ago

![Uploading 245238FF-78A5-4FCE-99D1-46CB07F85B38.png…]()

quoid commented 2 years ago

@vjjj4688

Thank you for the additional clarification. I see you are trying to upload an image, but it does not appear to be displaying.

Since you are having an issue with both version, I suspect there could be an issue with the file you are trying to run.

As a test, please create a new userscript file with the code below and visit any website. You should see an alert show up:

// ==UserScript==
// @name        iosTest
// @description only for testing on ios
// @match     <all_urls>
// @run-at document-start
// @noframes
// ==/UserScript==

alert("iosTest");

If you do not see this alert on the first try, open the popup and ensure you see it in the list and refresh the page a couple of time.

This is will tell me if your issue is with the app or the javascript file you are trying to execute.

vjjj4688 commented 2 years ago

@vjjj4688

Thank you for the additional clarification. I see you are trying to upload an image, but it does not appear to be displaying.

Since you are having an issue with both version, I suspect there could be an issue with the file you are trying to run.

As a test, please create a new userscript file with the code below and visit any website. You should see an alert show up:

// ==UserScript==
// @name        iosTest
// @description only for testing on ios
// @match     <all_urls>
// @run-at document-start
// @noframes
// ==/UserScript==

alert("iosTest");

If you do not see this alert on the first try, open the popup and ensure you see it in the list and refresh the page a couple of time.

This is will tell me if your issue is with the app or the javascript file you are trying to execute.

After testing, it can work normally,But why can't any of the scripts I'm using myself run successfully? But why can't any of the scripts I use myself run successfully? I can only see them, but they don't work. This is the download address of the script I used,https://greasyfork.org/zh-CN/scripts/14178-ac-baidu-重定向优化百度搜狗谷歌必应搜索-favicon-双列,Maybe you can help me see if there is indeed a problem with the script? After all, I can use it properly on my PC and it's not the only one that has problems, all scripts don't work properly

vjjj4688 commented 2 years ago

@vjjj4688

Thank you for the additional clarification. I see you are trying to upload an image, but it does not appear to be displaying.

Since you are having an issue with both version, I suspect there could be an issue with the file you are trying to run.

As a test, please create a new userscript file with the code below and visit any website. You should see an alert show up:

// ==UserScript==
// @name        iosTest
// @description only for testing on ios
// @match     <all_urls>
// @run-at document-start
// @noframes
// ==/UserScript==

alert("iosTest");

If you do not see this alert on the first try, open the popup and ensure you see it in the list and refresh the page a couple of time.

This is will tell me if your issue is with the app or the javascript file you are trying to execute.

https://greasyfork.org/zh-CN/scripts/14178-ac-baidu-重定向优化百度搜狗谷歌必应搜索-favicon-双列

https://greasyfork.org/scripts/14178-ac-baidu-重定向优化百度搜狗谷歌必应搜索-favicon-双列/code/AC-baidu-重定向优化百度搜狗谷歌必应搜索_favicon_双列.user.js

quoid commented 2 years ago

@vjjj4688

After testing, it can work normally

This tells me that this is an issue with the file not the extension.

After all, I can use it properly on my PC and it's not the only one that has problems, all scripts don't work properly

Those scripts are likely using features that are not supported with this extension or not targeting mobile versions of the website. There is a language barrier here, but the readme documents what features are currently enabled for this extension.

It's important to note that not all features present in other userscript manager are present in this userscript manager. Sometimes editing of a userscript is needed if you want to use it with this manager.

In the script you linked there is a github repository linked: https://github.com/langren1353/GM_script - it might be valuable to go there and seek help with editing the script.

vjjj4688 commented 2 years ago

Thank you for your patience in answering,I think I know what to do.

quoid commented 2 years ago

If you're testing iOS and want to test macOS, please sign up here: https://github.com/quoid/userscripts/issues/164 - that platform needs more testers

I did not want to spam iOS testers with macOS invites since that's not what they signed up for, so I created a separate form.

Thanks to everyone who is helping to test!

xinkev commented 2 years ago

Can I take part in testing on iPadOS?

quoid commented 2 years ago

@xinkev sure, if you haven't already, please sign up here: https://forms.gle/QB46uYQHVyCxULue9

ViRo3 commented 2 years ago

This extension is very broken on iPadOS but works well on mac.

Would also be very helpful if it automatically opened links from userscripts sites to load into the app instead of relying on downloading files alone.

quoid commented 2 years ago

@ViRo3 Can you elaborate? Saying it is "very broken" doesn't offer much insight into what is going on.

Please provide your device specs, the userscript you are trying, what is the expected behaviour and what you are actually seeing. Also include steps that you took to remedy the issue, if any. Have you ensured the issue isn't caused by the userscript you are trying to execute or potentially user expectations exceeding what is possible? is it a UI issue? etc...

Myself along with others are using it on an iPad successfully, so it is worry to hear that is broken for you.

I understand you might be frustrated because something isn't working as you intend, but I need constructive feedback in order to improve the product.

Can anyone else using this on iPad verify the "very broken" claim?

Would also be very helpful if it automatically opened links from userscripts sites to load into the app instead of relying on downloading files alone.

This is on the radar.

ViRo3 commented 2 years ago

iPad 9. Extension is linked above (MangaLoader). I absolutely didn’t mean it in any negative way and the app truly works wonders for all my extensions but the attached one above. The issue is it doesn’t load the images of the pages and UI issues are there alongwith non-interactive buttons/no animation, it is expected to load the images along with showing the settings.

it is only applicable for this extension and not any other which the app covers well. Am unaware of whether its the issue of the extension or the app.

PS : it would be very appreciated if the app automatically installed scripts in their respective pages on Greasyfork:Github too.

quoid commented 2 years ago

@ViRo3

Thank you for the clarification. I hope my reply didn't seem mean, I think there was some translation issues. What you call "extension," I call a "script" or "userscript". This app is technically an app and extension bundled together. So when you said "This extension is very broken in iPadOS" - I understood that as "The app is very broken."

I now understand you mean that the script file you were trying was broken (or not working).

I believe the issue you are experiencing with this script is because several issues, and one of them is a bug (thank you for reporting this):

1) The script uses many external libraries that are called @require - however this app is not calling them in the proper order (that is why you can can see errors in the console, image below) - I created a new ticket for this bug here: https://github.com/quoid/userscripts/issues/166

2) This script is using some GM keys that are not currently supported. I do not know if this would cause the functionality to break, but it is good to know. Support for those keys will come at some point, I hope.

Unsupported Keys

// @grant GM_getValue
// @grant GM_setValue
// @grant GM_listValues
// @grant GM_deleteValue
// @grant GM_xmlhttpRequest

Error in console

Screen Shot 2021-11-19 at 10 32 47 PM

Thank you again for reporting this issue

Taxyovio commented 2 years ago

Does the @require key work properly?

I’ve not been able to make this Manga Loader NSFW script work. This script is a NSFW add-on to the main script. It uses @require to load the main script.

The interesting part is that the script runs properly when directly used in a bookmarketlet: javascript:(function(){BM_MODE=true;var addScript=function(src,onload){var s=document.createElement('script');s.onload=onload;s.src=src;document.body.appendChild(s);};addScript('https://greasyfork.org/scripts/692-manga-loader/code/Manga%20Loader.user.js',addScript.bind(null,'https://greasyfork.org/scripts/12657-manga-loader-nsfw/code/Manga%20Loader%20NSFW.user.js'));})();

It also works when it’s merged directly into the main script as this gist.

A safe for work test manga would be https://e-hentai.org/s/5225e47182/2082483-1.

quoid commented 2 years ago

@Taxyovio

Can you make a unique issue for this?

That @require url doesn't end with .js so it gets ignored. The @require validation doesn't account for query params. I can look into this. Can you note this in the issue you create for this?

remove the ?29 and it would probably work

Thanks for pointing this out.

quoid commented 2 years ago

iOS version 1.0 has been approved and should show up on the app store soon enough. To those of you who helped test this, I really appreciate it and I look forward to continuing to improve the iOS experience.

Please do leave a review on the app store, especially those of you who've been using the iOS app for several weeks :)

Thanks all, I am closing this issue now, merged https://github.com/quoid/userscripts/commit/b8b8a7ff04e8be1d56be0393a5a8369f0a566c8e