I am learning to write javascript and chrome extension. I want an extension that will show a button, and on a click it will add a bookmark folder in the bookmarks. So far so good, got the button, but clicking it adds nothing.
I suppose my javascript is not correct:
here is the code
manifest:
Code:{ "name": "My First Extension", "version": "1.0", "background_page": "background.html", "permissions": [ "tabs", "http://*/*", "bookmarks" ], "browser_action": { "default_icon": "icon.png", "name": "HELLO WORLD" } }I suppose it isCode:background.html <html> <head> <script> function updateIcon() { chrome.bookmarks.create({parentId: bookmarkBar.id, title: 'Extension bookmarks'}); } chrome.browserAction.onClicked.addListener(updateIcon); updateIcon(); ); </script> </head> </html>
that is wrong.Code:function updateIcon() { chrome.bookmarks.create({parentId: bookmarkBar.id, title: 'Extension bookmarks'}); }
Please, advice me and any ggod places for learning javascript. I have read http://code.google.com/chrome/extensions/bookmarks.html already


LinkBack URL
About LinkBacks



Reply With Quote