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

IITC-Mobile: better support for external userscripts at gitlab/github #327

Open
johnd0e opened this issue Feb 12, 2020 · 1 comment
Open
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed mobile

Comments

@johnd0e
Copy link
Contributor

johnd0e commented Feb 12, 2020

Currently we have such intent filter:

.*\\.user.js

<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="content"/>
<data android:scheme="file"/>
<data android:scheme="http"/>
<data android:scheme="https"/>
<data android:host="*" android:pathPattern=".*\\.user.js"/>
</intent-filter>

On github/gitlab it triggers on 'blob' pages, like these:
https://github.com/TheSned/IITCPlugins/blob/master/extend-poly-lines.user.js
https://gitlab.com/AlfonsoML/wayfarer/-/blob/master/wayfarer-planner.user.js

But IITCm is unable to handle them: if we try to install from such url, then we get useless html output (installed plugin appears in list as "unknown").

So better to exclude such urls from filter.
And much even better - tranform the urls to raw source:
https://github.com/TheSned/IITCPlugins/raw/master/extend-poly-lines.user.js
https://gitlab.com/AlfonsoML/wayfarer/-/raw/master/wayfarer-planner.user.js

test urls

https://github.com/TheSned/IITCPlugins/blob/master/extend-poly-lines.user.js
https://gitlab.com/AlfonsoML/wayfarer/-/blob/master/wayfarer-planner.user.js

https://github.com/TheSned/IITCPlugins/raw/master/extend-poly-lines.user.js
https://gitlab.com/AlfonsoML/wayfarer/-/raw/master/wayfarer-planner.user.js

https://rawcdn.githack.com/TheSned/IITCPlugins/b52007347b1abab2b5be95c19f7f6ac0bb3d8aff/extend-poly-lines.user.js
https://glcdn.githack.com/AlfonsoML/wayfarer/-/raw/master/wayfarer-planner.user.js

Related to #257

@johnd0e johnd0e added bug Something isn't working enhancement New feature or request mobile help wanted Extra attention is needed labels Feb 12, 2020
@johnd0e
Copy link
Contributor Author

johnd0e commented Feb 14, 2020

Anyway, on mobile it may be tricky to pass plugin to IITC.

  • Download it.
    • Then try to just open file. In most cases IITC should come into list of proposed apps to handle the file.
    • Or open it from IITC (Add external plugin), this also works for most cases.
    • Or just manually move into /IITC_Mobile/plugins
  • Open directly from some app.
    • E.g. link posted in Telegram chat
    • In Chrome: in most cases link referring to *.user.js will be proposed to open in IITC.
      (not works for gitlab for some reason)
    • In some browsers there is possibility to pass current page to external app.
      This works in embedded browsers (Chrome custom tab), etc.
      Firefox also has this feature (look for android icon on action bar), but it currently does not work on github (though Firefox Preview is ok).

You see, I use for most cases wording very often.
That's mean that whole thing is not reliable enough, and in general, user experience here is not good.

We can make it better if we add one more possibility: install plugins via sharing.

  • Currently IITC does not handle this case.
But there are some helpers in Google Play

Anyway, we should implement share handling in IITC directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed mobile
Projects
None yet
Development

No branches or pull requests

1 participant