您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically refresh until it finds the delivery windows available
// ==UserScript== // @name Amazon Delivery Window Monitor // @namespace http://tampermonkey.net/ // @version 0.2 // @description Automatically refresh until it finds the delivery windows available // @author Ning // @match https://www.amazon.com/alm/storefront?almBrandId=VUZHIFdob2xlIEZvb2Rz* // @match https://www.amazon.com/alm/storefront?almBrandId=QW1hem9uIEZyZXNo* // @grant none // @require https://unpkg.com/[email protected]/dist/jquery.min.js // ==/UserScript== (function() { 'use strict'; var $ = jQuery; var notice; var refreshInterval = 5000; $(document).ready(function() { setTimeout(checkDelivery, refreshInterval); }); function checkDelivery() { if(Notification.permission !== 'granted') { Notification.requestPermission((result) => { if(result !== 'granted'){ console.log('Please allow Chrome notification'); return; } }) } const noTime = document.getElementsByClassName('a-size-medium naw-widget-banner-action-no-availability a-text-bold')[0]; if (!noTime) { if(Notification.permission == 'granted') { notice = new Notification('Yay!', { dir: 'ltr', body: '\n Delivery available now!' }); } } else { console.log('No delivery window available'); window.location.reload(); } } })();