您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Closes social media from 7 AM to 5 PM inclusive on weekdays, 6 AM to 10 AM Saturdays, and completely free on Sundays!
当前为
// ==UserScript== // @name Mediablock // @description Closes social media from 7 AM to 5 PM inclusive on weekdays, 6 AM to 10 AM Saturdays, and completely free on Sundays! // @include https://*.reddit.com // @include https://*.reddit.com/* // @include https://*.facebook.com // @include https://*.facebook.com/* // @include https://*.twitter.com // @include https://*.twitter.com/* // @include https://scratch.mit.edu // @include https://scratch.mit.edu/* // @include https://*.newgrounds.com // @include https://*.newgrounds.com/* // @include https://*.myspace.com // @include https://*.myspace.com/* // @include https://*.youtube.com // @include https://*.youtube.com/* // @run-at document-start // @version 0.0.1.20151123071330 // @namespace https://greasyfork.org/users/12417 // ==/UserScript== // For any further inquiries, please contact me at scratch.mit.edu/users/iamunknown2 or reddit/u/iamunknowntwo function block() // Function will block the website. { var current = window.location.href; window.close(); // Attempt to close tab if (window.location.href == current) // If it's still there { window.history.back(); // Go back if (window.location.href == current) // If it's still there { window.location.href = "about://newtab"; // Go to a new tab } } } var date1 = new Date(); var hours = date1.getHours(); // Hours var day = date1.getDay(); // Day of the week if (day === 6) // If it's a Saturday { block(); } else if (hours >= 6 && hours <= 16 && day !== 0) // If hours are 7 AM to 5 PM (inclusive) and not a Sunday { block(); }