要素のイベントはデフォルトでバブリングされるので、windowでイベントを拾うというのが一般的な方法です。
ちなみにjQueryでの動的要素へのイベント設定もこの仕組みを使っています。
window.addEventListener('click', evt => {
if(evt.target.classList.contains('foo')) {
console.log("FOO↑↑↑");
}
});| -thread_queue_size 512 -framerate 10 -f rawvideo -pix_fmt rgb32 -video_size 1920x1080 -i \\.\pipe\captura-8efba1cb-61c4-4a4c-a6a7-da2b3c47e2ed -thread_queue_size 512 -f s16le -acodec pcm_s16le -ar 44100 -ac 2 -i \\.\pipe\captura-3714b764-3029-43bb-8c0f-7ad9b8b5ad16 -vcodec libx264 -crf 15 -pix_fmt yuv420p -preset ultrafast -r 10 -c:a aac -strict -2 -b:a 256k "C:\Users\synamon07\Documents\Captura\2018-07-07-13-53-51.mp4" |
| class hoge { | |
| constructor() { | |
| this.win = window; | |
| this.win.onresize = resizeCanvas; | |
| this.offsetWidth = 0; | |
| this.offsetHeight = 0; | |
| this.recorder1 = null; | |
| this.recorder2 = null; | |
| this.recorderStream = null; | |
| this.$btnRec = doc.getElementById('btn-tgl-rec'); |
| using System; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UnityEngine.Networking; | |
| using WebSocketSharp; | |
| public class TextureDownload : MonoBehaviour | |
| { |
| class MessageSerializer { | |
| constructor(buffer) { | |
| this.offset = 0; | |
| this.textDecorder = new TextDecoder(); | |
| this.types = { | |
| none: { cmd: 0, func: _ => { } }, | |
| null: { cmd: 1, func: this.setNull }, | |
| boolean: { cmd: 2, func: this.setBool }, | |
| sbyte: { cmd: 3, func: this.setInt8 }, | |
| byte: { cmd: 4, func: this.setUint8 }, |
| Version 15.6.7 | |
| VisualStudio.15.Release/15.6.7+27428.2043 | |
| Microsoft .NET Framework | |
| Version 4.7.03056 | |
| インストールされているバージョン:Community | |
| Visual C++ 2017 00369-60000-00001-AA804 | |
| Microsoft Visual C++ 2017 |
| ffmpeg -i RL.mp4 -filter_complex [0:v]crop=iw/2:ih:0:0[top];[0:v]crop=iw/2:ih:ow:0[bottom];[top][bottom]vstack output.mp4 |
| /******************************************* | |
| * Promise版 | |
| *******************************************/ | |
| class MidiApi { | |
| requestMIDI() { | |
| return navigator.requestMIDIAccess().then(requestSuccess, requestError) | |
| } | |
| requestSuccess(midiAccess) { | |
| this.inputs = midiAccess.inputs |
| // CustomEventを利用すれば、ページ上のJSでディスパッチしたイベントを拡張機能のContent Scriptでも拾うことができます。 | |
| // この方法が一番お手軽だと思います。 | |
| // WebPage側のスクリプト | |
| // CustomEventは自由にイベント名を設定できますので用途ごとにイベント名を使い分ければいいかと思います。 | |
| // detailキーに渡したいデータ(object型可)を設定すればリスナー側(拡張機能)で受け取れます。 | |
| var cevt = new CustomEvent('hoge', {detail: uiState}); | |
| window.dispatchEvent(cevt); |
| using Android.App; | |
| using Android.OS; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.Net; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| namespace App1 |