mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Only remove elements when doing a google dictionary search
This commit is contained in:
parent
1f9ac958e2
commit
755cf383a3
@ -13,11 +13,16 @@
|
|||||||
cc.style.marginLeft = '0';
|
cc.style.marginLeft = '0';
|
||||||
cc = document.getElementById('cnt');
|
cc = document.getElementById('cnt');
|
||||||
if (cc) cc.style.paddingTop = '0';
|
if (cc) cc.style.paddingTop = '0';
|
||||||
['sfcnt', 'top_nav', 'before-appbar', 'appbar', 'searchform', 'easter-egg'].forEach(function(id) {
|
var params = new URLSearchParams(document.location.search.substring(1));
|
||||||
|
var q = params.get('q');
|
||||||
|
if (q && q.startsWith('define:')) {
|
||||||
|
var remove = ['sfcnt', 'top_nav', 'before-appbar', 'appbar', 'searchform', 'easter-egg'];
|
||||||
|
remove.forEach(function(id) {
|
||||||
var elem = document.getElementById(id);
|
var elem = document.getElementById(id);
|
||||||
if (elem) elem.style.display = 'none';
|
if (elem) elem.style.display = 'none';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (window.location.hostname === 'www.google.com') fix_google_markup();
|
if (window.location.hostname === 'www.google.com') fix_google_markup();
|
||||||
})();
|
})();
|
||||||
|
@ -23,13 +23,13 @@ from calibre.gui2.webengine import create_script, insert_scripts, secure_webengi
|
|||||||
vprefs.defaults['lookup_locations'] = [
|
vprefs.defaults['lookup_locations'] = [
|
||||||
{
|
{
|
||||||
'name': 'Google dictionary',
|
'name': 'Google dictionary',
|
||||||
'url': 'https://google.com/search?q=define:{word}',
|
'url': 'https://www.google.com/search?q=define:{word}',
|
||||||
'langs': [],
|
'langs': [],
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
'name': 'Google search',
|
'name': 'Google search',
|
||||||
'url': 'https://google.com/search?q={word}',
|
'url': 'https://www.google.com/search?q={word}',
|
||||||
'langs': [],
|
'langs': [],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user