Snap4Arduino icon indicating copy to clipboard operation
Snap4Arduino copied to clipboard

Creating a Custom Chromium Extension for use in my website

Open Ericthestein opened this issue 5 years ago • 0 comments

Continuing our conversation from https://github.com/bromagosa/Snap4Arduino/pull/295:

@jguille2

I'm having some trouble getting my custom extension working on my website. Here are the steps I took:

  1. I added my custom websites to manifest.json
  2. I ran ./prepare --all
  3. I ran ./build --platform=web/chromium
  4. I used the, "pack extension," option in chrome://extensions/ to pack the crx folder from the releases folder.
  5. I dragged the produced .crx file into chrome://extensions/ (and gave it permission to access my device)
  6. I copied the ID into plugin/plugin.js
  7. I ran ./build --platform=web/chromium again
  8. I copied the resulting www folder into my website
  9. I put the local index.html file in this folder into an iFrame

When I tested the website on localhost, everything worked as expected. However, after deploying the website to my domain, clicking, "Connect Arduino," on that domain caused nothing to happen. I also received this error message in the console: "Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist."

Any advice would be greatly appreciated. Thanks!

Ericthestein avatar Aug 04 '20 06:08 Ericthestein