Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

add custom user scripts for webapps defined in webapp-properties.json #140

Merged
merged 2 commits into from
Feb 8, 2019
Merged

add custom user scripts for webapps defined in webapp-properties.json #140

merged 2 commits into from
Feb 8, 2019

Conversation

balcy
Copy link
Collaborator

@balcy balcy commented Jan 12, 2019

solves #124

@UniversalSuperBox
Copy link
Member

I notice that some lines here have semicolons while others do not. Proper JS style says that all lines should end with semicolons. I understand that the rest of this file does not always follow proper style, but do you think that new contributions should?

@balcy
Copy link
Collaborator Author

balcy commented Feb 8, 2019

yes I think it is better with all lines having semicolons, but as far as I remember most of morph / webbrowser app so far was without them.
Yes for new contributions I think we should try that.

@UniversalSuperBox
Copy link
Member

Alright, this tests out fine to me. I'll wait for you to fix that, test again, then merge.

@UniversalSuperBox UniversalSuperBox merged commit 7e0a951 into ubports:xenial Feb 8, 2019
@balcy balcy deleted the xenial_-_userscripts branch February 8, 2019 22:46
@cibersheep
Copy link
Contributor

@balcy Is there a blog / doc / whoeva' somewhere to know how to use this cool feature?

@balcy
Copy link
Collaborator Author

balcy commented Mar 10, 2019

I haven't found a good documentation so far, it was new to me, too and I asked the author of the issue #124
The scripts injection is / was a feature "unity webapps" of https://github.com/ubports/unity-webapps-qml/blob/b8a72650d2172b2ada9c217b148772179720e6bf/src/Ubuntu/UnityWebApps/plugin/unity-webapps-app-model.cpp and webbrowser-app made use of them.
They seem not to have been widely used though. (e.g. https://docs.ubuntu.com/phone/en/web/ubuntu-webapps-guide does not mention the user scripts)
Thinking about it now it seems to be quite a legacy feature (used in unity webapps like https://packages.ubuntu.com/xenial/all/unity-webapps-bbcnews), so we could think about additionally make available a more straight-forward way to add user scripts, e.g. via a command line switch like the url patterns and the user agent, we could add "--scripts" to add user scripts.

@mymike00
Copy link
Contributor

@balcy as you want, the important thing for me is to be able to run the custom script, I don't have preferences on how it is run.
I also didn't know and didn't find any docs on this topic, @stuartlangridge helped me in the telegram group and he told me to do it in that way...

@balcy
Copy link
Collaborator Author

balcy commented Mar 10, 2019

ok alright : ) I think it was good to solve the regression first. At least now new users can use the issue as an example how to use custom scripts.
The only possible problem I've seen so far that url patterns given via command line seem to be treated differently if webapp-properties.json is used.

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

Successfully merging this pull request may close these issues.

4 participants