Skip to content

Instantly share code, notes, and snippets.

@mehran-prs
Last active April 21, 2021 08:42
Show Gist options
  • Save mehran-prs/d6ab9b011a7a328e7bceaf7ca9099e20 to your computer and use it in GitHub Desktop.
Save mehran-prs/d6ab9b011a7a328e7bceaf7ca9099e20 to your computer and use it in GitHub Desktop.
ldoceonline just dictionary style
/* stylish theme, this style should apply on the domain: ldoceonline.com in stylish settings */
/* hide google adds */
iframe,.footer,.quizzes,.share_panel,.topslot-container,
.exercises,.logo_link,.text_welcome,.home_content+.carousel,
#iotd{
display: none!important;
}
.header{
text-align: center;
}
.entry_content{
margin-top: 10px;
}
.entry_content, .responsive_cell2 .right_col{
margin-top:50px;
}
// ==UserScript==
// @name ldoce(longman dictionary)
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.ldoceonline.com/*
// @match https://ldoceonline.com/*
// @icon https://www.google.com/s2/favicons?domain=ldoceonline.com
// @grant none
// ==/UserScript==
(function () {
'use strict';
console.log("termpermonkey script loaded...")
let searchInput = document.getElementsByName("q")[0]
function keypress(e) {
if (e.ctrlKey && e.key === "y") {
searchInput.focus();
// window.scrollTo(0,0);
}
}
function windowVisibilityChanged(e) {
if (!document.hidden) {
searchInput.focus({preventScroll: true});
}
}
window.addEventListener('keypress', keypress, false);
document.addEventListener("visibilitychange", windowVisibilityChanged);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment