I have 11,502 bookmarks in Chrome/Chromium. Many are old but I don't want to delete them because they still work. I needed a way to export them and have them be searchable instead of all being in one big .html file. I knew Microsoft did use individual .url files and I'm not sure what they use today. I also knew we have keditbookmarks, a Bookmarks editor. I exported my bookmarks from Chrome to a .html file.
Install keditbookmarks.
Note: Kedit bookmarks does not show up in the menu in Mageia 7. I added it to my menu and gave it a nice icon etc.
You can run it with:
- Code: Select all
/usr/bin/keditbookmarks
I then used File>Import>Mozilla Bookmarks to import the bookmarks.html file. Then I used File>Export>Internet Explorer Bookmarks.
Select a folder and it'll store each bookmark as an individual file. It also retains the folders, so if you have a folder called Mageia with bookmarks about Mageia, it'll be just like that when exported. They're now searchable from the file manager or Kfind, Catfish etc.
The problem was when you double click them the default browser downloaded them, not opened them. After trying 40 scripts where were supposed to work, I finally found one that does. I have a /bin folder in my home directory but the script could be put in /usr/bin or wherever you want to put it, as long as the system can find it.
The script is simple and includes the URL of where I found it.
- Code: Select all
#!/usr/bin/bash
# From https://askubuntu.com/questions/353932/equivalent-of-url-file-on-ubuntu
sed 's/^URL=/URL=/' "$1" | grep -m 1 '^URL=' | sed 's/^URL=//' | sed 's/\r//' | xargs xdg-open
To make the script just copy all of the code to a text file. Then save. I named mine ieurl.sh
Then right click the file and click properties, and check "Is Executable". It's now ready to run.
If you look at the original it said "sed 's/^BASEURL=/URL" but my exported bookmarks just said URL so I changed it. I guess MS used to use BASEURL= in the file. I'm not sure if it worked the other way. I really need to brush up on my scripting. My .url bookmark for this forum looks like this.
- Code: Select all
[InternetShortcut]
URL=https://forums.mageia.org/en/viewforum.php?f=7
The script strips everything but the actual URL and passes it to the default browser. Now you need to tell it to use your script when you open a .url file.
Just right click on any of the exported .url files and select "Open With", then browse to and select your script. Checkmark "Remember application association for all files...type x-mswinurl. It's easy, you'll see it.
Now, using Dolphin, you can search for "Mageia boot" and it'll bring up all of your old bookmarks dealing with booting Mageia. That recipe website is just a couple of seconds away without using a search engine.
More tips for those with large numbers of bookmarks. Bookmark the Bookmark Manager in Chrome/Chromium.
Open the Bookmark Manager and drag the link from the address bar to the bookmarks bar. I right clicked mine and renamed it with a * (To save space) and I can click it and search the bookmarks quickly. I make folders on the bookmark bar and name them with just one letter. "S" is search, "P" is photography, and "M" is anything to do with Mageia etc. This gives you drop down menus of bookmarks and you can have a lot more of them with shorter names. Just drop a Mageia forum bookmark on the M folder or drag above it and wait for it to open, then you can position how far down the list it is placed. These work in Firefox too.
Chrome/Chromium started storing icons in the bookmark file and it causes a stall when opening the bookmark menus with lots of bookmarks. There was a bug that made it really bad, but they fixed it. Still, I wanted to clean out my bookmarks and still have all of my bookmarks available. Now I'm working on how to bookmark a folder and have Chrome/Chromium open that folder in the default file manager so I can get to my stored bookmarks quickly.
I hope this helps some of you who bookmark everything like I do. Searching is hard work, and it's getting harder with paid ads at the top. This will help you get to where you're going faster, if you'v been there before. As I said when I started, I tested a lot of scripts that worked, only they didn't. I really need to brush up on my scripting, a lot, and I wouldn't have to hunt for a script to open a folder in the default file manager from within Chrome/Chromium. I guess I should start with how Chrome handles files. It'll probably require an extension. Have fun.