Tags:

{
"content_scripts": [ {
"js": ["jquery.js","TwitterMute.js" ],
"matches": [ "https://twitter.com/" ]
} ],
"name": "TwitterMute",
"permissions": [
"tabs","https://twitter.com/
","storage","activeTab"
],
"description": "Mute Twitter User",
"icons": {
"128": "icon128.png",
"16": "icon16.png",
"48": "icon48.png"
},
"manifest_version": 2,
"version": "1.0"
}

^ manifest file ครับ ใส่ permissions tabs แล้วแต่

javascript code ใน extension ตามนี้ครับ

var incss = ".tweet[data-user-id='14658323'],
.js-retweet-text a.pretty-link[data-user-id='14658323'] b {display: none;}
.js-retweet-text a.pretty-link[data-user-id='14658323']:after {content: 'Muted' !important;}
.tweet[data-user-id='156562122356'],
.js-retweet-text a.pretty-link[data-user-id='156562122356'] b {display: none;}
.js-retweet-text a.pretty-link[data-user-id='156562122356']:after {content: 'Muted' !important;}"

แต่ผมเจอ error มาแบบนี้ ไปไม่เป็นเลย

    chrome.tabs.insertCSS(tab.id, {code: incss }); 

i got error chrome.tabs is not available: You do not have permission to access this API. Ensure that the required permission or manifest property is included in your manifest.json. binding:202
Uncaught ReferenceError: tab is not defined

ใครพอจะทราบวิธีแก้บ้าง

Get latest news from Blognone
By: anu
Contributor
on 18 June 2013 - 21:37 #588175

Uncaught ReferenceError: tab is not defined

ปัญหาคือไม่เจอ tab.id นี่ครับ ลองใช้ null หรือ tab_id ที่ถูกต้องดูครับ

By: xenatt
ContributorWindows PhoneRed HatSymbian
on 19 June 2013 - 05:22 #588272
xenatt's picture

ขอบคุณครับ ^^


Opensource - Hackintosh - Graphic Design - Scriptkiddie - Xenlism Project