Skip navigation.
Home

Attention: soon, this forum will be closed for a while and a new forum will be opened instead. Here's the address of the new forum: http://custombuttons.sourceforge.net/forum.

Favicon Plus (Made By Morat) ..*New* 3.0 Here!!!!

Being someone (mrbunnylamakins) who make a lot of buttons poorly, I wanted add features to a existing button with functions along the same line of that button. Tired of having to load several buttons to do similar task, my purpose is to make multifunction buttons of the same genre. This will clean up space on toolbar and time from having encode and convert. Skipping the convoluted middle man and tedious time consuming repetitive coding.

1) Icon to Data- this converts any sites Favicon to base 64 code and pastes it in clipboard ready to use.

2) Show Icon New Tab- This allows button user to show favicon of site in a new tab.

3) Save Favicon- this allows button user to download sites favicon to their compute from open current tab

Favicon Plus 1.0

Favicon Plus Favicon Plus <<< Click Here to load Button!!

If if wasn't for Morat's help and little tweaking from me to decorate it (icons and some added code) i would of went crazy. :P



-------------------------------------------------------------------------------------------------------------
_________________________***NEW FAVICON PLUS 2.0*****______________________
-------------------------------------------------------------------------------------------------------------


NEW FEATURES!!!!!




Favicon Plus 2.0

Favicon Plus Favicon Plus <<< Click Here to load Button!!




-------------------------------------------------------------------------------------------------------------
_________________________***NEW FAVICON PLUS 2.5***______________________
-------------------------------------------------------------------------------------------------------------


NEW FEATURES!!!!!
Added to menu Convert base64 to Image.

Favicon Plus 2.5 Favicon Plus 2.5 <<< Click Here to load Button!!


-------------------------------------------------------------------------------------------------------------
_________________________***NEW FAVICON PLUS 3.0***______________________
-------------------------------------------------------------------------------------------------------------



NEW FEATURES!!!!!
Base 64 image viewer. Just enter you base 64 image code and view it.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

Please Tell me if you have any errors!

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

The only "errors" that I get is that I don't have icon for
Load Favicon Data URL
Open Favicon to Data
and what the
Open Favicon to Data is supposed to do?

Here it's opening the "Open File" window with Open button(to choose a file or something)but no matter what I choose,the end result is the same as the option above(Page Icon Copied to Data)

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

vsub

I Will Convert then to Icon than using png

Give me ten minutes and I Will Fix it

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

Ok I added Icons to the code than Png and reload the button from above and delete the old one

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

Open Favicon to Data is supposed to do?

It action is where a user can open a favicon/icon from hard drive and have it covert and spit the data out to
base64.

My Bad I will have to add help section here in couple days. >_<

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

Ok now I have icons but the "Open Favicon to data" still does the same thing as "Page Icon Copied to data" but first it's opening the "Open File" window which is pointless thing

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

If I knew how to not to have it to open to tab grab the code and then close tab I would.

I wonder if morat knows or squeaky.

I was happy I guessed (90% of the Time) to have the open icon from hard drive open to New Tab.

openTopWin(fp.fileURL.spec); to openTopWin.addTab(fp.fileURL.spec);

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

Not me :)

I haven't looked at the button yet, but while I may know a few things more than the average punter I'm certainly no expert.

morat is miles and MILES and MILES ahead of me! :)

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

The favicon service does not work with local files.

Try this:

/*Initialization code*/
var menu = <menupopup
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  onclick="this.parentNode.menuClick(event)">
    <menuitem
      class="menuitem-iconic"
      image="chrome://mozapps/skin/places/defaultFavicon.png"
      label="Load Favicon"
      onclick={"document.getElementById('" + this.id + "').loadFavicon(event)"}/>
    <menuitem
      class="menuitem-iconic"
      image="chrome://mozapps/skin/places/defaultFavicon.png"
      label="Load Favicon Data URL"
      onclick={"document.getElementById('" + this.id + "').loadFaviconData(event)"}/>
    <menuitem
      class="menuitem-iconic"
      image="chrome://mozapps/skin/places/defaultFavicon.png"
      label="Save Favicon"
      onclick={"document.getElementById('" + this.id + "').saveFavicon(event)"}/>
    <menuitem
      class="menuitem-iconic"
      image="chrome://mozapps/skin/places/defaultFavicon.png"
      label="Open Image File"
      onclick={"document.getElementById('" + this.id + "').openImageFile(event)"}/>
    <menuitem
      class="menuitem-iconic"
      image="chrome://mozapps/skin/places/defaultFavicon.png"
      label="Open Image File Data URL"
      onclick={"document.getElementById('" + this.id + "').openImageFileData(event)"}/>
    <menuitem
      class="menuitem-iconic"
      image="chrome://mozapps/skin/places/defaultFavicon.png"
      label="Copy URL"
      onclick={"document.getElementById('" + this.id + "').copy(event)"}/>
</menupopup>;
this.appendChild(custombuttonsUtils.makeXML(menu));
this.type = "menu";
this.orient = "horizontal";
this.menuClick = function(event) {
  event.preventDefault();
  event.stopPropagation();
  this.open = false;
}
this.buttonClick = function(event) {
  var url = "about:logo";
  if (event.button == 1) openWebPanel("Firefox", url);
}
this.loadFavicon = function(event) {
  var url = document.getElementById("page-proxy-favicon").src
  if (url && event.button == 0) loadURI(url);
  if (url && event.button == 1) gBrowser.addTab(url);
  if (url && event.button == 2) gBrowser.selectedTab = gBrowser.addTab(url);
}
this.loadFaviconData = function(event) {
  var ios = Components.classes["@mozilla.org/network/io-service;1"].
    getService(Components.interfaces.nsIIOService);
  var fis = Components.classes["@mozilla.org/browser/favicon-service;1"].
    getService(Components.interfaces.nsIFaviconService);
  var url = document.getElementById("page-proxy-favicon").src
  url = fis.getFaviconDataAsDataURL(ios.newURI(url, null, null));
  if (url && event.button == 0) loadURI(url);
  if (url && event.button == 1) gBrowser.addTab(url);
  if (url && event.button == 2) gBrowser.selectedTab = gBrowser.addTab(url);
}
this.saveFavicon = function(event) {
  var url = document.getElementById("page-proxy-favicon").src
  if (url && event.button == 0) openUILinkIn(url, "save");
}
this.openImageFile = function(event) {
  this.open = false;
  try {
    const nsIFilePicker = Components.interfaces.nsIFilePicker;
    var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
    fp.init(window, gNavigatorBundle.getString("openFile"), nsIFilePicker.modeOpen);
    fp.appendFilters(nsIFilePicker.filterImages);
    fp.displayDirectory = gLastOpenDirectory.path;
    if (fp.show() == nsIFilePicker.returnOK) {
      if (fp.file && fp.file.exists())
        gLastOpenDirectory.path = fp.file.parent.
          QueryInterface(Components.interfaces.nsILocalFile);
      openTopWin(fp.fileURL.spec);
    }
  } catch(e) {}
}
this.openImageFileData = function(event) {
  this.open = false;
  try {
    const nsIFilePicker = Components.interfaces.nsIFilePicker;
    var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
    fp.init(window, gNavigatorBundle.getString("openFile"), nsIFilePicker.modeOpen);
    fp.appendFilters(nsIFilePicker.filterImages);
    fp.displayDirectory = gLastOpenDirectory.path;
    if (fp.show() == nsIFilePicker.returnOK) {
      if (fp.file && fp.file.exists())
        gLastOpenDirectory.path = fp.file.parent.
          QueryInterface(Components.interfaces.nsILocalFile);
      var ioService = Components.classes["@mozilla.org/network/io-service;1"].
        getService(Components.interfaces.nsIIOService);
      var mimeService = Components.classes["@mozilla.org/mime;1"].
        getService(Components.interfaces.nsIMIMEService);
      var binaryInputStream = Components.classes["@mozilla.org/binaryinputstream;1"].
        createInstance(Components.interfaces.nsIBinaryInputStream);
      var uri = ioService.newURI(fp.fileURL.spec, null, null);
      var channel = ioService.newChannelFromURI(uri);
      binaryInputStream.setInputStream(channel.open());
      if (channel instanceof Components.interfaces.nsIHttpChannel && channel.responseStatus != 200) {
        alert("response status code " + channel.responseStatus);
      } else {
        var binaryData = new String();
        var readLength = binaryInputStream.available();
        while (readLength) {
          binaryData = binaryData + binaryInputStream.readBytes(readLength);
          readLength = binaryInputStream.available();
        }
        var contentType = mimeService.getTypeFromURI(uri);
        var encodeData = btoa(binaryData);
        openTopWin("data:" + contentType + ";base64," + encodeData);
      }
      binaryInputStream.close();
    }
  } catch(e) {}
}
this.copy = function(event) {
  var url = content.document.location.href;
  gClipboard.write(url);
  custombuttons.alertSlide(this.label, "copied to clipboard");
}
this.setAttribute("onclick", "this.buttonClick(event)");

