Chrome Extension: How many bookmarks are deleted in folders?
How do开发者_如何学Python I know how many bookmarks are deleted using the onRemoved event? This is straightforward when the user deletes bookmarks directly but what about folders? If the user deletes a folder can I find out how many bookmarks were in that folder? Or even to detect if it was a folder and not a bookmark that was deleted?
Thanks.
One way you can do this is to store all data about all the bookmarks in your own variable and when an onRemoved event is fired, you can figure out whether it is a folder and how many bookmarks were in the folder by looking at the id.
You will have to keep your variable that stores data on bookmarks updated to reflect any changes(such as adding of a bookmark).
Since Crhome 48. Chrome.bookmarks.onRmoved has a callback with 'node' param. it includes information of deleted bookmark node. I think you can parse it.
精彩评论