DEV Community

Discussion on: Chrome extensions: Local storage

Collapse
 
paulasantamaria profile image
Paula Santamaría • Edited

Hi Dilbwag! The page.service.js is a regular file containing a class. I just got into the habit of naming my data access files using the suffix .service, but it could've been called page-service.js too, for example.
The reason your code breaks when you change the file's name is that you must also change the references to the file in the following places:

  • manifest.json: Where you declare the background scripts, search for the page.service.js entry at the end of the scripts array and replace it with the new filename (e.g. page.js)
  • popup.html: At the end of the body tag, we added a script tag referencing page.service.js. It should be replaced to reference the new filename.

Updating the filename in those 2 places should do it. Hope it helps! :)

Collapse
 
dilbwagsingh profile image
Dilbwag Singh • Edited

It does work now. Thank you so much. Also, are you planning on continuing this series for updating it to manifest V3?

Thread Thread
 
paulasantamaria profile image
Paula Santamaría

Yes! You read my mind 😂 I'm actually working on an article about Manifest V3 right now. My plan is to do an overview and then go through the steps to migrate this sample extension to v3 :)

Thread Thread
 
dilbwagsingh profile image
Dilbwag Singh

Cool😁 Will be waiting for it!!!