Chrome extension not working - is it possible?

1,706 views
Skip to first unread message

Blane Cameron

unread,
Feb 7, 2017, 6:17:02 PM2/7/17
to nw.js

Trying to use the Google Extension - Office Editing for Docs, Sheets & Slides. This works quite well in Chrome and wanting to use it in a wee project.
https://chrome.google.com/webstore/detail/office-editing-for-docs-s/gbkeegbaiigmenfmjfclcdgdpimamgkj

I suspect that NW.js is not enabled for this type of extn since the docs list only chrome.contentSettings, chrome.tabs and chrome.proxy as supported.

I tried the react-tools extn and it works fine so I guess this is covered by chrome.tabs

I used similar techniques for the Office extn.

The extension was retrieved from the Chrome appdata folders (Library/Application Support/Google/Chrome/Default/Extensions) in unpacked form.

At one point I tried to place the extension into the app profile manually (
Library/Application Support/Office/Default/Extensions) and when the app (Office) was
run after a delay all the files in the extension folder were deleted except for the manifest.json so NW.js is trying to do something with the extension.

I have noticed that the chromium-args path needs to be a full path, relative will not work. Begs the question of where the location of the extension folder should be
 in a NW.js app package - should it be in the appdata profile as for Chrome?

package.json (in app)

  "chromium-args": "--load-extension=Users/usernamehere/Desktop/gbkeegbaiigmenfmjfclcdgdpimamgkj --enable-logging --v=1",
  "webview": {
    "partitions": [
      {
        "name": "trusted",
        "accessible_resources": [
          "<all_urls>"
        ]
      }
    ]
  }
}

manifest.json (in extn)

  "chrome-extension://*", "file:///*"     in permissions

I've tried using a webview and iframe - in theory the iframe permission requirement isn't as stringent and in Chrome the extension appears to use iframe.
I noticed that with iframe if the extension path was unavailable (it sets up on load) then NWjs would handle the file target as normal eg: a .csv file will trigger a download box.

sample code for test:
// Process webview/iframe stuff using Google extension - Office Editing for Docs, Sheets & Slides
//    var target = "targets/test.pdf";
       var target = "targets/test.csv";
//       var target = "Users/blatman/Desktop/gbkeegbaiigmenfmjfclcdgdpimamgkj/test.csv";
//    var hippo = "<webview id=\"mvwbv\" partition=\"trusted\" src=\"" + target + "\"></webview>";
    var hippo = "<iframe id=\"mvnwbv\" partition=\"trusted\" src=\"" + target + "\"></iframe>";
    document.getElementById("mainview").innerHTML = hippo;


Typical error from chrome log:
INFO:CONSOLE(0)] "window.localStorage is not available in packaged apps. Use chrome.storage.local instead.", source: chrome-extension://gbkeegbaiigmenfmjfclcdgdpimamgkj/_generated_background_page.html (0)
[23350:5643:0207/225036.936506:INFO:CONSOLE(1)] "Uncaught TypeError: Cannot read property 'getItem' of undefined", source: chrome-extension://gbkeegbaiigmenfmjfclcdgdpimamgkj/scripts/configs/allEditFeatures.js (1)

I tried with nwjs-0.21.0b1-sdk-osx on 10.11.6 El Capitan.

Also tried to install the chrome extension into Chromium with no luck - Chromium handles .csv files the same way as NW.js

So I guess there are a few more tricks needed to get this extn working .... Maybe this needs to be a feature request?

Can anybody help?



Roger

unread,
Feb 7, 2017, 7:52:05 PM2/7/17
to Blane Cameron, nw.js
Is it a browser extension or chrome app? NW doesn't support browser extensions (except devtools extensions) because it's not a browser.

However if the extension works like an app you can submit a feature request for it.

Regards,
Roger

--
You received this message because you are subscribed to the Google Groups "nw.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nwjs-general...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Blane Cameron

unread,
Feb 8, 2017, 9:29:17 AM2/8/17
to nw.js
Thanks for the reply Roger.

It is a browser extension.  I actually tried another browser extension of the New Tab variety and it works fine (probably because NW.js supports chrome.tabs extensions)
- it just opened up a new window with the new tab content (in this case it is Oceans HD Wallpapers). Any functionality within the tab was there except for context menu stuff
and the  populated toolbar (url field only).

My thinking was that if the Office extension was able to work in a tab as it normally would when viewing files (xls,doc,csv, etc) then it may work similarly to the New Tab extension.
Is it possible that the Office extension is working for the chrome.tabs bit but needs another part of the chrome extensions API enabled to work?

Cheers,

Blane

lv2l...@gmail.com

unread,
Jun 26, 2019, 11:00:48 PM6/26/19
to nw.js
how was you able to get a chrome extension to work? what the step you took to get a chrome extension to work with within nwjs? i understand that all extension might not work but you was able to get some to work right? how did you do it? 

Blane Cameron

unread,
Jun 27, 2019, 4:46:57 AM6/27/19
to nw.js

Last tried with 0.37 and required full path but relative was made possible on OSX however there is still an outstanding Chromium bug affecting .xls on Mac.
See -
https://github.com/nwjs/nw.js/issues/7010

Lisa LaBorde

unread,
Sep 28, 2022, 8:25:09 AM9/28/22
to nw.js
I'm having a similar issue but not following the tech conversation. Is it possible to dumb this down for an average user? 

I just got a new Mac funning MacOS Monterey 12.5.1. 

I cannot open an Excel file uploaded to my drive. In my old Mac, it allowed me to open these files in Google Sheets, but not working now. This is the URL: chrome-extension://gbkeegbaiigmenfmjfclcdgdpimamgkj/views/app.html (Office editing for Docs, Sheets and Slides ... Version
143.573.580)

Thanks

Lisa LaBorde

unread,
Sep 29, 2022, 8:01:52 AM9/29/22
to nw.js
Found my own answer here: https://support.google.com/docs/answer/9331167?hl=en#2.5

Convert Excel files to Sheets

....

To automatically convert all future uploads of Office files to Google Sheets:

  1. In Drive, at the top, click Settings ""and thenSettings.
  2. Next to Convert uploads, turn on Convert uploaded files to Google Docs editor format.

    Note: Previously uploaded files will not be converted.



Reply all
Reply to author
Forward
0 new messages