MCPcopy Create free account
hub / github.com/XIU2/UserScript / backToTop

Function backToTop

DuckDuckGo-Enhanced.user.js:152–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

150
151 // 快捷回到顶部(右键两侧空白处)
152 function backToTop() {
153 if (!GM_getValue('menu_backToTop')) return
154 document.querySelectorAll('#react-layout>div, #react-layout>div>div, section[data-testid=sidebar]').forEach(ele => {
155 ele.oncontextmenu = function(e) {
156 if (e.target == this) {
157 e.preventDefault();
158 window.scrollTo(0,0);
159 }
160 }
161 })
162 }
163})();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected