Closed harae37 closed 4 years ago
@harae37 the addon/manifest.json
file is a "meta data" file. u don't need to include it in any HTML page or anything like that. instead, it's the browser that uses this file when u try to load a new addon. see my instructions for how to load an addon in firefox in my previous comment.
For adding the missing comma in line 14 should it be "browser_action":, or "browser_action",: ?
it's not line 14 that's missing the comma it's line 12: https://github.com/harae37/data-bodies/blob/f7408300d2be5b6702e74ac0628ad8704d68ac4b/addon/manifest.json#L12
take a look at the rest of the file && notice where the commas are, u'll notice that line 12 should have one (based on the rest of the file's syntax)
Got it. I added the comma and tried to test on Firefox, but now it's telling me :
" JSON.parse: expected double-quoted property name at line 12 column 3 of the JSON data".
I don't think I'm seeing any missing quote marks, do you see them by any chance?
it looks like u also added commas to the last items in the arrays. this is known as a "trailing comma", for example here's a javascript array with no trailing comma:
x = [ "nick", "tina", "andy" ]
now here it is again but this time with a trailing comma (after "andy")
x = [ "nick", "tina", "andy", ]
in JavaScript this is ok (b/c as we discussed in class JavaScript is very good at fixing our tiny mistakes), but in JSON (which is a data format inspired by JavaScript, but it's not actually JavaScript) the syntax is much more strict. so if u add trailing commas (ie commas after the last item in an array) it won't work
also, i noticed u added the "matches" property (that's great!) but u have it set to "://.mozilla.org/*" this mean the addon will only run on pages that "match" that pattern, ie. only on mozilla.org pages. i'm guessing u want it to run on every website u visit (not just mozilla's page) so u'll want to do some research && see what the correct setting for matches is in this case.
I changed the mozilla.org into http:///, and tested and I think it worked (it didn't give me the error box).
looks good, i tried it too && it worked on my end :) i'll accept the pull request
Got it. I changed the link to the website into the temporary address. But I'm still unsure of the js part, bc I didn't put in manifest.json into the html yet. Which part should I put it in?