-
Notifications
You must be signed in to change notification settings - Fork 213
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
iOS + iPadOS Support #135
Comments
I have to read more about the support. It seems like Apple is supporting Safari WebExtensions in iOS, not Safari App Extensions. This extension is an App Extension not a Web Extension. If that is the case the extension would need to be re-written and current functionality could be lost. At the current time I do not know. |
Ahh I see! Anyway I'm going to try and migrate the extension from app extension to web extension! Let's see if that's possible! |
@Kartik-715 It is possible it's just a matter of time and rewriting certain functionality like interacting directly with the file system. I don't have any doubts it is possible. I am waiting until more information is out about the new iOS 15 features before I make any plans. However, once I hear more I will likely be re-writing, so I would suggest not to waste your time attempting to migrate anything. If you want to help when I begin the rewrite that would be more beneficial to the project. |
Looks like Safari App Extensions and Safari Web Extensions will work on iOS? |
I read the quote, but can you elaborate on why you think Safari App extensions will work? Specifically app extensions without WebExtension components. |
Ah, without web extension components. Well, then I wouldn't know. I added a questionmark to it as the wording by Apple was a bit vague. Looking deeper into the various documentation pages, it looks like it's Safari Web Extensions but with the ability to have a native app to control it from. It also looks to me like they're moving away from Safari App Extensions in general and toward Web Extensions instead. Might be worth considering refactoring to Web Extension either way, as they might just end up cutting support for Safari App Extensions down the line. Who knows. Moving to Web Extensions could also have the advantage of making it much easier to enable using the extension in other browsers too from what I can gather? |
Thanks for the clarification. I agree that migrating to Web Extension will prove valuable and that is my goal, however I can not give a firm estimate on when that will be complete as it is will take some time. That being said, simply converting to being predominately WebExtension API won't instantly enable usage in iOS as there are other aspects of the extension to consider, such as selecting the "scripts folder" and mobile considerations for the extension page (ie. editor which will likely barely function on any mobile device currently).
Once they announced WebExtensions, I had the same thought. It's already sort of happening since the WebExtension API is much more robust compared to the App Extension API (which gets seldom updates). It does slightly irk me that Apple decided to drop Safari JS Extension API and force users into App Extension API only to (a few years later) seemingly begin abandoning App Extension API in favor of WebExtension API. It's better for the browser but reveals their finicky and haphazard forward thinking (in terms of Safari).
Very true, however at the current moment I don't have much interest in adding additional browser support since there are really good options for those browsers. But that opinion could change in time. Anyway, WebExtension refactor is planned, stay tuned! |
You've got some good points in regards to an iOS port. I think that for an initial release, simply giving the option to add/remove userscripts/styles you find on the web could be enough, and potentially expand upon it later. Personally, I just want to use the userstyles I write on my PC on iOS for instance, and I will assume that a majority of people who use plugins like this don't write them themselves. I don't know what APIs they give you access to, but considering they let you add a native app to control certain stuff in the extension, perhaps you also get access to a folder in the filesystem which you can store things in? In that case, you might not even need some way to write them, as users could just write them in their preferred program and add it to that folder? I'd contribute to this but my Macbook decided that it no longer wants to boot regularly (only if in safemode), so I had to install Linux on it to even be able to continue using it. Means I won't really be able to test anything or deploy it to my iPad :/ |
I think that would exactly what I'd want to see in a v1 for iOS - simply the ability to read userscripts from a directory of the user's choosing. For example, I store all my scripts in an iCloud folder, if I am able to read from that directory and utilize the userscripts located there, on my phone, I would be very pleased. Long term possibilities are endless, but I am fairly certain that creating an editor for iOS or iPadOS is more than likely not a goal.
You already are contributing by sparking up conversation and it's valuable! |
This is still being investigated. I am unsure how to go about configuring the project to support iOS. Apple suggests using a converter to add support for other platforms, but unfortunately the converter does not seem to run properly on my computer. For example, running:
Doesn't do anything but display the help text for the converter. If anyone knows how to add support please send me a message. My email is on my profile page. |
@quoid I think I found your issue. The problem is that the You can try entering |
@julianpomper I had tried that in the past and just tried it again this morning and the results are the same. The converter does not do anything but print out help text. Interestingly the help text does not state that Have you successfully rebuilt an existing macIS webextension? If so, what OS are you on and Safari version? I am using Safari |
I re-read your post and realized I am on Xcode 12... Sorry it is early for me 🙂 I reckon I won't be able to covert and build the iOS side until I am on the new macOS (or download Xcode Beta). When that gets released I should be able to update and run the convertor and start that process. |
Exactly you should already be able to do that now with macOS 11.4. Download the Xcode 13 RC here in the
Edit: and of course open the Xcode project with Xcode 13 from now on 😄 |
@julianpomper I just wanted to give you an update. The good news is that I was able to convert the extension to iOS 🎉 The bad news is that a good deal of the v4.0.0 code needs to be re-written |
What do you mean rewritten? Coming in here with no context just interested in seeing any user script app reach iOS. Do you mean the scripting code no longer works or just UI is broken? |
Here's some examples:
Anyway, my point is there's a lot of stuff that needs to get to done to even figure out if it is viable to run on iOS and iPadOS (I think it will). Some of that includes iOS development which I am inexperienced with. If all of this is left up to me, it will probably get done, but just take quite a while.
I reckon it's mostly UI but some of the scripting code needs to be adapted. As mentioned above about the file read location - that is at the core of how userscript injection works. But most of the injection core happens on the WebExtension side which seems supported according to the documentation. Also note that the iOS parts seemingly can co-exist with the macOS. So it's really more about created some iOS specific code rather than a "rewrite". |
Ah I see that is a lot of non-easily converted code. I've got some naive iOS experience mostly on the UI side, so I can't say I could contribute much, at least right now I've got a full plate. Hopefully, one day userscripts can come to iOS still. |
It might take a little bit but I think it will get there @EthanG45 |
Update I've been running some tests. Outside of adapting current code to work on iOS, I am still in the process of figuring out if choosing a read location can persist between Safari launches. Choosing a location for reading the userscripts will have to be done as it is currently done in the current macOS app. That means the user selects this location in the containing app, in this case the iOS app and then a sharedbookmark is created and stored in a shared userdefaults file. That shared userdefaults value is then read by the extension. In the simulator, it seems like this persists, but I am unsure how this will function on an actual phone/ipad. I've read some random forum posts suggesting that it is not possible to have sharedbookmarks persist as they can in macOS. If that is true, I am not sure how to approach all of this. However, it seems to persist currently, so I am hoping it is not true. Once that is figured out, I think the path is clear. I'm successfully running this in the simulator currently. |
@quoid That's fantastic to hear! Looking forward to future updates on development progress. |
Update I updated my iPhone 8 to ios 15 and loaded the extension. Injection seems to occur, will update everyone on if the bookmark persists. However, the popup does not load properly. This is not something I experienced in the simulator. I made a thread in the Apple forums in hopes of deciphering the error code: https://developer.apple.com/forums/thread/691389 If anyone has any insight please post here |
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 -> |
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 |
Thanks for the clarification.
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. |
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:
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 |
https://greasyfork.org/zh-CN/scripts/14178-ac-baidu-重定向优化百度搜狗谷歌必应搜索-favicon-双列 |
This tells me that this is an issue with the file not the extension.
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. |
Thank you for your patience in answering,I think I know what to do. |
If you're testing iOS and want to test macOS, please sign up here: #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! |
Can I take part in testing on iPadOS? |
@xinkev sure, if you haven't already, please sign up here: https://forms.gle/QB46uYQHVyCxULue9 |
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. |
@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?
This is on the radar. |
iPad 9. Extension is linked above (MangaLoader). 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. |
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):
Unsupported Keys // @grant GM_getValue
// @grant GM_setValue
// @grant GM_listValues
// @grant GM_deleteValue
// @grant GM_xmlhttpRequest Error in console Thank you again for reporting this issue |
Does the 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 The interesting part is that the script runs properly when directly used in a bookmarketlet: 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. |
Can you make a unique issue for this? That remove the Thanks for pointing this out. |
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 b8b8a7f |
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!
The text was updated successfully, but these errors were encountered: