How to create bookmarks using javascript ?
How to create bookmarks using javascript ?
I tried creating a single bookmark with search word But I can't get this to work. How can I bypass security to make it work ? Do I really have to enable debug mode ? Is it possible to switch debug mode without having to restart the browser (and discard all tabs)
Here is the code I tried
undefined
javascript:(async()=>{let t="S",n="GPT Classic",u="https://chatgpt.com/g/g-YyyyMT9XH-chatgpt-classic/?q=%25s",k="cc",g=(await PlacesUtils.bookmarks.search({parentGuid:PlacesUtils.bookmarks.toolbarGuid,title:t}))[0]?.guid||(await PlacesUtils.bookmarks.insert({parentGuid:PlacesUtils.bookmarks.toolbarGuid,title:t,type:PlacesUtils.bookmarks.TYPE_FOLDER})).guid;await PlacesUtils.bookmarks.insert({parentGuid:g,title:n,url:u}),await PlacesUtils.keywords.insert({keyword:k,url:u}),alert(`Bookmark "${n}" added to folder "${t}" with keyword "${k}"!`)})();