UrlChecker icon indicating copy to clipboard operation
UrlChecker copied to clipboard

Provide lightweight scripting support for better flexibility

Open codebymikey opened this issue 9 months ago • 2 comments

Describe a related problem (optional)

It would be nice if custom scripting capabilities were available similar to the Untracker app.

This provides the most flexibility for certain edge-cases e.g. https://github.com/TrianguloY/URLCheck/issues/170#issuecomment-1414038431 since it should be easily achievable in JavaScript.

My specific use case was for calling an API (https://tinyurl.com) to shorten the current URL and then redirecting to it so that I could type it on the PC. However the current Webhook module is a bit limited since it doesn't allow you to work with the responses in any way.

Describe your suggested feature

Use a library such as QuickJS for scripting same as Untracker and allow users to add multiple scripts which can be easily disabled.

It'll allow users to manipulate URLs as they want, and the script will have certain utility functions to help simplify the process, such as:

  • a function for making URL requests using any HTTP method - allowing users to make more complicated webhook requests etc, and work with the response.
  • functions to work with URLs, such as stripping all or fetching certain query strings etc.
  • function to log/send messages to the UI after match.

Describe alternatives you've considered for your suggested feature

No response

Other details

No response

Acknowledgements

  • [x] I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
  • [x] I have written a short but informative title.
  • [x] I will fill out all of the requested information in this form.

codebymikey avatar Mar 20 '25 19:03 codebymikey

Fun fact! The current module system is designed with this in mind, adding arbitrary modules that all react to new urls and can change it. Adding a new 'javascript module' should be easy, but it requires adding a javascript parser (or try to use the existing webview implementation, but that has some issues). The library you suggest may be a good fit, but as I said in another comment I would like to keep the app size limited, when possible. I'll have to investigate how much the library costs, but I can consider adding it (or for someone to create a pr with this new module!)

TrianguloY avatar Mar 22 '25 09:03 TrianguloY

I hadn't considered using a WebView for some reason, that's probably the easiest way to keep the app size small.

I've previously worked with a WebView based library before, so that might be the way forward

The current module system is designed with this in mind, adding arbitrary modules that all react to new urls and can change it

Yeah, I really liked the modular approach to things, and was initially considering whether an "extension" API could be created that allows extension APKs to be installed and used similar to this - that way the core app size could be kept at a minimum, but third party modules could be worked on independently from the main one.

It seems like it'd be an interesting feature, but doubt there'd be much traction on it apart from doing it as a passion project for exploring that part of the Android API.

codebymikey avatar Mar 24 '25 11:03 codebymikey

The way tasker does it with plugins? I would love to add that, not only for external modules made by myself but for other modules made by other people too! And... this app is a passion project for me, so if my ocd mind decides I will definitely investigate!

TrianguloY avatar Mar 28 '25 19:03 TrianguloY