-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Bug: firefox - unable to log in #237
Comments
How did you install the extension on firefox? |
#194 (comment) Failing because our approach with the service-worker needs to be duplicated in a background.js or similar. |
I can take a peek at this unless someone else is already looking at this. |
.take |
Loading the browser extension locally surfaces errors immediately. This is what I get if I use the build as it currently is. This is expected as the manifest doesn't respect what Firefox is looking for. If I tweak it to use scripts, the extension is able to load. {
"manifest_version": 3,
"name": "OpenSauced.ai",
"version": "1.12.0",
"action": { "default_popup": "index.html" },
"content_scripts": [
{
"js": ["src/content-scripts/github.ts"],
"matches": ["https://github.com/*"],
"run": "document_end"
}
],
"background": {
- "service_worker": "src/worker/background.ts",
+ "scripts": ["src/worker/background.ts"],
"type": "module"
},
"icons": {
"16": "src/assets/os-icons/os-icon-16.png",
"32": "src/assets/os-icons/os-icon-32.png",
"48": "src/assets/os-icons/os-icon-48.png",
"128": "src/assets/os-icons/os-icon-128.png"
},
"host_permissions": ["https://github.com/*", "https://*.insights.opensauced.pizza/*" , "https://www.linkedin.com/*"],
"permissions": ["scripting", "storage", "tabs", "cookies"]
} You still can't log in because of other warnings. I'll keep digging into this but one thing to note is that the crxjs project does not currenly support Firefox. See crxjs/chrome-extension-tools#644. This is not a blocker, but it does mean that for the time being at least, development can only be done for a Chromium based browser (Chrome, Arc etc.). For Firefox, it will have to be a build time thing only and manual testing to ensure it's in a good state. |
Looking into this, I discovered a bug where it tries to set the preferred color mode when logged out. I'll create a good first issue for that. That's one reason you can't log in. After that I got this message Add this to stop getting that error for now, so storage works. The ID can be anything for local dev for a Firefox build. See Extensions and the add-on ID and browser_specific_settings. {
"manifest_version": 3,
"name": "OpenSauced.ai",
"version": "1.12.0",
"action": { "default_popup": "index.html" },
...
"host_permissions": ["https://github.com/*", "https://*.insights.opensauced.pizza/*" , "https://www.linkedin.com/*"],
"permissions": ["scripting", "storage", "tabs", "cookies"],
+ "browser_specific_settings": {
+ "gecko": {
+ "id": "[email protected]",
+ "strict_min_version": "1.0"
+ }
+ }
} The other thing I did was to make declare global {
interface Window {
browser: typeof chrome;
}
// eslint-disable-next-line no-var
var browser: typeof chrome;
}
if ("browser" in globalThis) {
globalThis.chrome = browser;
} The last bit might not be completely necessary. Still investigating that. It still looks like |
Here is the branch I'm working in for Firefox support @bdougie, https://github.com/nickytonline/ai/tree/firefox. The issue I'm running into at the moment when I run the Firefox add-on is I keep getting these Can't access dead object errors anytime There is this method called Another reason the login doesn't even being is because this code at the start of
|
As mentioned above, the crxjs project does not currently support Firefox, so to debug things you will have to build the project, load it back up in Firefox, debug, rinse repeat. To setup Firefox for debugging an extension (add-on):
|
@nickytonline these steps were extremely helpful. I added the permission in the settings and was immediately allowed to log in. |
Unassigning myself for now. Happy to help on this if we revisit Firefox support. |
Describe the bug
I'm not able to log into the extension:
2023-08-03.15-23-10.mp4
I have
extensions.sdk.console.loglevel
set to "all" in my browser as well. But I'm not seeing logs. Maybe there's more to do to get logs out of the extension.Steps to reproduce
Browsers
No response
Additional context (Is this in dev or production?)
No response
Code of Conduct
Contributing Docs
The text was updated successfully, but these errors were encountered: