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) |
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
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
// 入力から学習した漢字->ひらがなのマッピングを入れる | |
const mapping = {}; | |
// 漢字の部分を取得するための正規表現キー | |
// 漢字としているが、実際にはひらがな以外の文字で、カタカナなども含む | |
const KANJI = '(.+)'; | |
/** | |
* 学習した漢字->ひらがなのマッピングを適用して学習済みの漢字をひらがなに置き換える | |
* @param {string} _word |
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
// 使える!! | |
$('body').velocity(); | |
// ただし、下記のようにどこかしらでVelocityを参照していないとプラグインを読み込んでくれない | |
// 結局のところエントリポイントのファイルとかでimport 'jquery-velocity';読んでおくのがベターな気がする | |
Velocity; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>status-bar tap event</title> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
</head> | |
<body style="margin: 0;"> | |
<div id="hidden-header" style="position: relative; z-index: 2; background: #808080;">hidden-header</div> | |
<div id="header" style="position: relative; z-index: 2; background: #cccccc;">header</div> | |
<div id="container" style="overflow: auto; position: relative; z-index: 1;"> |
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
https://jsfiddle.net/62mtbcc4/ |
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
import DomRenderer from './DomRenderer.js'; | |
const title = 'title'; | |
document.body.appendChild(DomRenderer.render( | |
<dummy> | |
<h1>{title}</h1> | |
<button callback={onClick}>button</button> | |
</dummy> | |
)); |
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 main = require('./module/main.js'); | |
main.load('assets/js/data.json'); |
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 zero = +new Date() | |
, now = function(){ return +new Date() - zero; } | |
, wait = function(time){ var start = now(); while(now() - start < time){}; }; | |
console.log('start:', now()); // #start: 0 | |
// ======================================== | |
setTimeout(function(){ | |
console.log('async:', now()); // #async: ? | |
}, 1000); | |
wait(1500); |
NewerOlder