Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

chrome extension background page error: "Uncaught SyntaxError: Unexpected token <"

Why is my background.html page throwing this:

Uncaught SyntaxError: Unexpected token < in line 1

Here is the actual html:

<html>
<head>
<script type="text/javascript" src="fancy-settings/source/lib/store.js"></script>
<script type="text/javascript" src="background.js"></script>
</head>
<body></body>
</html>

So chrome complains about the first opening "<" and I have no idea why.

like image 922
Kai Avatar asked Apr 25 '12 12:04

Kai


1 Answers

I had the same issue. Just replace in your manifest.json file

"background": {
    "scripts": ["background.js"]
  },

with:

"background": {
    "page": "background.html"
  },
like image 101
Alexandro Sánchez Avatar answered Oct 26 '22 12:10

Alexandro Sánchez