This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 973
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI and misc front-end changes for tor
Disable search suggestions in private mode for Tor Fix #13064 set ddg as default search engine in tor private tabs fix #13212 Disable webtorrent in tor private mode fix #13063 load favicons in Tor tabs as data: URLs fix #13065 Omit unlocked icon for HTTP onion sites Fix #12990 also fix unittests Test Plan: 1. go to http://3expgpdnrrzezf7r.onion/ in a private tab 2. no icon should be in the urlbar 3. go to https://3g2upl4pq6kufc4m.onion/ 4. you should see a lock icon
- Loading branch information
1 parent
e61cee6
commit 76954af
Showing
19 changed files
with
2,549 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const getBase64FromImageUrl = (url) => { | ||
return new Promise((resolve, reject) => { | ||
const img = new window.Image() | ||
img.onerror = function () { | ||
reject(new Error('unable to load image')) | ||
} | ||
img.onload = function () { | ||
const canvas = document.createElement('canvas') | ||
canvas.width = this.naturalWidth | ||
canvas.height = this.naturalHeight | ||
canvas.getContext('2d') | ||
.drawImage(this, 0, 0) | ||
resolve(canvas.toDataURL('image/png')) | ||
} | ||
img.src = url | ||
}) | ||
} | ||
|
||
let faviconUrl = window.location.origin + '/favicon.ico' | ||
const faviconNode = document.head.querySelector("link[rel='icon']") || document.head.querySelector("link[rel='shortcut icon']") | ||
if (faviconNode) { | ||
faviconUrl = faviconNode.getAttribute('href') || faviconUrl | ||
} | ||
|
||
getBase64FromImageUrl(faviconUrl).then((data) => { | ||
chrome.ipcRenderer.sendToHost('got-page-favicon', data) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.