2

My manifest.json is:

{
    "manifest_version": 2,
    "name": "Test",
    "version": "1.0.0",
    "web_accessible_resources": [
        "public/*"
    ]
}

public/base.htm is:

<style>
    body {
        background-image:url('chrome-extension://__MSG_@@extension_id__/background.png');
    }

</style>
<link rel="stylesheet" href="chrome-extension://__MSG_@@extension_id__" type="text/css" />
<link rel="stylesheet" href='chrome-extension://@@extension_id/public/style_override.css' type="text/css" />

Whenever I am visiting view-source:chrome-extension://omjmnflgeadkeenialehggjcffaeonam/public/base.htm I am getting:

<style>
    body {
        background-image:url('chrome-extension://__MSG_@@extension_id__/background.png');
    }

</style>
<link rel="stylesheet" href="chrome-extension://__MSG_@@extension_id__" type="text/css" />
<link rel="stylesheet" href='chrome-extension://@@extension_id/public/style_override.css' type="text/css" />

I don't understand why these are not replaced by the chrome extension id.

Update: Just noticed it apparently works only with CSS format. Chrome don't allow inline JS. So I am still looking for an option to import external CSS/JS in this html page

  • refer [http://stackoverflow.com/questions/11553600/how-to-inject-css-using-content-script-file-in-chrome-extension](http://stackoverflow.com/questions/11553600/how-to-inject-css-using-content-script-file-in-chrome-extension) – Shweta Matkar Jun 13 '16 at 09:41

0 Answers0