Chrome extension has some errors on when loaded locally
faisal00813 opened this issue · comments
Mohammad Abdul Sami commented
HiepNguyen commented
I was able to fix these issues by doing the following:
- Use "host_permissions" to specify host-specific permissions:
"host_permissions": [
"http://localhost:3000/*",
"https://opulent-funicular-94rx4v9w775f96q-3000.app.github.dev/*",
"https://anycontext.dhr.wtf/*"
],
- Simplify
permissions
:
"permissions": [
"activeTab",
"storage"
],
- Build using
bun build
:
mkdir ./build
bun install
bun build ./src/*.tsx --outdir ./build
- Paste the built files into ./src
- Update manifest.json
Replacing all.tsx
files with the newly built.js
files:
{
"manifest_version": 3,
"name": "SuperMemory",
"version": "2.0.0",
"action": {
"default_popup": "index.html"
},
"icons": {
"16": "icons/icon16.png",
"32": "icons/icon32.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
},
"content_scripts": [
{
"js": ["src/content.js"],
"matches": [
"http://localhost:3000/*",
"https://opulent-funicular-94rx4v9w775f96q-3000.app.github.dev/*",
"https://anycontext.dhr.wtf/*",
"<all_urls>"
]
}
],
"host_permissions": [
"http://localhost:3000/*",
"https://opulent-funicular-94rx4v9w775f96q-3000.app.github.dev/*",
"https://anycontext.dhr.wtf/*"
],
"permissions": [
"activeTab",
"storage"
],
"background": {
"service_worker": "src/background.js"
}
}
- Update the
index.html
:
Also replacing with the built.js
one:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
- Manually load the Chrome extension
- Turn on Developer Mode
- Click on the Load unpacked
- Select the
apps/extension
folder
After installation, click on the extension icon > Log In.
Still having errors importing Twitter Bookmark though:
Hope it helps.
Dhravya Shah commented
import from twitter is still in the works, will be perfected very very soon 🙏
Dhravya Shah commented
Hi! The chrome extension is on the webstore now. See instructions on how to use it here - https://github.com/Dhravya/supermemory?tab=readme-ov-file#how-do-i-use-this