"morat is miles and MILES and MILES ahead of me! :)"

*lol* antonglv is the only real programmer here :)

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

I don't get what you said morat. >_<

How and were are you guys getting error codes. ?? is it add-on that tell you errors in buttons??

I am able on mine to Open a icon file from hard drive and when I click OK it converts it to to base64 to clipboard (Sure it loads it to tab first then converts it then closes tab)

Thus saving from having to open new button and find the icon on drive and then hit the covert to base 64 and then copying the code to post/insert in code etc.

/*Initialization Code*/


var menu = <menupopup
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  onclick="this.parentNode.menuClick(event)">
     <menuitem
       class="menuitem-iconic"
       image="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAAAAAAAAAAAAAI2bv/9RVpf/AAAAAAAAAAAAAAAAAAAA/wbwAf8G8AH/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/AAAAAAAAAACIkvD/Jia6/ywpq/8AAAAAAAAAAAAAAAAAAAD/AAAA/wbwAf90qpv/Ymic/1RWqP9OUKr/W2Ch/2dumf9YYKT/Ly/B/xQP3/8MB9P/JCGb/wAAAAAAAAAAAAAAAAAAAP8G8AH/U5ea/ycr8f8VIP3/HiP4/ywo8v8sIvb/LCL2/ywi9v8KBOj/BQDe/wQAtv8tK4P/AAAAAAAAAAAAAAD/BvAB/3Sqm/9iaJz/Tim3/0UuuP9GPrT/R0ex/zk8uf8gIMz/FRDe/xEMzv8jIJz/AAAAAAAAAAAAAAAAAAAA/wbwAf8G8AH/BvAB/wAAAAAAAAAAAAAAAAAAAP8AAAD/SqOR/yImvP8sLKj/AAAAAAAAAAAAAAAAAAAAAAAAAP8G8AH/BvAB/wbwAf8AAAD/AAAA/wAAAP8AAAD/BvAB/3Sqm/9KW5r/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/wbwAf8G8AH/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/BvAB/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8G8AH/BvAB/wbwAf8AAAAAAAAAAAAAAAAAAAAABvAB/wbwAf8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/BvAB/wbwAf8G8AH/AAAAAAAAAAAAAAAAAAAAAAAAAAAG8AH/AAAAAAAAAP8G8AH/AAAAAAAAAAAAAAAAAAAA/wbwAf8G8AH/BvAB/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8G8AH/BvAB/wAAAAAAAAAAAAAAAAAAAP8G8AH/BvAB/wbwAf8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/BvAB/wbwAf8AAAAAAAAA/wAAAP8G8AH/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/AAAAAAAAAAAG8AH/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/BvAB/wbwAf8G8AH/BvAB/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOesQQBjrEGAAaxBwACsQcABrEHDg6xBwAesQcAPrEHAD6xBw8+sQcPprEHD8axBwAGsQQABrEGAAaxB//+sQQ=="
       label="Page Icon Copied to Data"
       onclick={"document.getElementById('" + this.id + "').openFaviconData(event)"}/>
     <menuitem
       class="menuitem-iconic"
       image="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/AAAA/wAAAP8AAA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A/wAAAP8AAAD/AAAA/wAAAP8AAAD/8QHY//EB2P8AAAAAAAAA/wAAAP/xAdj/8QHY//EB2P/xAdj/8QHY//EB2P/xAdj/8QHY//EB2P/xAdj/8QHY//EB2P/xAdj/AAAAAAAAAADxAdj/8QHY//EB2P/xAdj/8QHY//EB2P/xAdj/8QHY//EB2P/xAdj/8QHY//EB2P/xAdj/8QHY/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOesQQBjrEGAAaxBwACsQcABrEHDg6xBwAesQcAPrEHAD6xBw8+sQcPprEHD8axBwAGsQQABrEGAAaxB//+sQQ=="
       label="Copy Page Favicon URL"
       onclick={"document.getElementById('" + this.id + "').copyFaviconLocation(event)"}/>            
    <menuitem
      class="menuitem-iconic"
      image="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAAAAAAAAAAAAAI2bv/9RVpf/AAAAAAAAAAAAAAAAAAAA/wHp8f8B6fH/Aenx/wHp8f8B6fH/Aenx/wHp8f8B6fH/AAAAAAAAAACJku//Jia6/ywpq/8AAAAAAAAAAAAAAAAAAAD/AAAA/wHp8f90qpv/Ymic/1RWqP9OUKr/W2Ch/2dumf9YX6T/Ly/B/xQP3/8MB9P/JCGb/wAAAAAAAAAAAAAAAAAAAP8B6fH/VJia/ycs8f8VIP3/HiP4/y0o8v8sIvb/LCL2/ywi9v8KBOj/BQDe/wQAtv8tK4P/AAAAAAAAAAAAAAD/Aenx/3Sqm/9iaJz/Tim3/0UuuP9GPrT/R0ex/zk8uf8gIMz/FRDe/xEMzv8jIJz/AAAAAAAAAAAAAAAAAAAA/wHp8f8B6fH/Aenx/wAAAAAAAAAAAAAAAAAAAP8AAAD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AAAAAAAAAAAAAAAAA//G7Af/xuwH/8bsB/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/xuwH/8bsB/wAAAAAAAAAAAAAAAAAAAP/xuwH/8bsB//G7Af8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/8bsB//G7Af8AAAAAAAAA/wAAAP/xuwH/8bsB//G7Af/xuwH/8bsB//G7Af/xuwH/8bsB//G7Af/xuwH/8bsB//G7Af/xuwH/AAAAAAAAAADxuwH/8bsB//G7Af/xuwH/8bsB//G7Af/xuwH/8bsB//G7Af/xuwH/8bsB//G7Af/xuwH/8bsB/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOesQQBjrEGAAaxBwACsQcABrEHDg6xBwAesQcAPrEHAD6xBw8+sQcPprEHD8axBwAGsQQABrEGAAaxB//+sQQ=="
      label="Open Favicon to Data"
      onclick={"document.getElementById('" + this.id + "').opentoFaviconData(event)"}/>             
     <menuitem
       class="menuitem-iconic"
       image="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAAAAAAAAAAAAACq5JnNXllH/AAAAAAAAAAAAAAAAAAAA/wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAAAAAAAAAAquSbGKrkm/ymqKf8AAAAAAAAAAAAAAAAAAAD/AAAA/wAA//9Ya77/T3WI/1eoU/9Tqk7/YqFb/26ZZv9go1j/MsEv/w/fD/8H0gf/Ipsh/wAAAAAAAAAAAAAAAAAAAP8AAP//WcCO/zHyJv8l/RT/KPge/yfzKP8i9if/IfYl/yH2JP8E5wT/AN4A/wC1AP8sgyv/AAAAAAAAAAAAAAD/AAD//3WPqf9PdYj/KbZJ/y64Qv8+tEP/SbFG/0C5Of8lyyD/Et0Q/w3ODP8gnCD/AAAAAAAAAAAAAAAAAAAA/wAA//8AAP//AAD//wAAAAAAAAAAAAAAAAAAAP8AAAD/Rnur/yq8Iv8uqCz/AAAAAAAAAAAAAAAAAAAAAAAAAP8AAP//AAD//wAA//8AAAD/AAAA/wAAAP8AAAD/AAD//3WPqf9dmkr/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8AAP//AAD//wAA//8AAAAAAAAAAAAAAAAAAAAAAAD//wAA//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/AAD//wAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AAAAAAAAAP8AAP//AAAAAAAAAAAAAAAAAAAA/wAA//8AAP//AAD//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8AAP//AAD//wAAAAAAAAAAAAAAAAAAAP8AAP//AAD//wAA//8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAD//wAA//8AAAAAAAAA/wAAAP8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAAAAAAAAAAAAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOesQQBjrEGAAaxBwACsQcABrEHDg6xBwAesQcAPrEHAD6xBw8+sQcPprEHD8axBwAGsQQABrEGAAaxB//+sQQ=="
       label="Show Page Favicon in New Tab"
      onclick={"document.getElementById('" + this.id + "').showPageFaviconNewTab(event)"}/>
     <menuitem
      class="menuitem-iconic"
      image="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAAAAAAAAAAG0wWhMHEs/wbTBYYAAAAAAAAAAAAAAAAAAAD/AAAA/wAA//8AAP//AAD//wAAAAAAAAAAAAAAAAAAAAAG0wVkE5US/w+oDf8TlRL/BtMFZAAAAAAAAAAAAAAAAAAAAP8AAP//AAD//wAA//8AAAAAAAAAAAAAAAAG0wVkIawi/wbTBf8A2wD/BtMF/yGsIv8G0wVkAAAAAAAAAAAAAAD/AAD//wAA//8AAP//AAAAAAAAAAAAAAAAUZZT/x69H/8C5wT/AO8A/wLnBP8evR//UZZT/wAAAAAAAAAAAAAA/wAA//8AAP//AAD//wAAAAAAAAAAAAAAAAbTBWQuwi7/H/kf/wz7DP8f+R//LsIu/wbTBWQAAAAAAAAAAAAAAP8AAP//AAD//wAA//8AAAD/AAAA/wAAAP8AAAD/d8iD/271e/9o+Gn/bvV7/3fIg/8AAAAAAAAAAAAAAAAAAAD/AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wbTBcaq+KD/n/2o/6r4oP8G0wWhAAAAAAAAAAAAAAAAAAAA/wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8AAP//AAD//wAA//8AAAAAAAAAAAAAAAAAAAAAAAD//wAA//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/AAD//wAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AAAAAAAAAP8AAP//AAAAAAAAAAAAAAAAAAAA/wAA//8AAP//AAD//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8AAP//AAD//wAAAAAAAAAAAAAAAAAAAP8AAP//AAD//wAA//8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAD//wAA//8AAAAAAAAA/wAAAP8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAAAAAAAAAAAAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP+sQQBjrEGDwaxBw4CsQcOArEHDgKxBwAGsQcABrEHAD6xBw8+sQcPprEHD8axBwAGsQQABrEGAAaxB//+sQQ=="
      label="Save Page Favicon"
      onclick={"document.getElementById('" + this.id + "').saveFavicon(event)"}/>
