2012-04-13 147 views
0

使我的第一个chorme分机。并且它在旧的comp中工作正常。现在用新的 尝试加载解包的分机。它根本不起作用。我看到了我的ext弹出式广告bg.html,但内容脚本根本没有加载,可以放在目标页面上的网络图像。 其他解压缩的分机工作正常。但我的垃圾作品(请帮我 manifest.json:页面铬扩展不加载

{ 
    "background_page": "bg.html", 
    "name": "lardi trans", 
    "version": "1.0", 
    "icons": { 
     "48": "icon_48.png" 
    }, 
    "browser_action": { 
     "default_icon": "icon_48.png", 
     "default_title": "Lardi Trans", 
     "default_popup": "popup.html" 
    }, 
    "permissions": [ 
     "tabs", 
     "notifications", 
     "http://lardi-trans.com/gruz/*", 
     "http://lardi-trans.com/trans/*", 
     "unlimitedStorage" 
    ], 
    "content_scripts": [{ 
     "matches": [ 
      "http://lardi-trans.com/gruz/*", 
      "http://lardi-trans.com/trans/*" 
     ], 
     "css": ["extent_styles.css"], 
     "js": ["jq.js", "script.js"], 
     "run_at": "document_end" 
    }] 
} 

截图其中ext应该是我纪念的地方,一定要出现在我的形式 console shot 和其他内线脚本加载这样screenshot2(5次一样!脚本?WTF ??)但无论如何我看不到我的ext script.js(为什么它不会加载?)

+0

什么是它应该做的?是否发生错误? (内容脚本错误会在它们处于活动状态的页面上报告,后台脚本错误可以通过'chrome:// extensions /' - ><您的扩展名> - >'bg.html'(在Developer模式下) – 2012-04-13 08:03:09

+0

不幸的脚本没有加载(当然错误不能出现。 – user1330964 2012-04-13 08:11:14

+0

我无法用这种模糊的描述来做任何事情......写出一份适当的错误报告。 – 2012-04-13 08:13:10

回答

1

您不必将css的链接提供给manifest.json文件。它在bg.html

我的manifest.jso N文件


{ 
    "name": "Example", 
    "version": "2.0", 
    "description": "Example.com Description", 
    "icons": { "16":"Images/Example/16x16.png", "32":"Images/Example/32x32.png", "48": "Images/Example/48x48.png", "64": "Images/Example/64x64.png", "128": "Images/Example/128x128.png" }, 

    "app": 
    { 
     "default_icon": "../Images/Example/icon.png", 
     "launch": 
     { 
      "local_path": "Pages/Index.html" 
     } 
    }, 

    "permissions": [ "http://www.Example.com/", 
        "http://*.Example.com/", 
        "https://www.Example.com/", 
        "https://*.Example.com/", 
        "unlimitedStorage", 
        "tabs", 
        "notifications" 
        ], 
    "options_page": "Pages/Options.html", 
    "background_page": "Pages/Background.html" 
} 

如果这个问题的答案帮助了你,请把它标记为一个答案......

如果你仍然采取错误,请他们到这个问题的答案的底部。

最好的问候。

编辑

查看错误 - 步骤;

点击扩展按钮打开它。

使用F12键在Google Chrome中打开调试窗口。

点击“控制台”标签页。

截取它的截图,并将图片发布到您的问题中。

有了这样每个人都可以帮助你=)

编辑2:

OK现在你的问题似乎看littlebit不同。

这里是算法;

下载使用jQuery目标网页的网站源代码, 插入你的CSS行头标记使用JSON,在localStorage的 商店新的源代码(HTML5) 当它这样做,刷新与JS的页面,并读取新的源localStorage代码 并用html显示。

+0

,但我需要注入我的CSS样式到目标页面(lardi-trans.com),它一直在工作,直到我尝试安装在新配置上 – user1330964 2012-04-13 08:29:17

+0

这是棘手的问题,我会尝试它,但主要问题是我的扩展script.js不加载(我不明白为什么。 – user1330964 2012-04-13 08:58:59

0

,如果任何人的利益,问题就解决了,由于某种原因在清单中添加unprop whitespases "content_scripts": [{ "matches": ["http://lardi-trans.com/gruz/*","http://lardi-trans.com/trans/*"], 这个作品!))