Install Bookmarklets
Install bookmarklets
This page shows how to install a browser bookmarklet so you can inject custom tools into any web page.
Use the button below to drag a new bookmark into your bookmarks bar, or copy the bookmark URL manually.
ESP Dict bookmarklet
Drag this button to your bookmarks bar to install the dictionary hook loader:
How to use
- Make sure your browser shows the bookmarks bar.
- Drag the button above to the bookmarks bar.
- Visit any page where you want to use the bookmarklet.
- Click the new bookmark to load the dictionary hook.
If drag-and-drop is blocked
If your browser prevents dragging the button, create a new bookmark manually and paste the following URL into the bookmark’s address/URL field:
javascript:(function(){var s=document.createElement('script');s.src='https://piotereks.top/bmlet/bookmarklet-install.js?SCRIPT_URL=%2Fbmlet%2Fdict-word-hooks.js&LOADING_FLAG=__dictWordHooksBookmarkletLoading';var parent=document.body||document.head||document.documentElement;parent.appendChild(s);})();
Notes
- The bookmarklet loads
dict-word-hooks.jsfrom/bmlet/dict-word-hooks.js. - Use it on pages where you want the dictionary hook to run.
ESP Dict bookmarklet — inline (test only)
Same script inlined — no external load, useful for testing without deploying:
javascript:(()=>{var t="https://piotereks.top/esp-dict/?word=",n="esp_dict_window",o="dict-word-hook-styles",r="dict-word-hook-overlay",d="__dictWordHookActive",i=(()=>{try{return new RegExp("^[\\p{L}\\p{M}]+(?:[%27’-][\\p{L}\\p{M}]+)*$","u")}catch(e){return/^[A-Za-zÀ-ÖØ-öø-ÿ]+(?:[%27’-][A-Za-zÀ-ÖØ-öø-ÿ]+)*$/}})(),a=(()=>{try{return new RegExp("[\\p{L}\\p{M}]+(?:[%27’-][\\p{L}\\p{M}]+)*","u")}catch(e){return/[A-Za-zÀ-ÖØ-öø-ÿ]+(?:[%27’-][A-Za-zÀ-ÖØ-öø-ÿ]+)*/}})(),c="",u=null;function s(e){return t+encodeURIComponent(e)}function m(){var e=document.getElementById(r);return e||((e=document.createElement("button")).id=r,e.type="button",e.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),c&&window.open(s(c),n),w()}),(document.body||document.documentElement).appendChild(e)),e}function l(e){return!e||!(e=String(e).trim())||80<e.length?"":i.test(e)?e:(e=e.match(a))?e[0]:""}function p(){var e=window.getSelection();return e?80<(e=String(e.toString()).trim()).length?l(e):e:""}function v(){clearTimeout(u)}function w(){v();var e=document.getElementById(r);e&&(e.style.display="none"),c=""}function y(){setTimeout(function(){var e,t=p();(t=t&&(l(t=t)||t))?(e=m(),c=t,e.textContent="📖 es-dict: "+t,e.setAttribute("aria-label","Open dictionary for "+t),e.style.display="flex",v(),u=setTimeout(w,6e3)):w()},80)}function f(e){var t=document.getElementById(r);t&&e.target===t||w()}function E(e){"Escape"===e.key?w():!e.altKey||e.ctrlKey||e.metaKey||"d"!==e.key&&"D"!==e.key||(e.preventDefault(),(e=p())&&window.open(s(e),n))}function e(){var e;window[d]?(document.removeEventListener("mouseup",y,!1),document.removeEventListener("touchend",y,!1),document.removeEventListener("mousedown",f,!0),document.removeEventListener("touchstart",f,!0),document.removeEventListener("keydown",E,!1),window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w,!1),w(),(e=document.getElementById(r))&&e.remove(),(e=document.getElementById(o))&&e.remove(),window[d]=!1):(window[d]=!0,document.getElementById(o)||((e=document.createElement("style")).id=o,e.textContent="#dict-word-hook-overlay{position:fixed;left:50%;bottom:max(16px,env(safe-area-inset-bottom));transform:translateX(-50%);z-index:2147483647;display:none;align-items:center;justify-content:center;min-height:56px;max-width:92vw;padding:14px 22px;border:0;border-radius:999px;background:rgba(20,20,20,.94);color:#fff;font:700 16px Arial,sans-serif;box-shadow:0 4px 18px rgba(0,0,0,.35);backdrop-filter:saturate(140%) blur(6px);cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}#dict-word-hook-overlay:active{transform:translateX(-50%) scale(.98);}",document.head.appendChild(e)),m(),document.addEventListener("mouseup",y,!1),document.addEventListener("touchend",y,!1),document.addEventListener("mousedown",f,!0),document.addEventListener("touchstart",f,!0),document.addEventListener("keydown",E,!1),window.addEventListener("scroll",w,!0),window.addEventListener("resize",w,!1))}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()})();
Note: this bookmarklet contains the full script inline. Use the loader version above for production.