local file favicon idx - Help

Forums » General Opera topics » Customizing Opera

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

26. April 2010, 19:07:49

Eidolen

Posts: 56

local file favicon idx - Help

I am looking for help so I can use a custom icon for local copies of pages I keep on my Panel Bar.

I've figured out how to do this for web hosted pages by editing the corresponding .idx files and making the favicons read-only so they don't disappear upon cleaning cache and privacy settings. The problem as far as I can tell has to do with the name of the .idx file for a local file. It seems for web hosted pages, the name of the .idx file is the root domain, then individual pages under that domain are listed inside the .idx file and are able to use different favicons for each page listed there.

I've tried naming the file every way I can think of but have had no luck.

Target File:
C:\Documents and Settings\User\My Documents\Reference\Test file.mht

Some examples:
127.0.0.1.idx
127.0.0.1%2F.idx
file%3A%2F%2F127.0.0.1%2F.idx
file%3A%2F%2Flocalhost%2FC:%2FDocuments%20and%20Settings%2FMy%20Documents%2FReference%2FTest%20file.mht


Inside File:
C:/Documents%20and%20Settings/User/My%20Documents/Reference/Test%20file.mht
customicon.ico

customicon.ico


I can't remember all the different variations I tried, but I'm not even sure if I'm on the right track, or if it is possible at all. Does anyone have any insight on this issue? It really kinda stinks to have like 15 custom panels that all use the same "Bookmark Visited/Unvisited" icons and the only way to differentiate is to hover each one. I don't mind the custom edits to get it to work with web pages, (though it really should be much easier) but I'm hoping it's also possible with local copies of web pages.

Any help is greatly appreciated,
Eidolen
Opera 12.16-1860
Xubuntu 12.04LTS (Precise) 3.2.0-49-genericSMP i686 GNU/Linux
Xfce 4 Desktop Environment - version 4.8.6 (Xfce 4.8)
AMD Athlon(tm) 64 X2 Dual Core Processor 5200+
3040 MiB

27. April 2010, 10:06:03

Nailz

Posts: 754

Originally posted by Eidolen:

I am looking for help so I can use a custom icon for local copies of pages I keep on my Panel Bar.



from my localhost.idx

file://localhost/D:/keep/opera/profile/panels/javascript15-online/index.html
localhost-js.ico
file://localhost/D:/keep/opera/profile/panels/css3-online/prop-index.html
localhost-css.png

27. April 2010, 14:19:51

Eidolen

Posts: 56

Thanks for the quick reply.

I've followed your example and had "partial" success. The favicons now work properly in the main address bar when I open the locations in the main browser window, but they still do not show up on my panels. I'm at a loss as to why it won't work in the panel bar.

Any ideas?

Eidolen

Opera 12.16-1860
Xubuntu 12.04LTS (Precise) 3.2.0-49-genericSMP i686 GNU/Linux
Xfce 4 Desktop Environment - version 4.8.6 (Xfce 4.8)
AMD Athlon(tm) 64 X2 Dual Core Processor 5200+
3040 MiB

27. April 2010, 15:23:27

Nailz

Posts: 754

Originally posted by Eidolen:

I've followed your example and had "partial" success. The favicons now work properly in the main address bar when I open the locations in the main browser window, but they still do not show up on my panels. I'm at a loss as to why it won't work in the panel bar.



The weblinks go in their usual IDX, right - has nothing to do with localhost.idx. I just tried bookmarking a bunch of random websites (who have favicons) as panels, they all display in the panel. Must be pointing to a wrong file somewhere in a IDX?

What I did a while ago was moving all the files in '\icons\ someplace else temporarily, and then 1 by 1 I sorted the favicons for my most used bookmarks and panels. (It gets messy FAST in \icons\ p) Have a bunch of read-only IDX and PNG now for ages and never have any problems..

27. April 2010, 16:19:03

Eidolen

Posts: 56

Originally posted by Nailz:

The weblinks go in their usual IDX, right - has nothing to do with localhost.idx. I just tried bookmarking a bunch of random websites (who have favicons) as panels, they all display in the panel. Must be pointing to a wrong file somewhere in a IDX?

