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

Save / Install Userscript from URL (iOS) #176

Closed
quoid opened this issue Dec 2, 2021 · 14 comments · Fixed by #620
Closed

Save / Install Userscript from URL (iOS) #176

quoid opened this issue Dec 2, 2021 · 14 comments · Fixed by #620
Labels
discussion Any question, feedback or general comment enhancement Feature work help wanted Extra attention is needed

Comments

@quoid
Copy link
Owner

quoid commented Dec 2, 2021

When a user is on a userscript page url, such as: https://www.example/MyUserscript.js they should have the opportunity to save this file to their userscripts directory. This is especially useful on iOS.

Currently I am leaning towards a non-invasive implementation, meaning not some automatic prompt asking if the user wants to save it. There's multiple reasons for me not wanting this behaviour, the first being that I personally dislike auto prompts and secondly if a prompt is implemented, naturally the ability to disable the prompt would be desired along with some alternative method of installing a userscript found on the web. Mostly, because of this, I lean towards just implementation of the alternative method, even if it requires a couple more clicks.

Here's what I thinking:

  • a button in the popup, perhaps a +
  • when that button is clicked a new view appears that displays the userscript info the user is about to install, along with the location it will be stored in
  • from there the user can confirm that they want to install the userscript, which saves it to their filesystem
  • if no userscript is detected for the current url an appropriate message will appear
  • if no userscript directory has been set an appropriate message will appear

Feedback is very welcome if you happen across this ticket

@quoid quoid added help wanted Extra attention is needed discussion Any question, feedback or general comment beta labels Dec 2, 2021
@SilverEzhik
Copy link

Violentmonkey automatically pops up for installing files that end with .user.js. I believe that's the common convention for userscripts, so having some sort of a popup (or preferably some sort of a standard iOS file type handler dialog) would be reasonable for those.

Otherwise, perhaps adding an option to the iOS Share menu for .js files? I believe that would work even if the extension is not enabled for the website that the script is hosted on?

@quoid
Copy link
Owner Author

quoid commented Dec 2, 2021

@SilverEzhik I generally don't like automatic prompts/popups - I prefer active user input. What does Violentmonkey exactly do? Scrape every url you visit (from the content script) and if it ends with user.js have an os specific prompt that ask if you want to install the userscript? Do you have an example of this?

sort of a standard iOS file type handler dialog

Wouldn't that just enable the file to "be opened" with the app? Meaning if you encounter the file in an email or through another app? Would it handle urls in the browser?

perhaps adding an option to the iOS Share menu for .js files

That might work. I wonder what the implementation would like it, it might be more straightforward to implement it right into the current popup as I mentioned in the first post. I reckon if using a share extension, the url would be passed to the app, which would then have to open the app, the fetch the contents of the url, then save the file in the save location.

Whereas using the extension popup directly would save more steps and remove the need to open the containing app and the need to create additional logic in the containing app.

I believe that would work even if the extension is not enabled for the website that the script is hosted on?

I think that's right because the share extension would "work with" the containing app, not directly with the extension.

@cobaltt7
Copy link

cobaltt7 commented Dec 2, 2021 via email

@quoid
Copy link
Owner Author

quoid commented Dec 3, 2021

@RedGuy12

This is what TamperMonkey does

Interesting. From my searching it seems like when the url has user.js at the end, a new window opens with a code editor and a prompt asking you to install.

Doing something similar to that would actually be quite a feature update because a completely new view would need to be created and probably a specific iOS view as well.

I'm also not so keen on the idea of hijacking page requests, even if that is the standard protocol other managers are using.

I'd much prefer to have something incorporated into the "popup" of the extension, like a button that is enabled only when the current page url ends with user.js. If the user clicks that button they will get a view/prompt within the popup showing the details of the userscript and asking for confirmation to install (which then happens in the background).

Maybe I should just implement my idea and see how people feel about it...

@quoid
Copy link
Owner Author

quoid commented Dec 3, 2021

This is more of what I was thinking (or swapping out one of the existing icons for a plus icon that is only interactive on userscript pages)

There's be a subsequent view after the user clicks to confirm installation as well.

Screen Shot 2021-12-02 at 10 36 19 PM

quoid added a commit that referenced this issue Dec 5, 2021
quoid added a commit that referenced this issue Dec 5, 2021
@quoid
Copy link
Owner Author

quoid commented Dec 6, 2021

This feature is now in the newest beta which went out last night. I am not sure notifications got sent to users even though I ticked the box saying it should.
Screen Shot 2021-12-06 at 9 19 30 AM
Screen Shot 2021-12-06 at 9 19 38 AM

