Strange behaviour with old chrome extention

30 views
Skip to first unread message

Anton Avramov

unread,
Dec 21, 2023, 12:33:14 PM12/21/23
to nw.js
Hi, 
I'm using an old kiosk chrome extension that I'm using on different machines. 
I need to keep the chrome extension, since the arm community build are old version an on those machines I use just chromium. 
My problem is activating the Widevine, since on some machine spotify is used. 
the manifest.json of the extension loads the file like this: 
"app": {
"background": {
"scripts": ["node_modules/async/dist/async.js",
"node_modules/lodash/lodash.min.js",
"js/main.js"],
"persistent": false
}
},

And there are some shortcuts defined like this: 
"commands": {
"openAdmin": {
"suggested_key": {
"default": "Ctrl+A",
"mac": "MacCtrl+A"
},
"description": "Open the setup page"
},

If I start nw with the directory of the extension it would start, but I can not activate Widevine since If I try to load nw.enableComponent i get ReferenceError: nw is not defined. 
If I rename manifest.json to package.json, then I can enable widevine, but then the shortcuts doesn't work. 

I when over the nw code and can see that if package.json is not found then it tries manifest.json https://github.com/nwjs/nw.js/blob/9b0f01d8008c0863eaf1261480e68fc2bd4adcab/src/nw_package.cc#L307 for the basic settings, but it seams there is another difference when it gets to loading the extension. 

My goal was to add in the manifest "main" attribute to a file that just enables Widevine and then just start the extension, but I don't seam to find a way to do that. 

Does anyone here have some knowlege and experience with such a problem and how to overcome it?

Thanks in advance

Anton Avramov

unread,
Dec 21, 2023, 4:01:19 PM12/21/23
to nw.js
Of course I'll be struggling with 2 days with the problem and 30 min after posting here I found the solution :) 

To resolve the issue I rename manifest.json to package.json and then add "domain":"{the extention original id}"

That did resolve the problem with Widevine, but unfortunately for some reason the spotify player doesn't work with nwjs :(

I'll file a separate issue once I gather more details.

Reply all
Reply to author
Forward
0 new messages