Hello!
I followed your steps but i encountered some issues and i would like your help
i changed
patterns: [{ from: "./public/" }]
to
patterns: [{ from: path.join(__dirname, "src", "public") }]
because it couldnt find the public folder.
the
"key": "-----BEGIN PUBLIC KEY-----\nasdasdasdsad\n-----END PUBLIC KEY-----"
this must be added after we upload thezip file to google web store
cannot be put before uploading the zip file at chrome web store ( step 5 ) because chrome web store automatically creates the key. After you upload the zip file you can add it to your code
in step 6 you say upload the chrome-extension dir but this is not wokring ( it cannot find the manifest.json file). Instead i uploaded the dir file that is being created by webpack
when i ulpoad the file there is an error saying i cant use eval inside background.js. I used chatgpt and it said :
The error you're encountering (EvalError: Refused to evaluate a string as JavaScript) occurs because your Chrome extension is running in a secure context, and the Content Security Policy (CSP) prevents the use of eval() or similar JavaScript evaluation methods. This issue is often triggered by the default eval devtool Webpack uses in development mode to inline source maps.
i added in webpack.config
devtool: "cheap-module-source-map", // Use a different devtool that doesn't use eval
i tried to run the extension but when i click sign in it doesnt do anything.
@deepblue597@simple_solutionszaf_b22a hi thank you guys so much for providing the solutions! I had the same error message but after i followed your steps, the authorization started to work smoothly.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello!
I followed your steps but i encountered some issues and i would like your help
patterns: [{ from: "./public/" }]topatterns: [{ from: path.join(__dirname, "src", "public") }]because it couldnt find the public folder."key": "-----BEGIN PUBLIC KEY-----\nasdasdasdsad\n-----END PUBLIC KEY-----" this must be added after we upload thezip file to google web storecannot be put before uploading the zip file at chrome web store ( step 5 ) because chrome web store automatically creates the key. After you upload the zip file you can add it to your codei added in webpack.config
devtool: "cheap-module-source-map", // Use a different devtool that doesn't use evalHi i have the same issue did you find any solution ?
@deepblue597 @simple_solutionszaf_b22a @fekirine_djallal_31be23ad
Thank you, authors and commenters, for the great information.
I'll share how I dealt with it, as nothing happened when I hit the login button.
In index.html hosted on Firebase Hosting,
I got “Uncaught TypeError: Failed to resolve module specifier ‘firebase/app’. Relative references must start with either “/”, “. /”, or ”... /”.”
error, so I set up index.html as follows. (It may not be a clean solution.) I was able to log in successfully! Thank you very much!
(In other words, I chose not to use signInWithPopup.js.)
index.html (Don't forget to "firebase deploy")
@deepblue597 I also had the same problem. Thanks for the steps you shared.
After following your recommendations, in firebase-project/public/signInWithPopup.js, I replaced:
import { initializeApp } from 'firebase/app';
import { getAuth, signInWithPopup, GoogleAuthProvider } from 'firebase/auth';
With:
import { initializeApp } from 'gstatic.com/firebasejs/11.0.2/fire...';
import { getAuth, signInWithPopup, GoogleAuthProvider } from 'gstatic.com/firebasejs/11.0.2/fire...';
That worked for me. Let me know if it worked for you?
My next issue is, how do I write to the database once logged in?
@deepblue597 @simple_solutionszaf_b22a hi thank you guys so much for providing the solutions! I had the same error message but after i followed your steps, the authorization started to work smoothly.