@quoid
Copy link
Owner Author

quoid commented Jan 6, 2022

merged b8b8a7f

@quoid quoid closed this as completed Jan 6, 2022
@ppixiv
Copy link

ppixiv commented Oct 11, 2022

Maybe I should just implement my idea and see how people feel about it...

FWIW, I don't think this is a great user experience. Users click "Install Script" on a website and expect to get some UI explaining what wants to be installed and maybe a diff for updates, not a default unformatted page with the raw source. To users it's like clicking a link and seeing the HTML source instead of a website, it looks to the user like something is broken.

(Sorry for the random comment on a closed bug, but I didn't want to open a whole ticket just to give some minor feedback.)

@quoid
Copy link
Owner Author

quoid commented Oct 11, 2022

@ppixiv

Users click "Install Script" on a website and expect to get some UI explaining what wants to be installed and maybe a diff for updates, not a default unformatted page with the raw source.

The feature that this issue addresses is for when users navigate to a "default unformatted page with the raw source" like this. The extension isn't opening the page or navigating the user there.

I am not sure the critique applies to this issue, maybe you are talking about a different aspect of the extension?

@ppixiv
Copy link

ppixiv commented Oct 11, 2022

That's what I'm referring to. For example, if you click "Install this script" on a Greasy Fork page on a desktop browser (which is just a link to the script), it goes directly to the user's script manager UI for installing the script. If you do that on iOS with this manager installed, it just shows the raw source code, and the user has to open the extension from the address bar.

@quoid
Copy link
Owner Author

quoid commented Oct 11, 2022

@ppixiv Apologies, I didn't quite understand the feedback at first, but now I understand what you are saying.

My preference differs from yours, some reasons mentioned in my above comments. I prefer the user interaction before doing anything with the page content. On desktop, I also use this manager,however in Firefox I use Violentmonkey, which does something more akin to what you are speaking of. When you visit a userscript page, it automatically shows something similar to what we have in the popup on the screen (image below).

Again, this is not my current preference, but if others feel like this is something the deserves development time, I am very open to seeing code contributions/PRs for it.

Screen Shot 2022-10-11 at 7 52 33 PM

@quoid quoid removed the in-beta label Oct 11, 2022
@ppixiv
Copy link

ppixiv commented Oct 12, 2022

I think it's a better experience for end-users. It could make sense to have a "stop hijacking my .user.js loads" option, especially if it's part of your workflow somehow. The only time I ever look at the files directly from a URL is if I'm debugging (in which case I'll use curl).

Understood if it's not a priority, I see above that this might be a lot more involved to implement than what's in there now.

@quoid
Copy link
Owner Author

quoid commented Oct 12, 2022

@ppixiv

I prefer having the user interaction, but I could have a different preference from 99% of the users. I think the current implementation is objectively more difficult to know you can even install from the extension considering you need actually know that the popup can do that. That might be motivation enough to push this up the priority list.

Understood if it's not a priority, I see above that this might be a lot more involved to implement than what's in there now.

I think we have bigger concerns right now, especially with the popup refactor that should get done: #278, #279, #280, #333

I do think it is a non-marginal undertaking, especially figuring out how it should look on the page.

I will re-open this, so it doesn't get lost in the shuffle and I know to come back to think about it soon.

@quoid quoid reopened this Oct 12, 2022
@ppixiv
Copy link

ppixiv commented Nov 6, 2022

Just for a UI reference, this is what "Stay" does on iOS. I think it injects the prompt into the page itself (it behaves like a position: sticky inside the page), and it's a deep link that redirects to the host app for the actual installation.

0

@quoid quoid added the enhancement Feature work label May 1, 2023
@quoid quoid removed feature labels May 1, 2023
Repository owner deleted a comment from lwr001ss Oct 8, 2023
Repository owner deleted a comment from lwr001ss Oct 8, 2023
Repository owner deleted a comment from lwr001ss Oct 8, 2023
Repository owner deleted a comment from lwr001ss Oct 8, 2023
@ACTCD ACTCD linked a pull request Feb 5, 2024 that will close this issue
@ACTCD ACTCD closed this as completed in #620 Feb 7, 2024
@ACTCD ACTCD added this to Tasks Aug 19, 2024
@ACTCD ACTCD moved this to Beta in Tasks Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Any question, feedback or general comment enhancement Feature work help wanted Extra attention is needed
Projects
Status: Beta
Development

Successfully merging a pull request may close this issue.

4 participants