MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / initTest

Function initTest

scripts/smoothScroll.js:198–216  ·  view source on GitHub ↗

* Tests if smooth scrolling is allowed. Shuts down everything if not.

()

Source from the content-addressed store, hash-verified

196 * Tests if smooth scrolling is allowed. Shuts down everything if not.
197 */
198 function initTest() {
199 // disable keyboard support if the user said so
200 if (!options.keyboardSupport) {
201 removeEvent("keydown", keydown);
202 }
203 // disable everything if the page is blacklisted
204 if (options.excluded) {
205 let domains = options.excluded.split(/[,\n] ?/);
206 domains.push("mail.google.com"); // exclude Gmail for now
207 domains.push("play.google.com/music"); // problem with Polymer elements
208 for (let i = domains.length; i--; ) {
209 if (document.URL.indexOf(domains[i]) > -1) {
210 isExcluded = true;
211 cleanup();
212 return;
213 }
214 }
215 }
216 }
217 /**
218 * Sets up scrolls array, determines if frames are involved.
219 */

Callers 1

enableSmoothScrollFunction · 0.85

Calls 2

removeEventFunction · 0.85
cleanupFunction · 0.85

Tested by

no test coverage detected