// ==UserScript== // @name Genshin & Honkai Impact Auto Daily Check-In // @namespace Genshin // @description Genshin Impact & Honkai Impact Auto Daily Check-In. Pin daily tab and collect rewards every day you open your browser. // @author NightLancerX // @match https://webstatic-sea.mihoyo.com/ys/event/signin-* // @match https://webstatic-sea.hoyolab.com/ys/event/signin-* // @match https://act.hoyolab.com/ys/event/signin-sea-* // @match https://act.hoyolab.com/bbs/event/signin-bh3* // @icon https://webstatic-sea.mihoyo.com/favicon.ico // @version 1.7 // @license MIT License // @grant none // @run-at document-end // @noframes // @downloadURL none // ==/UserScript== (function(){ 'use strict'; let badge; setTimeout(function(){ badge = document.querySelector('[class^=components-home-assets-__sign-content_---actived]') || document.querySelector('[class*=components-home-assets-__sign-content_---signday]'); if (badge) badge.click() else console.log('No badge item'); checkLogin(); }, 10000 + Math.random()*2000); setTimeout(function(){ let closeBtn = document.querySelector('[class^=components-common-common-dialog-__index_---dialog-close]'); if (badge && closeBtn){ closeBtn.click(); console.log('Checked'); } else console.log('No close button'); }, 15000 + Math.random()*1500); function checkLogin(){ if (document.querySelector('.mhy-account-flow-login')){ //request initial permission if not granted if (Notification.permission != 'granted'){ document.querySelector('.login-btn').onclick = function(){Notification.requestPermission()}; } //notify afterwards [if granted] if (Notification.permission != 'denied'){ let notification = new Notification('Genshin Auto Daily Check-In: logging required') } else console.error('Notifications are disabled') } } })();