What I did a while ago was moving all the files in '\icons\ someplace else temporarily, and then 1 by 1 I sorted the favicons for my most used bookmarks and panels. (It gets messy FAST in \icons\ p) Have a bunch of read-only IDX and PNG now for ages and never have any problems..



I think you might be misunderstanding.
Yes, weblinks are working as intended in both the address bar and panels and have nothing to do with localhost.idx.

The problem is with local copies of web pages which do use localhost.idx. As you can see in the screenshot, the favicon is working when being displayed in the address bar which means that the idx is correct and it can find the proper icon to use, but the favicon still will not display in the panels for the exact same local address. It certainly looked like you are achieving what I am trying for from the looks of your localhost.idx file, but it is not working for me.

I copied and pasted the address into the address bar from the third panel from the bottom in the screenshot, so you would think the panel would display the same favicon as the address bar.

I just tried bookmarking a bunch of random websites (who have favicons) as panels, they all display in the panel.


You mind trying saving a new web page to your hard drive, point to it with a new panel, then add an entry to your localhost.idx for the new panel and give it a different favicon. (Use like a google icon or something else that already exists in your icons folder, just to make sure it is using what you specify.)

If that's too much trouble I understand and already appreciate you getting me on the right track as it is "partially" working. If I could just get over this last hurdle I'd be golden. Just seems weird that the icon changes as expected in the address bar, but the panels are still showing the default icons "Only" for local pages. If I figure it out on my own I will be sure to post so others might find it easier.

Best Regards,
E

Opera 12.16-1860
Xubuntu 12.04LTS (Precise) 3.2.0-49-genericSMP i686 GNU/Linux
Xfce 4 Desktop Environment - version 4.8.6 (Xfce 4.8)
AMD Athlon(tm) 64 X2 Dual Core Processor 5200+
3040 MiB

27. April 2010, 16:37:29

Nailz

Posts: 754

You mind trying saving a new web page to your hard drive, point to it with a new panel, then add an entry to your localhost.idx for the new panel and give it a different favicon. (Use like a google icon or something else that already exists in your icons folder, just to make sure it is using what you specify.)



I went to http://www.w3schools.com/jsref/default.asp and saved it to my drive. I opened the HTML and bookmarked it.

Added this to my localhost.idx
file://localhost/D:/keep/opera/profile/panels/JavaScript%20and%20HTML%20DOM%20Reference.htm
192.168.100.1.png




27. April 2010, 16:40:23

Eidolen

Posts: 56

OMG!

It was a combination of wrong facing back-slashes, and prefixing the local address with ""

When I set up the panels, I just copied the path from the windows explorer address bar and it had no problems finding the page. It seems for everything to be copacetic for the favicons, you must format the panels address exactly the same as you would inside the IDX file.

Which means:
Prefix the address with ""
Only use forward slashes "/"
Replace any spaces with its hex encoded equivalent "%20"

ie..
C:\Documents and Settings\Eidolen\My Documents\Documents\Reference\BBCode\Basic BB Codes.mht

Becomes:


Thanks soo much for pointing me in the right direction. I went back and studied your example and finally saw that the slashes were wrong and just followed through from there. Now if they could only add an option under "Edit Panel" to choose your own icons, everything would be right with the world. (Not really, but couldn't hurt.)

E
Opera 12.16-1860
Xubuntu 12.04LTS (Precise) 3.2.0-49-genericSMP i686 GNU/Linux
Xfce 4 Desktop Environment - version 4.8.6 (Xfce 4.8)
AMD Athlon(tm) 64 X2 Dual Core Processor 5200+
3040 MiB

27. April 2010, 16:42:34

Nailz

Posts: 754

Originally posted by Eidolen:

It was a combination of wrong facing back-slashes, and prefixing the local address with ""

When I set up the panels, I just copied the path from the windows explorer address bar and it had no problems finding the page. It seems for everything to be copacetic for the favicons, you must format the panels address exactly the same as you would inside the IDX file.



bigsmile

Yes I always do Edit Panel and make sure i get the address from there. :]

