avoid adding # to the page URL when clicking dummy links (#1006)
This commit is contained in:
parent
c43315e697
commit
7e7839bb1e
|
@ -85,6 +85,12 @@ onDOMready().then(() => {
|
||||||
|
|
||||||
// set language for CSS :lang and [FF-only] hyphenation
|
// set language for CSS :lang and [FF-only] hyphenation
|
||||||
document.documentElement.setAttribute('lang', chrome.i18n.getUILanguage());
|
document.documentElement.setAttribute('lang', chrome.i18n.getUILanguage());
|
||||||
|
// avoid adding # to the page URL when clicking dummy links
|
||||||
|
document.addEventListener('click', e => {
|
||||||
|
if (e.target.closest('a[href="#"]')) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function onDOMready() {
|
function onDOMready() {
|
||||||
if (document.readyState !== 'loading') {
|
if (document.readyState !== 'loading') {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user