Today, we made a simple Chrome browser extension: Adding bookmarks!
It is to add a folder in the bookmarks manager, but, but, like the example in the official document...
Even if you want to name the rule, you have a method named addbk (). For details, add bookmark ^_^.
Why can't the results work? The browser didn't respond. What about why?
Finally, I finally figured out that this method cannot be named. Change the name and add "1"-> addbk1 ()!
OK! Oh mygad!
I think it should be because Chrome has occupied the method name, or it is still another reason. I don't even know,
Well, write down this question first and study it later!
The Code is as follows:
Function addbk1 () {<br/> alert ("hello-1"); <br/> chrome. bookmarks. create (<br/> {'parentid': '1', 'title': 'ligybook'}, <br/> function (newfolder) {<br/> alert ("hello-2"); <br/>}< br/>); <br/>}
After reading the official documentation, I just don't understand what should I write the parendid value? Of course, it is the ID of the parent node ^_^
How can I find the ID of the parent node! Should I use Chrome. bookmarks. Search () to query it based on the bookmarks' name and obtain its ID !? It's hard to die, sorry...
Hey, you can see that in the code above, parentid is assigned "1", and "1" is what the magic horse means?
"1" represents the first node in all the top-level contacts in the bookmarks manager.
"2" is definitely the second node in all the top-level contacts in the bookmarks manager.
And so on!
As for saving bookmarks in the third node of the first layer, you should use Chrome. bookmarks. Search () to find them!
More concise methods are to be studied!
Over!