28. April 2010, 12:24:48

Eidolen

Posts: 56

Originally posted by Nailz:

Originally posted by Eidolen:

It was a combination of wrong facing back-slashes, and prefixing the local address with ""

When I set up the panels, I just copied the path from the windows explorer address bar and it had no problems finding the page. It seems for everything to be copacetic for the Favicons, you must format the panels address exactly the same as you would inside the IDX file.



bigsmile

Yes I always do Edit Panel and make sure i get the address from there. :]



After reading this again I wanted to clear up any misunderstanding someone reading this may have. Under "Edit Panel", you can enter an address formatted like Windows Explorer, or formatted like Opera and both with work to open the file. The problem is that if it's formatted like Windows Explorer, it is unable to find the Favicon. So if you get the address for the IDX file from "Edit Panel -> Address", you still have to make sure it is formatted properly.

All of these are valid Panel/Bookmark addresses to open up a local file.

C:\Documents and Settings\Eidolen\My Documents\Settings & Backups\Opera\MyPanels\Opera Mouse Gestures Summary.mht
C:/Documents%20and%20Settings/Eidolen/My%20Documents/Settings%20&%20Backups/Opera/MyPanels/Opera%20mouse%20gestures%20summary.mht
file://localhost/C:/Documents%20and%20Settings/Eidolen/My%20Documents/Settings%20&%20Backups/Opera/MyPanels/Opera%20mouse%20gestures%20summary.mht


Only the last one will work if you want to display a custom Favicon in the Panel Bar.

So I thought I'd lay out a quick guide for anyone wishing to use custom Favicons for local files in the Panel Bar.

Panel Bar Icons for Local Files Guide
1. Locate the local file (Html, MHT) and Double-Click it to have it open up in Opera.
2. Bookmark it (Ctl+D + "Show in Panel" or Drag from Address Bar to Panel Bar)
3. Edit or create a localhost.idx file in the Icons directory. (Opera 10.xx + I believe)
C:\Documents and Settings\User\Local Settings\Application Data\Opera\Opera 10.xx\icons\localhost.idx
4. Add an entry for each local file you wish to use a custom icon for. Each entry consists on two lines.
Line 1 - The Opera formatted address of the file.
I would recommend getting the address from the Address Bar when the file is open, as this will Always be formatted properly, but you can also get it from the address field under "Edit Panel" if you followed steps 1 & 2 and are not doing this for an existing Panel that might be formatted wrong.
Line 2 - The filename of the icon you want to use. (No Path Name)
The icon must be within the same "...\icons\" directory as the localhost.idx file. It appears you can use just about any type of image at any size, though it would be silly to use anything bigger than around 26x26. I use only 16x16, (Favicon size) but the choice is yours.

localhost.idx (With 2 entries)
file://localhost/C:/Documents%20and%20Settings/Eidolen/My%20Documents/Settings%20&%20Backups/Opera/MyPanels/Opera%20mouse%20gestures%20summary.mht
mouse.png
file://localhost/C:/Documents%20and%20Settings/Eidolen/My%20Documents/Settings%20&%20Backups/Opera/MyPanels/URL%20Encoding.mht
encoding.ico


Notes:
1. You will want to make all of your custom icons Read-Only. You can do the same for any other icons in the same directory that you don't want to disappear when you clean your cache and privacy settings.
2. You need to restart Opera for all the changes to take effect.

I struggled with this for a couple of days so I really hope this will be useful to someone else and save them the amount of time and frustration I experienced. I must say it was really worth the trouble though. Being able to locate the Panel I want at a glance instead of hovering over each one every time is wonderful. If anyone is having trouble with these instructions, I will do my best to help out as I would still be stuck without the help of Nailz.

Cheers,
Eidolen
Opera 12.16-1860
Xubuntu 12.04LTS (Precise) 3.2.0-49-genericSMP i686 GNU/Linux
Xfce 4 Desktop Environment - version 4.8.6 (Xfce 4.8)
AMD Athlon(tm) 64 X2 Dual Core Processor 5200+
3040 MiB

Forums » General Opera topics » Customizing Opera