This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var url = require('url'); | |
var socket = require('webpack-dev-server/client/socket'); | |
function getCurrentScriptSource() { | |
// `document.currentScript` is the most accurate way to find the current script, | |
// but is not supported in all browsers. | |
if (document.currentScript) { | |
return document.currentScript.getAttribute('src'); | |
} | |
// Fall back to getting all scripts in the document. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* hmr前後で引き継ぎたいデータはまとめて外出する(Store) | |
* Storeを書き換えた場合はページをリロードするか、もしくは別途accept()の処理を書く | |
* Storeはconstructorの引数でどんどん子孫に渡していく。必要ならDIなりdecoratorなりでコードをキレイにする | |
*/ | |
/** @type {Assets} 一度だけロードすればいいやつとかはまとめておくと良い */ | |
let assets = null; | |
/** @type {Store} 復元したいデータは全部外にまとめておく or serialize的な保存・復元の方法が必要 */ | |
let store = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 90.0.4430.212 | |
setInterval(() => { | |
const button = document.querySelector("body > downloads-manager").shadowRoot.querySelector("#frb0").shadowRoot.querySelector("#pauseOrResume"); | |
if (/再開/.test(button?.textContent)) { | |
console.log("再開"); | |
button.click(); | |
} | |
}, 1000) |
OlderNewer