developer.chrome.com icon indicating copy to clipboard operation
developer.chrome.com copied to clipboard

Chrome Extension tutorial instructions yield an error

Open jauntyjocularjay opened this issue 2 years ago • 4 comments

Describe the bug I am following the steps laid out in the Chrome Extension tutorial when I get to this step and load the unpacked extension, the red error button appears but I get a blank screen when I try to view the error.

To Reproduce Steps to reproduce the behavior:

  1. Go to the Chrome Extension tutorial
  2. Follow the steps outlined in the tutorial
  3. When you come to the section Inspect the background script follow the instructions
  4. See an error
  5. Click on "Errors"
  6. User is presented with a blank screen.

Expected behavior Users should see the result of the code in the tutorial.

Screenshots image

This is what I get when I click on "Errors". image

Desktop:

  • OS: macOS 12.4 (21F79
  • Browser Chrome
  • Version: {Chrome: 103.0.5060.134 (Official Build) (x86_64)}

Additional context I checked with my organization manager and they said they do not have a setting to prevent unpacked Chrome extensions from functioning.

Update 1

  • From what I read on the internet, it looks like the tutorial is written with manifest v2 and we are on manifest v3. Once I figure out what is wrong, I would gladly update the tutorial.

Update 2

  • I downloaded the finished example and that doesn't seem to work either, although I am able to get to the console to pop up from the extension menu.
  • When I click on the icon from the extension menu I get a chrome URL error in the extension manager. image

Update 3

  • Interestingly, if background.js is empty, there doesn't seem to be a problem. It only becomes a problem when you add some kind of code to it. I cleared and added const a = "a"; and received the error.

Update 4

  • I seem to have fixed it in my intended project, but I have no idea how. I emptied out my background.js files and moved the script to content.js. You can view the code.

jauntyjocularjay avatar Jul 25 '22 17:07 jauntyjocularjay

Update 3 added.

jauntyjocularjay avatar Jul 25 '22 20:07 jauntyjocularjay

Update 4 I seem to have fixed it in my intended project, but I have no idea how. I emptied out my background.js files and moved the script to content.js. You can view the code.

jauntyjocularjay avatar Jul 25 '22 21:07 jauntyjocularjay

the Background.js thing doesnt work. it shows this on reload Screenshot 2022-07-25 6 07 12 PM any reason WHY?

ZGStuff avatar Jul 26 '22 00:07 ZGStuff

@ZGStuff You are missing a comma after the manifest_version value.

jadedrakerider avatar Jul 26 '22 00:07 jadedrakerider

@AmySteam Did one of your new tutorials replace the one that's causing this error?

jpmedley avatar Nov 10 '22 21:11 jpmedley

@jpmedley This example was removed in favor of the new Getting Started guides tutorials. This Issue is no longer relevant.

AmySteam avatar Nov 10 '22 21:11 AmySteam