Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. ----------------------- chrome.bookmarks.remove
  2. this can remove a bookmark (with a given id) or an empty bookmark folder.
  3.  
  4. // window.my_url gives url in my bMark_2017 wali ext.
  5. // you can use a string or simply location.href
  6.  
  7. chrome.bookmarks.search({url: window.my_url }, function (btn_arr){
  8. console.log(btn_arr[0].id, btn_arr);
  9. chrome.bookmarks.remove(btn_arr[0].id, function(t){
  10. // Note: t here gives nothing. So, don't use anything. i have kept
  11. // just to make this sure. t returns 'undefined'.
  12. console.log(t, "removed bMark with id: ", btn_arr[0].id);
  13. });
  14. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement