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

Cannot inject custom js in webapps #124

mymike00 opened this Issue Dec 2, 2018 · 5 comments


None yet
4 participants
Copy link

mymike00 commented Dec 2, 2018

I have a plain webapp (no qml at all, I have Exec=webapp-container in the .desktop file) and a file called webapp-properties.json which calls a custom script.
the code in this custom script was executed with oxide, but not anymore with morph


This comment has been minimized.

Copy link

cibersheep commented Dec 10, 2018

There's a workaround and is using a qml with a webview and embed the js as a UserScript
In the import area you could:

import QtWebEngine 1.7 as Oxide

And in a Page element

WebContext {
	id: webcontextIF

        userScripts: [
            Oxide.WebEngineScript {
                id: cssinjection
                injectionPoint: WebEngineScript.DocumentCreation
                sourceUrl: Qt.resolvedUrl("js/cssinjection.js")
                worldId: WebEngineScript.MainWorld

And the webview:

WebView {
	id: webview

	context: webcontextIF
	url: 'https://whatever'

This comment has been minimized.

Copy link

mymike00 commented Dec 11, 2018

Thanks, I'll try that workaround, but I highly prefer not using qml in simple webapp like mine...


This comment has been minimized.

Copy link

balcy commented Dec 22, 2018

do you have an example of an app using it ? I've found hints to webapp-properties.json in the source code of morph, but not understood how the properties really work.


This comment has been minimized.

Copy link

mymike00 commented Dec 28, 2018

my .desktop has

Exec=webapp-container --webappModelSearchPath=. --store-session-cookies --webappUrlPatterns=https?://* %u

.apparmor is

    "template": "ubuntu-webapp",
    "policy_groups": [
    "policy_version": 1.3

then I have a file called webapp-properties.json

    "includes": ["*/*"],
    "name": "ExtendedWebappProperties",
    "scripts": ["myscript.js"],

and obviously a script called myscript.js


This comment has been minimized.

Copy link

UniversalSuperBox commented Feb 8, 2019

Closed via #140

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.