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

Question: Could Rango currently run on Electron #278

Open
SkepticMystic opened this issue Mar 11, 2024 · 2 comments
Open

Question: Could Rango currently run on Electron #278

SkepticMystic opened this issue Mar 11, 2024 · 2 comments

Comments

@SkepticMystic
Copy link

SkepticMystic commented Mar 11, 2024

Hey there!

I've got a question, hoping you can assist.
I learned recently that Electron has some support for Chrome extensions: https://www.electronjs.org/docs/latest/api/extensions#loading-extensions

You load an extension by calling:

window.electron.session.defaultSession.loadExtension('path/to/unpacked/extension').then(({ id }) => {
  // ...
})

One caveat is that you have to load the extension "unpacked". Now, I don't really understand this stuff, but I've done the following so far:

  1. Clone repo
  2. npm install & npm run build:v3
  3. window.electron.session.defaultSession.loadExtension('dist-v3')

Electron is happy, no errors are thrown. But nothing about Rango seems to be in effect. No markers, the hotkeys don't work, Talon-Rango commands aren't recognised.

With your knowledge, do you think this is possible? The original link has info about which extension APIs are supported, so maybe a necessary one is missing. I don't see any logs from Rango, not sure if those would be propagated up to the app console. Any info you can share here would be really helpful

@david-tejada
Copy link
Owner

I have never created anything with Electron so I don't know if it will work. Here are somethings you can try to see if you can make it work:

  • Make sure you are using the proper npm command. The one you copied here is wrong. It should be: npm run build:mv3 and the folder created dist-mv3.

  • Check if the background script (service worker) is running. I'm not sure how you would do this in Electron. In Chrome you do this by going to chrome://extensions. You should be able to click the service worker link and check if there are any errors.

  • Check if the content script is running. For this you open the devtools. Click on Sources and then in the left bar select Content scripts. You might have to click on the arrow ">>" to select this.

@SkepticMystic
Copy link
Author

Hey, thanks for this!

  1. I wrote it incorrectly in the issue, but used the write one in the code. This is confirmed by electron returning the mainfest after loading the extension.
  2. I went to Dev Tools > Application > Service Workers, but don't see any loaded..
  3. There are also no Content Scripts, as you mentioned

So it seems like this isn't working.. I'll do a bit more research to do if there's something else I need to do.
But for now, thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants