koush / electron-chrome

Other
969 stars 55 forks source link

Error converting Signal app via app-id #4

Open the4ndy opened 8 years ago

the4ndy commented 8 years ago

I am trying to convert the Signal Chrome Extension (https://chrome.google.com/webstore/detail/signal-private-messenger/bikioccmkafdpakkkcpdbppfkghcmihk?hl=en) to Electron using your tool and I get the following error in a pop up window

Uncaught Exception:
TypeError: Cannot read property 'map' of undefined
    at Function.<anonymous> (/home/thesheriff/apps/Electron-Chrome/electron-chrome/chrome/main/start.js:222:11)

The resulting windows that appear do not have the Signal app (or any of its assets that are visible) and so I am not sure what I am doing wrong :/

I am running Xubuntu 16.04 and I made sure I had the most updated version of NPM, Nodejs and this repo.

I am guessing this extension will require saving things to the local system, so I was expecting some issues given that the filesystem API isn't ported yet. Anyway, any information you can give to help out would be AWESOME. Thanks again Koush for another amazing contribution to the community and I apologize for my inexperience (the idea of converting Chrome extensions into pure desktop apps is too intriguing to me to not tinker with). Thanks again!

the4ndy commented 8 years ago

I wont clutter up your issues with more of my problems, but I went ahead and tried another extension that I use often (the Google Hangouts extension) and it produced the following error in the console of the electron window that popped up (as opposed to the previous that had its own alert).

Uncaught TypeError: _._DumpException is not a function

here is the link to the extension https://chrome.google.com/webstore/detail/google-hangouts/knipolnnllmklapflnccelgolnpehhpl?hl=en

EDIT: I was reading along with the other issue about Hangouts and hadn't seen my error, but now see that it ended with "Hangouts wont work" which is fine by me, the project is still young :D

koush commented 8 years ago

I fixed the bug where it wasn't launching: bc85b95

It opens the window but fails on some storage calls.

kierer commented 8 years ago

Firstly, I'd like to chime in with @the4ndy in thanking you for publishing this project.

Might you recall whether the remaining failure was related to the lack of support for chrome.fileSystem? It looks like the electron PR referenced in the readme was merged; if nothing is likely to be blocking a successful implementation of chrome.fileSystem, I wouldn't mind having a look (any suggestions, however brief, for how best to proceed are welcome).

koush commented 8 years ago

Oh, let me take a look. One sec.

kierer commented 8 years ago

Thank you!

koush commented 8 years ago

873a9ae

koush commented 8 years ago

I put in a stub implementation that is backed by webkitRequestFileSystem. Confirmed that it writes/reads files, etc. Feel free to implement more and submit a pull request.

kierer commented 8 years ago

Wow- thank you! Rolling up my sleeves now...

koush commented 8 years ago

No problem. Feel free to hit me up if you have any questions.

koush commented 8 years ago

I've tried to make debugging as easy and similar as Chrome apps: Right click to inspect the page or background page.

There's also a "Runtime Page" which is where the bulk of polyfilled Chrome runtime lives.

Though the filesystem stuff lives in the chrome-preload.js (which is injected into your chrome app window). So if you inspect page, you'll find that here:

snapsink-1

kierer commented 8 years ago

Thank you once again! That's going to prove very helpful- I look forward to being in touch; I plan to start by looking at the parts of the storage API used by the Signal client specifically.

koush commented 8 years ago

I'll start working on this and see if I can get the basic stuff unblocked. I'm a big fan of @moxie0, and I use Signal anyways.

koush commented 8 years ago

Main issue I am seeing at the moment is that there is a ton of RPC happening between the background page and main windows. This is something that Electron handles differently: Chrome supports returning results from functions synchronously (blocking) on RPC calls. Electron wipes the result out. All RPC must be callback based.

Since the texsecure.storage.user object lives in the background page, attempting to access the get* methods are currently failing, since those all synchronously return results.

askz commented 7 years ago

Hi, any updates on this ? I get another error : electron-chrome-fail

Thanks for your work. Love your project, forever if Signal can run on it :D

robotmay commented 7 years ago

@askz Looks like that error is what @koush mentioned in his previous comment, it's a failure in the get* methods (in this case getBackgroundPage). Unfortunately I don't know enough about how Chrome apps work to really take a bash at it, but I'll see if I can find out any extra info tomorrow.

It certainly would be nice to get Signal working in Electron. It'd be nice if they choose to officially switch over to Electron now that Chrome apps are being deprecated, though I can't imagine that will happen any time soon (or at all).