</menupopup>;
var bool = XML.prettyPrinting;
XML.prettyPrinting = false;
var el = new DOMParser().parseFromString(menu.toXMLString(), "application/xml").documentElement;
XML.prettyPrinting = bool;
this.appendChild(el);
this.type = "menu";
this.orient = "horizontal";
this.menuClick = function(event) {
  event.preventDefault();
  event.stopPropagation();
  this.open = false;
}



this.openFaviconData = function(event) {
  var ios = Components.classes["@mozilla.org/network/io-service;1"].
    getService(Components.interfaces.nsIIOService);
  var fis = Components.classes["@mozilla.org/browser/favicon-service;1"].
    getService(Components.interfaces.nsIFaviconService);
  var url = document.getElementById("page-proxy-favicon").src
  url = fis.getFaviconDataAsDataURL(ios.newURI(url, null, null));
  if (url && event.button == 1) loadURI(url);
  if (url && event.button == 0) gBrowser.selectedTab = gBrowser.addTab(url);
  if (url && event.button == 2) gBrowser.addTab(url);
  var sURL = gURLBar.value;
  gClipboard.write(gURLBar.value);
  gBrowser.removeCurrentTab();
  if (event.button == 0) alert("Copied to Clipboard");

 
}

this.copyFaviconLocation = function(event) {
  var url = document.getElementById("page-proxy-favicon").src
  if (url && event.button == 0) gBrowser.selectedTab = gBrowser.addTab(url);
  var sURL = gURLBar.value;
  gClipboard.write(gURLBar.value);
  gBrowser.removeCurrentTab();
  if (event.button == 0) alert("Copied to Clipboard");
  
}  

