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

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

Merged
merged 2 commits into from Feb 8, 2019

Conversation

Projects
None yet
4 participants
@balcy
Copy link
Collaborator

balcy commented Jan 12, 2019

solves #124

@UniversalSuperBox

This comment has been minimized.

Copy link
Member

UniversalSuperBox commented Feb 8, 2019

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

UniversalSuperBox commented Feb 8, 2019

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

1 check passed

continuous-integration/jenkins/pr-merge This commit looks good
Details

@balcy balcy deleted the balcy:xenial_-_userscripts branch Feb 8, 2019

@cibersheep

This comment has been minimized.

Copy link

cibersheep commented Mar 10, 2019

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

@balcy

This comment has been minimized.

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

This comment has been minimized.

Copy link

mymike00 commented Mar 10, 2019

@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

This comment has been minimized.

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 join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.