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

Feature Request //@ Mobile #2174

Open
cyber-sec0 opened this issue Sep 17, 2024 · 4 comments
Open

Feature Request //@ Mobile #2174

cyber-sec0 opened this issue Sep 17, 2024 · 4 comments

Comments

@cyber-sec0
Copy link

cyber-sec0 commented Sep 17, 2024

Expected Behavior

// @ Mobile true (or enabled)
This should define if a script can run on mobile/desktop or not. When // @ Mobile is false/disabled then only allow the script to run on desktop
(similar to #2102 )

Actual Behavior

This doesn't exist

Specifications

  • Edge: Latest
  • TM: Latest
  • OS: W11

Now with Kiwi browser and many other mobile browsers adding support to tampermonkey, it's time to consider having a way to let script devs set if the script is mobile or not.

Issue = I've Edge/Win11 and Kiwi Browser/Android, I often have to export my Edge scripts to my phone, so I can have the same data and scripts on both.
The issue is that many scripts others/I made to TM were made only for desktop websites, like they only work if the user holds CTRL/SHIFT or hovers/selects/middle-clicks on something, so on mobile, these scripts are impossible to use, and I have to take a long time disabling them and enabling mobile only scripts (like scripts to disable YT autopause, that I keep disabled on desktop), or even though they don't work on mobile websites, they do crash many mobile websites, causing big issues.
It's hard to manually do that for over 200 scripts...

@derjanb
Copy link
Member

derjanb commented Sep 18, 2024

These scripts work when you enable "Desktop view" in your mobile browsers. So unconditionally not let them run might also be wrong.

@cyber-sec0
Copy link
Author

cyber-sec0 commented Sep 18, 2024

I barely ever enable "Desktop view" in my mobile browser.
As a script developer, I really want to have this option.
Even if a script works on "Desktop view", I only enable this mode to see hidden parts of the site, that can't be seen/used on mobile, never because I want to use a "Desktop" script...

I actually really would like to disable desktop scripts while on "Desktop view", because I don't use any external mouse/keyboards with my android phone, so even though these desktop scripts may work, I don't have a CTRL/SHIFT etc keys anyway.

I would like to keep my desktop only apps, disabled on mobile, even if desktop view is enabled.

"unconditionally not let them run might also be wrong." I agree, but if a dev that made a script clearly wants it disabled at all times (like me), then not even giving this option to devs is wrong as well.

I think that most devs would understand how this feature works, so they wouldn't mistakenly disable scripts on mobile, then want to use them with the "desktop view", but we could add a 3rd option as well:
1 totally disable on mobile
2 fully enable on mobile
3 enable on mobile only on "desktop view" mode

@7nik
Copy link

7nik commented Sep 18, 2024

The definition of mobile compatibility is really fuzzy: it is not only about using keyboard/mouse/touch events (by the way, you can connect the mouse and keyboard to a smartphone) but also about compatibility with a site's mobile layout (if it has one) and not crashing due to a lack of some Web API (mobile browsers tend to lack various features, though mostly uncommon ones).

You can do something like this to avoid running userscripts:

if (window.navigator.platform.startsWith("Android")) return;

though the userscript will still be loaded onto the site.

Another solution is to

  1. mark all the scripts you want to keep enabled/disabled, e.g. set @namespace mobile,
  2. in the TM Dashboard enable filtering (click the filter icon in the header of the first column)
  3. select everything and disable
  4. filter by @namespace is mobile
  5. select all the filtered scripts and enable

Or you can mark them as pc-only and then select scripts only once.

@derjanb
Copy link
Member

derjanb commented Sep 19, 2024

As a script developer, I really want to have this option.

I'm not opposed to it. I'm just thinking about how it could work to give as much benefit as possible to the users.

The definition of mobile compatibility is really fuzzy

What I found so far: https://stackoverflow.com/a/76012165/1896125

Another solution is to [...]

Tampermonkey now has @tag support. Script authors could also flag their script with a mobile tag to show that it is compatible to mobile web pages.

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

No branches or pull requests

3 participants