this.loadFaviconData = function(event) {
  var ios = Components.classes["@mozilla.org/network/io-service;1"].
    getService(Components.interfaces.nsIIOService);
  var fis = Components.classes["@mozilla.org/browser/favicon-service;1"].
    getService(Components.interfaces.nsIFaviconService);
  var url = document.getElementById("page-proxy-favicon").src
  url = fis.getFaviconDataAsDataURL(ios.newURI(url, null, null));
  if (url && event.button == 2) loadURI(url);
  if (url && event.button == 1) gBrowser.addTab(url);
  if (url && event.button == 0) gBrowser.selectedTab = gBrowser.addTab(url);


}

this.opentoFaviconData = function(event) {
  try {
    const nsIFilePicker = Components.interfaces.nsIFilePicker;
    var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
    fp.init(window, gNavigatorBundle.getString("openFile"), nsIFilePicker.modeOpen);
    fp.appendFilters(nsIFilePicker.filterImages);
    fp.displayDirectory = gLastOpenDirectory.path;
    if (fp.show() == nsIFilePicker.returnOK) {
      if (fp.file && fp.file.exists())
        gLastOpenDirectory.path = fp.file.parent.
          QueryInterface(Components.interfaces.nsILocalFile);
      openTopWin.addTab(fp.fileURL.spec);

   
    }
  } catch(e) {}

  var ios = Components.classes["@mozilla.org/network/io-service;1"].
    getService(Components.interfaces.nsIIOService);
  var fis = Components.classes["@mozilla.org/browser/favicon-service;1"].
    getService(Components.interfaces.nsIFaviconService);
  var url = document.getElementById("page-proxy-favicon").src
  url = fis.getFaviconDataAsDataURL(ios.newURI(url, null, null));
  if (url && event.button == 1) loadURI(url);
  if (url && event.button == 0) gBrowser.selectedTab = gBrowser.addTab(url);
  if (url && event.button == 2) gBrowser.addTab(url);
  var sURL = gURLBar.value;
  gClipboard.write(gURLBar.value);
  gBrowser.removeCurrentTab();
  if (event.button == 0) alert("Copied to Clipboard");


}





this.showPageFaviconNewTab = function(event) {
  var url = document.getElementById("page-proxy-favicon").src
  if (url && event.button == 1) loadURI(url);
  if (url && event.button == 0) gBrowser.selectedTab = gBrowser.addTab(url);
  if (url && event.button == 2) gBrowser.addTab(url);  

}

this.saveFavicon = function(event) {
  var url = document.getElementById("page-proxy-favicon").src
  if (url && event.button == 0) openUILinkIn(url, "save");
}
this.setAttribute("onclick", "this.buttonClick(event)");

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

I get my error codes from the tools menu!

Tools >> Error console.

There's also an extension that gives an enhanced error report...

Console 2

It installs over the FF error console so it's still Tools >> Error Console

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

I Never open Error Console I got feed up. Almost all Mozilla pages have massive errors,
from the people that supposed to know web >_< Do they use it them selves.

I don't have that error console, I guess one more to the list won't help I mean hurt, won't hurt.

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

The vast majority of those errors are css - and you can turn those off.

PLUS - you can clear it before you hit "done" when editing and or using a button so that you see your button errors easier.

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

Can we create a Button Error Tester?

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

If you want to spend a couple of months re-inventing the wheel, go right ahead :)

IF, on the other hand, you took about... oh... ten minutes...
learning your way round the error console, then you'd find it dead simple to use effectively.

Honest :)

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

Thanks Morat!!,


This code you added, does no good unless there is a call reference to it.. >_<


 this.copy = function(event) {
  var url = content.document.location.href;
  gClipboard.write(url);
  custombuttons.alertSlide(this.label, "copied to clipboard");
}



So I did this in code..


this.openImageFileData = function(event) {
  this.open = false;
  try {
    const nsIFilePicker = Components.interfaces.nsIFilePicker;
    var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
    fp.init(window, gNavigatorBundle.getString("openFile"), nsIFilePicker.modeOpen);
    fp.appendFilters(nsIFilePicker.filterImages);
    fp.displayDirectory = gLastOpenDirectory.path;
    if (fp.show() == nsIFilePicker.returnOK) {
      if (fp.file && fp.file.exists())
        gLastOpenDirectory.path = fp.file.parent.
          QueryInterface(Components.interfaces.nsILocalFile);
      var ioService = Components.classes["@mozilla.org/network/io-service;1"].
        getService(Components.interfaces.nsIIOService);
      var mimeService = Components.classes["@mozilla.org/mime;1"].
        getService(Components.interfaces.nsIMIMEService);
      var binaryInputStream = Components.classes["@mozilla.org/binaryinputstream;1"].
        createInstance(Components.interfaces.nsIBinaryInputStream);
      var uri = ioService.newURI(fp.fileURL.spec, null, null);
      var channel = ioService.newChannelFromURI(uri);
      binaryInputStream.setInputStream(channel.open());
      if (channel instanceof Components.interfaces.nsIHttpChannel && channel.responseStatus != 200) {
        alert("response status code " + channel.responseStatus);
      } else {
        var binaryData = new String();
        var readLength = binaryInputStream.available();
        while (readLength) {
          binaryData = binaryData + binaryInputStream.readBytes(readLength);
          readLength = binaryInputStream.available();
        }
        var contentType = mimeService.getTypeFromURI(uri);
        var encodeData = btoa(binaryData);
        openNewTabWith("data:" + contentType + ";base64," + encodeData);
      }
      binaryInputStream.close();
      var sURL = gURLBar.value;
      gClipboard.write(gURLBar.value);
      gBrowser.removeCurrentTab();
      if (event.button == 0) alert("Copied to Clipboard");
    }
  } catch(e) {}
}



Plus I searched for over a hour to switch (openTopWin) with (openNewTabWith)..open new tab command
I found it on....nowhere on MDC or other placeshad info >_<


http://i18nl10n.com/mozilla/browser.js.txt

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

Open Favicon from hard drive Clipboard STRAIGHT to data now works :)

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

Your link is broken.

I don't know how you are making them but all they have is: http:///

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

Try these:

/*Code*/
alert(openNewTabWith);
gClipboard.write(openNewTabWith.toString().replace(/\n/g, "\r\n"));

this.openImageFileData = function(event) {
  this.open = false;
  try {
    const nsIFilePicker = Components.interfaces.nsIFilePicker;
    var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
    fp.init(window, gNavigatorBundle.getString("openFile"), nsIFilePicker.modeOpen);
    fp.appendFilters(nsIFilePicker.filterImages);
    fp.displayDirectory = gLastOpenDirectory.path;
    if (fp.show() == nsIFilePicker.returnOK) {
      if (fp.file && fp.file.exists())
        gLastOpenDirectory.path = fp.file.parent.
          QueryInterface(Components.interfaces.nsILocalFile);
      var ioService = Components.classes["@mozilla.org/network/io-service;1"].
        getService(Components.interfaces.nsIIOService);
      var mimeService = Components.classes["@mozilla.org/mime;1"].
        getService(Components.interfaces.nsIMIMEService);
      var binaryInputStream = Components.classes["@mozilla.org/binaryinputstream;1"].
        createInstance(Components.interfaces.nsIBinaryInputStream);
      var uri = ioService.newURI(fp.fileURL.spec, null, null);
      var channel = ioService.newChannelFromURI(uri);
      binaryInputStream.setInputStream(channel.open());
      if (channel instanceof Components.interfaces.nsIHttpChannel && channel.responseStatus != 200) {
        alert("response status code " + channel.responseStatus);
      } else {
        var binaryData = new String();
        var readLength = binaryInputStream.available();
        while (readLength) {
          binaryData = binaryData + binaryInputStream.readBytes(readLength);
          readLength = binaryInputStream.available();
        }
        var contentType = mimeService.getTypeFromURI(uri);
        var encodeData = btoa(binaryData);
        gClipboard.write("data:" + contentType + ";base64," + encodeData);
        alert("Copied to Clipboard");
      }
      binaryInputStream.close();
    }
  } catch(e) {}
}

There is no point in using the gBrowser.removeCurrentTab() function.

Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

Do you get this on your when testing the code????


Re: Favicon Plus (Made By Morat) ..*New* 2.0 Here!!!!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is used to make sure you are a human visitor and to prevent spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.