解析具有扩展名的网页代码

时间:2017-12-06 00:35:05

标签: javascript parsing google-chrome-extension

的manifest.json:

{
  "manifest_version": 2,
  "name": "My Cool Extension",
  "version": "0.1",

  "content_scripts": [
    {
      "matches": [
     "https://opskins.com/*"
   ],
      "js": ["jquery-3.2.1.min.js", "content.js"]


    }
  ],
  "browser_action": {
    "default_icon": "icon.png"
  }

}

content.js:

var sticker = document.body.querySelector('.sticker');

if (sticker) {
var stickerTitle = sticker.getAttribute('title');
}
console.log(stickerTitle)

https://opskins.com/?loc=shop_browse&app=730_2 适用于该页面。但是控制台响应是undefined

这就是我所需要的:

that's what I need

0 个答案:

没有答案