mirror of
https://github.com/mue/mue.git
synced 2026-07-11 18:31:47 +02:00
feat: add support for google favicon to quick links
This commit is contained in:
@@ -8,6 +8,7 @@ export default function QuickLinks() {
|
||||
<>
|
||||
<h2>{language.title}</h2>
|
||||
<Switch name='quicklinksenabled' text={window.language.modals.main.settings.enabled} category='quicklinks' element='.quicklinks-container' />
|
||||
<Checkbox name='quicklinksddgProxy' text={window.language.modals.main.settings.sections.background.ddg_proxy} element='.other' />
|
||||
<Checkbox name='quicklinksnewtab' text={language.open_new} category='quicklinks' />
|
||||
<Checkbox name='quicklinkstooltip' text={language.tooltip} category='quicklinks' />
|
||||
</>
|
||||
|
||||
@@ -107,7 +107,7 @@ export default class QuickLinks extends React.PureComponent {
|
||||
// allows you to add a link by pressing enter
|
||||
document.querySelector('.topbarquicklinks').onkeydown = (e) => {
|
||||
e = e || window.event;
|
||||
let code = e.which || e.keyCode;
|
||||
const code = e.which || e.keyCode;
|
||||
if (code === 13 && this.state.showAddLink === 'visible') {
|
||||
this.addLink();
|
||||
e.preventDefault();
|
||||
@@ -125,9 +125,12 @@ export default class QuickLinks extends React.PureComponent {
|
||||
const tooltipEnabled = localStorage.getItem('quicklinkstooltip');
|
||||
|
||||
const quickLink = (item) => {
|
||||
const useProxy = (localStorage.getItem('quicklinksddgProxy') !== 'false');
|
||||
const url = useProxy ? 'https://icons.duckduckgo.com/ip2/' : 'https://www.google.com/s2/favicons?sz=32&domain=';
|
||||
|
||||
const link = (
|
||||
<a key={item.key} onContextMenu={(e) => this.deleteLink(item.key, e)} href={item.url} target={target} rel={rel} draggable={false}>
|
||||
<img src={'https://icons.duckduckgo.com/ip2/' + item.url.replace('https://', '').replace('http://', '') + '.ico'} alt={item.name} draggable={false}/>
|
||||
<img src={url + item.url.replace('https://', '').replace('http://', '') + (useProxy ? '.ico' : '')} alt={item.name} draggable={false}/>
|
||||
</a>
|
||||
);
|
||||
|
||||
|
||||
@@ -226,5 +226,9 @@
|
||||
{
|
||||
"name": "photoInformation",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"name": "quicklinksddgProxy",
|
||||
"value": true
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user