How-To: Open Microsoft Favorites (.url) In Default Browser

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

How-To: Open Microsoft Favorites (.url) In Default Browser

Postby yankee495 » Feb 17th, '20, 19:59

Hi,

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.
There are 10 types of people, those who understand binary & those who don't.
Main Desktop
http://www.overclock.net/lists/display/view/id/3960066
yankee495
 
Posts: 433
Joined: May 25th, '12, 13:10
Location: Carthage, Mo. USA

Re: How-To: Open Microsoft Favorites (.url) In Default Brows

Postby denisbr » Mar 26th, '20, 20:35

Thanks for your contribution!

I´m curious, what do you have in 11.502 bookmarks registers?
User avatar
denisbr
 
Posts: 13
Joined: Oct 23rd, '18, 15:57

Re: How-To: Open Microsoft Favorites (.url) In Default Brows

Postby doktor5000 » Mar 27th, '20, 01:23

Probably his collection of bookmarks, collected over several years, I'd say.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: How-To: Open Microsoft Favorites (.url) In Default Brows

Postby yankee495 » Mar 27th, '20, 15:36

denisbr wrote:Thanks for your contribution!

I´m curious, what do you have in 11.502 bookmarks registers?



Thank you!

Duplicates! :lol:

Seriously, everything. I've been exporting and importing into new installs for years.
My friends are computer illiterate so if I need to look something up for them (again)
I can look in my bookmarks. It's pretty handy for myself too.


Since they're individual now I could use a script to download all of the pages.
I have files in this machine from the 80s. Had a house fire and lost a lot but friends had most of them.
We used the buddy backup system in those days. Actually, most of my friends just use
phones leaving only about a dozen of us with computers.
I'm the only one who tried to save everything.

Oh, also I can use a duplicate file finder and delete the exact matches and re-import them.
They are in individual folders like Linux and Recipes etc and would import to folders.
Every time I don't bookmark something
I end up looking though history or searching again so I just bookmark
everything that I might care about in the future. You'd be surprised how much you backtrack.
There are 10 types of people, those who understand binary & those who don't.
Main Desktop
http://www.overclock.net/lists/display/view/id/3960066
yankee495
 
Posts: 433
Joined: May 25th, '12, 13:10
Location: Carthage, Mo. USA


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron