-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve favicons support in private:… bookmarks #147
Labels
Comments
Testcase for protocolRedirect.html: var uri = Services.io.newURI(spec, null, null); // We accept only valid URIs
//try {
// setFavicon(uri.scheme + "://" + uri.hostPort + "/favicon.ico");
//}
//catch(e2) {
//}
if(location.protocol == "private:")
setBookmarkFavicon(document.documentURIObject, uri);
location.replace(spec);
...
function setBookmarkFavicon(bookmarkURI, pageURI) {
try {
// Note: works only if that page was already loaded in non-preivate mode
var faviconService = Components.classes["@mozilla.org/browser/favicon-service;1"]
.getService(Components.interfaces.mozIAsyncFavicons);
faviconService.getFaviconURLForPage(pageURI, {
onComplete: function(uri, dataLen, data, mimeType) {
uri && faviconService.setAndFetchFaviconForPage(
bookmarkURI,
uri,
false /*aForceReload*/,
faviconService.FAVICON_LOAD_PRIVATE
);
}
});
}
catch(e) {
Components.utils.reportError(e);
}
} (and the same with |
Infocatcher
added a commit
that referenced
this issue
May 22, 2014
Infocatcher
added a commit
that referenced
this issue
May 22, 2014
Infocatcher
added a commit
that referenced
this issue
Aug 9, 2014
See view-source:chrome://browser/content/tabbrowser.xml <method name="setIcon"> if (sizedIconUrl) { let size = Math.round(16 * window.devicePixelRatio); sizedIconUrl += (sizedIconUrl.contains("#") ? "&" : "#") + "-moz-resolution=" + size + "," + size; } (#147)
Infocatcher
added a commit
that referenced
this issue
Aug 9, 2014
Infocatcher
added a commit
that referenced
this issue
Sep 2, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Requested here: https://addons.mozilla.org/addon/private-tab/reviews/591920/
We currently use hardcoded
/favicon.ico
link (like https://www.google.com/favicon.ico):https://github.com/Infocatcher/Private_Tab/blob/0.1.7.2/protocolRedirect.html#L85-L89
We should try to use something like mozIAsyncFavicons.getFaviconURLForPage() -> setAndFetchFaviconForPage()
https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/mozIAsyncFavicons
Testcase with custom favicon:
http://infocatcher.ucoz.net/test/favicon.html
http://fiddle.jshell.net/93Gy3/2/show/
The text was updated successfully, but these errors were encountered: