初回表示時にアニメーションしてしまう
表示の ON/OFF で CSS でスライドアニメーションするつくり
クラスのトグルで表示を切り替え
初期状態は localStorage の値次第

初期状態が ON のときにクラスをつけても初回表示の場合はアニメーションせず初期状態として表示や非表示になってるはず
なのになぜかアニメーションする

調べてみたら 別の箇所の初期化の途中で offsetHeight を参照してた
これがあるとその時点でレイアウト計算が行われるので それ以降にクラスを切り替えてtransition が設定されたプロパティが変更されるとアニメーションする

しかたないので アニメーション OFF の状態でレイアウト計算させるようにした

elem.classList.remove("animation")
elem.getClientRects()
elem.classList.add("animation")

アニメーションが OFF の状態でクラス変更なのでアニメーションは起きない
その後 アニメーションを ON にしてもそれ以降に変化はないのでアニメーションしない

ページ準備完了後に body に ready クラスをつけて transition は 「.ready some-elem」 みたいなロード後にのみ有効になるようにしたほうがいいかも

Chrome Extension の background scripts で module を使いたい
Chrome Extension の background scripts は通常こういう風に指定します

  "background": {
"scripts": ["bg.js"]
}

しかし これだと自動で作られた HTML に通常の JavaScript として実行されます
module ではないので import や export は syntax error です
今のところ module としてロードする機能はなさそうなので 自分で HTML ページを作って module としてロードする必要があります

  "background": {
"page": "bg.html"
}

<!doctype html>
<meta charset="utf-8"/>
<script src="bg.js" type="module"></script>
open と close だけ window がある
open や close は window.open や window.close ってよく書くけど
alert とか confirm とか parseInt とか fetch とか atob とか print とかは window はつけない

window を開いたり閉じたりするから必要そうな雰囲気あるけど 実際は window はグローバルオブジェクトなので alert などと扱いは一緒
open も alert も window あってもなくてもいい

だけどなぜかつい書いてしまうし 書いてる例が多い気がする
使えそうな Windows の環境変数
set

コマンドで環境変数リストが見れる
(たぶん)デフォルトで存在して どこかで使えそうな変数のまとめ
値はあくまでサンプル 設定によって変わるものもある

HOMEDRIVE=C:
HOMEPATH=\Users\testuser
SystemDrive=C:
SystemRoot=C:\WINDOWS
windir=C:\WINDOWS
USERNAME=testuser
USERPROFILE=C:\Users\testuser
PUBLIC=C:\Users\Public
ALLUSERSPROFILE=C:\ProgramData
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
TEMP=C:\Users\testuser\AppData\Local\Temp
TMP=C:\Users\testuser\AppData\Local\Temp
APPDATA=C:\Users\testuser\AppData\Roaming
LOCALAPPDATA=C:\Users\testuser\AppData\Local
DriverData=C:\Windows\System32\Drivers\DriverData
ComSpec=C:\WINDOWS\system32\cmd.exe
COMPUTERNAME=FRONTIER
USERDOMAIN=FRONTIER
LOGONSERVER=\\FRONTIER
OS=Windows_NT
PROMPT=$P$G
VisualStudioCode の Untitled-X の保存場所
ファイルに保存する前の Untitled-X (X は連番) が保存されてる場所

C:\Users\USER\AppData\Roaming\Code\Backups\XXXXX\untitled

ちゃんとファイルに保存されてるので 強制終了とかがあっても復元できる

Code フォルダが VSCode のデータがあるフォルダ
Electron だからこのフォルダを見つければ Mac や Linux でも中身の構造は同じだと思う

USER はユーザ名

XXXXX は unixtime かハッシュ値
たぶんハッシュ値はフォルダを開いたりワークスペースを開いたりした場合の ID で unixtime はフォルダなどを開いてないときのもの

untitled フォルダ内にはハッシュ値のファイル名になっていて Untilted-X 形式の名前じゃない
ただのテキストなので開いてみればわかる
JavaScript のグローバルオブジェクトのプロパティ
グローバルに存在する関数などを見てると機能が増えたことがわかりやすいので Chrome と Firefox で window のプロパティ一覧

{
let target = window
let name = "window"
while(target){
const keys = Object.keys(Object.getOwnPropertyDescriptors(target))
console.log(name, keys.sort())
target = target.__proto__
name = name + ".__proto__"
}
}

Chrome 73

window (820) [
"$",
"$$",
"$0",
"$1",
"$2",
"$3",
"$4",
"$_",
"$x",
"AbortController",
"AbortSignal",
"AnalyserNode",
"AnimationEvent",
"Array",
"ArrayBuffer",
"Atomics",
"Attr",
"Audio",
"AudioBuffer",
"AudioBufferSourceNode",
"AudioContext",
"AudioDestinationNode",
"AudioListener",
"AudioNode",
"AudioParam",
"AudioParamMap",
"AudioProcessingEvent",
"AudioScheduledSourceNode",
"AudioWorkletNode",
"BarProp",
"BaseAudioContext",
"BatteryManager",
"BeforeInstallPromptEvent",
"BeforeUnloadEvent",
"BigInt",
"BigInt64Array",
"BigUint64Array",
"BiquadFilterNode",
"Blob",
"BlobEvent",
"Boolean",
"BroadcastChannel",
"ByteLengthQueuingStrategy",
"CDATASection",
"CSS",
"CSSConditionRule",
"CSSFontFaceRule",
"CSSGroupingRule",
"CSSImageValue",
"CSSImportRule",
"CSSKeyframeRule",
"CSSKeyframesRule",
"CSSKeywordValue",
"CSSMathInvert",
"CSSMathMax",
"CSSMathMin",
"CSSMathNegate",
"CSSMathProduct",
"CSSMathSum",
"CSSMathValue",
"CSSMatrixComponent",
"CSSMediaRule",
"CSSNamespaceRule",
"CSSNumericArray",
"CSSNumericValue",
"CSSPageRule",
"CSSPerspective",
"CSSPositionValue",
"CSSRotate",
"CSSRule",
"CSSRuleList",
"CSSScale",
"CSSSkew",
"CSSSkewX",
"CSSSkewY",
"CSSStyleDeclaration",
"CSSStyleRule",
"CSSStyleSheet",
"CSSStyleValue",
"CSSSupportsRule",
"CSSTransformComponent",
"CSSTransformValue",
"CSSTranslate",
"CSSUnitValue",
"CSSUnparsedValue",
"CSSVariableReferenceValue",
"CanvasCaptureMediaStreamTrack",
"CanvasGradient",
"CanvasPattern",
"CanvasRenderingContext2D",
"ChannelMergerNode",
"ChannelSplitterNode",
"CharacterData",
"ClipboardEvent",
"CloseEvent",
"Comment",
"CompositionEvent",
"ConstantSourceNode",
"ConvolverNode",
"CountQueuingStrategy",
"Crypto",
"CryptoKey",
"CustomElementRegistry",
"CustomEvent",
"DOMError",
"DOMException",
"DOMImplementation",
"DOMMatrix",
"DOMMatrixReadOnly",
"DOMParser",
"DOMPoint",
"DOMPointReadOnly",
"DOMQuad",
"DOMRect",
"DOMRectList",
"DOMRectReadOnly",
"DOMStringList",
"DOMStringMap",
"DOMTokenList",
"DataTransfer",
"DataTransferItem",
"DataTransferItemList",
"DataView",
"Date",
"DelayNode",
"DeviceMotionEvent",
"DeviceOrientationEvent",
"Document",
"DocumentFragment",
"DocumentType",
"DragEvent",
"DynamicsCompressorNode",
"Element",
"EnterPictureInPictureEvent",
"Error",
"ErrorEvent",
"EvalError",
"Event",
"EventSource",
"EventTarget",
"External",
"File",
"FileList",
"FileReader",
"Float32Array",
"Float64Array",
"FocusEvent",
"FontFace",
"FontFaceSetLoadEvent",
"FormData",
"Function",
"GainNode",
"Gamepad",
"GamepadButton",
"GamepadEvent",
"GamepadHapticActuator",
"HTMLAllCollection",
"HTMLAnchorElement",
"HTMLAreaElement",
"HTMLAudioElement",
"HTMLBRElement",
"HTMLBaseElement",
"HTMLBodyElement",
"HTMLButtonElement",
"HTMLCanvasElement",
"HTMLCollection",
"HTMLContentElement",
"HTMLDListElement",
"HTMLDataElement",
"HTMLDataListElement",
"HTMLDetailsElement",
"HTMLDialogElement",
"HTMLDirectoryElement",
"HTMLDivElement",
"HTMLDocument",
"HTMLElement",
"HTMLEmbedElement",
"HTMLFieldSetElement",
"HTMLFontElement",
"HTMLFormControlsCollection",
"HTMLFormElement",
"HTMLFrameElement",
"HTMLFrameSetElement",
"HTMLHRElement",
"HTMLHeadElement",
"HTMLHeadingElement",
"HTMLHtmlElement",
"HTMLIFrameElement",
"HTMLImageElement",
"HTMLInputElement",
"HTMLLIElement",
"HTMLLabelElement",
"HTMLLegendElement",
"HTMLLinkElement",
"HTMLMapElement",
"HTMLMarqueeElement",
"HTMLMediaElement",
"HTMLMenuElement",
"HTMLMetaElement",
"HTMLMeterElement",
"HTMLModElement",
"HTMLOListElement",
"HTMLObjectElement",
"HTMLOptGroupElement",
"HTMLOptionElement",
"HTMLOptionsCollection",
"HTMLOutputElement",
"HTMLParagraphElement",
"HTMLParamElement",
"HTMLPictureElement",
"HTMLPreElement",
"HTMLProgressElement",
"HTMLQuoteElement",
"HTMLScriptElement",
"HTMLSelectElement",
"HTMLShadowElement",
"HTMLSlotElement",
"HTMLSourceElement",
"HTMLSpanElement",
"HTMLStyleElement",
"HTMLTableCaptionElement",
"HTMLTableCellElement",
"HTMLTableColElement",
"HTMLTableElement",
"HTMLTableRowElement",
"HTMLTableSectionElement",
"HTMLTemplateElement",
"HTMLTextAreaElement",
"HTMLTimeElement",
"HTMLTitleElement",
"HTMLTrackElement",
"HTMLUListElement",
"HTMLUnknownElement",
"HTMLVideoElement",
"HashChangeEvent",
"Headers",
"History",
"IDBCursor",
"IDBCursorWithValue",
"IDBDatabase",
"IDBFactory",
"IDBIndex",
"IDBKeyRange",
"IDBObjectStore",
"IDBOpenDBRequest",
"IDBRequest",
"IDBTransaction",
"IDBVersionChangeEvent",
"IIRFilterNode",
"IdleDeadline",
"Image",
"ImageBitmap",
"ImageBitmapRenderingContext",
"ImageCapture",
"ImageData",
"Infinity",
"InputDeviceCapabilities",
"InputDeviceInfo",
"InputEvent",
"Int16Array",
"Int32Array",
"Int8Array",
"IntersectionObserver",
"IntersectionObserverEntry",
"Intl",
"JSON",
"KeyboardEvent",
"Location",
"MIDIAccess",
"MIDIConnectionEvent",
"MIDIInput",
"MIDIInputMap",
"MIDIMessageEvent",
"MIDIOutput",
"MIDIOutputMap",
"MIDIPort",
"Map",
"Math",
"MediaCapabilities",
"MediaDeviceInfo",
"MediaDevices",
"MediaElementAudioSourceNode",
"MediaEncryptedEvent",
"MediaError",
"MediaList",
"MediaMetadata",
"MediaQueryList",
"MediaQueryListEvent",
"MediaRecorder",
"MediaSession",
"MediaSettingsRange",
"MediaSource",
"MediaStream",
"MediaStreamAudioDestinationNode",
"MediaStreamAudioSourceNode",
"MediaStreamEvent",
"MediaStreamTrack",
"MediaStreamTrackEvent",
"MessageChannel",
"MessageEvent",
"MessagePort",
"MimeType",
"MimeTypeArray",
"MouseEvent",
"MutationEvent",
"MutationObserver",
"MutationRecord",
"NaN",
"NamedNodeMap",
"Navigator",
"NetworkInformation",
"Node",
"NodeFilter",
"NodeIterator",
"NodeList",
"Notification",
"Number",
"Object",
"OfflineAudioCompletionEvent",
"OfflineAudioContext",
"OffscreenCanvas",
"OffscreenCanvasRenderingContext2D",
"Option",
"OscillatorNode",
"OverconstrainedError",
"PageTransitionEvent",
"PannerNode",
"Path2D",
"PaymentInstruments",
"PaymentManager",
"PaymentRequestUpdateEvent",
"Performance",
"PerformanceEntry",
"PerformanceLongTaskTiming",
"PerformanceMark",
"PerformanceMeasure",
"PerformanceNavigation",
"PerformanceNavigationTiming",
"PerformanceObserver",
"PerformanceObserverEntryList",
"PerformancePaintTiming",
"PerformanceResourceTiming",
"PerformanceServerTiming",
"PerformanceTiming",
"PeriodicWave",
"PermissionStatus",
"Permissions",
"PhotoCapabilities",
"PictureInPictureWindow",
"Plugin",
"PluginArray",
"PointerEvent",
"PopStateEvent",
"ProcessingInstruction",
"ProgressEvent",
"Promise",
"PromiseRejectionEvent",
"Proxy",
"PushManager",
"PushSubscription",
"PushSubscriptionOptions",
"RTCCertificate",
"RTCDTMFSender",
"RTCDTMFToneChangeEvent",
"RTCDataChannel",
"RTCDataChannelEvent",
"RTCIceCandidate",
"RTCPeerConnection",
"RTCPeerConnectionIceEvent",
"RTCRtpReceiver",
"RTCRtpSender",
"RTCRtpTransceiver",
"RTCSessionDescription",
"RTCStatsReport",
"RTCTrackEvent",
"RadioNodeList",
"Range",
"RangeError",
"ReadableStream",
"ReferenceError",
"Reflect",
"RegExp",
"RemotePlayback",
"ReportingObserver",
"Request",
"ResizeObserver",
"ResizeObserverEntry",
"Response",
"SVGAElement",
"SVGAngle",
"SVGAnimateElement",
"SVGAnimateMotionElement",
"SVGAnimateTransformElement",
"SVGAnimatedAngle",
"SVGAnimatedBoolean",
"SVGAnimatedEnumeration",
"SVGAnimatedInteger",
"SVGAnimatedLength",
"SVGAnimatedLengthList",
"SVGAnimatedNumber",
"SVGAnimatedNumberList",
"SVGAnimatedPreserveAspectRatio",
"SVGAnimatedRect",
"SVGAnimatedString",
"SVGAnimatedTransformList",
"SVGAnimationElement",
"SVGCircleElement",
"SVGClipPathElement",
"SVGComponentTransferFunctionElement",
"SVGDefsElement",
"SVGDescElement",
"SVGDiscardElement",
"SVGElement",
"SVGEllipseElement",
"SVGFEBlendElement",
"SVGFEColorMatrixElement",
"SVGFEComponentTransferElement",
"SVGFECompositeElement",
"SVGFEConvolveMatrixElement",
"SVGFEDiffuseLightingElement",
"SVGFEDisplacementMapElement",
"SVGFEDistantLightElement",
"SVGFEDropShadowElement",
"SVGFEFloodElement",
"SVGFEFuncAElement",
"SVGFEFuncBElement",
"SVGFEFuncGElement",
"SVGFEFuncRElement",
"SVGFEGaussianBlurElement",
"SVGFEImageElement",
"SVGFEMergeElement",
"SVGFEMergeNodeElement",
"SVGFEMorphologyElement",
"SVGFEOffsetElement",
"SVGFEPointLightElement",
"SVGFESpecularLightingElement",
"SVGFESpotLightElement",
"SVGFETileElement",
"SVGFETurbulenceElement",
"SVGFilterElement",
"SVGForeignObjectElement",
"SVGGElement",
"SVGGeometryElement",
"SVGGradientElement",
"SVGGraphicsElement",
"SVGImageElement",
"SVGLength",
"SVGLengthList",
"SVGLineElement",
"SVGLinearGradientElement",
"SVGMPathElement",
"SVGMarkerElement",
"SVGMaskElement",
"SVGMatrix",
"SVGMetadataElement",
"SVGNumber",
"SVGNumberList",
"SVGPathElement",
"SVGPatternElement",
"SVGPoint",
"SVGPointList",
"SVGPolygonElement",
"SVGPolylineElement",
"SVGPreserveAspectRatio",
"SVGRadialGradientElement",
"SVGRect",
"SVGRectElement",
"SVGSVGElement",
"SVGScriptElement",
"SVGSetElement",
"SVGStopElement",
"SVGStringList",
"SVGStyleElement",
"SVGSwitchElement",
"SVGSymbolElement",
"SVGTSpanElement",
"SVGTextContentElement",
"SVGTextElement",
"SVGTextPathElement",
"SVGTextPositioningElement",
"SVGTitleElement",
"SVGTransform",
"SVGTransformList",
"SVGUnitTypes",
"SVGUseElement",
"SVGViewElement",
"Screen",
"ScreenOrientation",
"ScriptProcessorNode",
"SecurityPolicyViolationEvent",
"Selection",
"Set",
"ShadowRoot",
"SharedArrayBuffer",
"SharedWorker",
"SourceBuffer",
"SourceBufferList",
"SpeechSynthesisErrorEvent",
"SpeechSynthesisEvent",
"SpeechSynthesisUtterance",
"StaticRange",
"StereoPannerNode",
"Storage",
"StorageEvent",
"String",
"StylePropertyMap",
"StylePropertyMapReadOnly",
"StyleSheet",
"StyleSheetList",
"SubtleCrypto",
"Symbol",
"SyncManager",
"SyntaxError",
"TaskAttributionTiming",
"Text",
"TextDecoder",
"TextDecoderStream",
"TextEncoder",
"TextEncoderStream",
"TextEvent",
"TextMetrics",
"TextTrack",
"TextTrackCue",
"TextTrackCueList",
"TextTrackList",
"TimeRanges",
"Touch",
"TouchEvent",
"TouchList",
"TrackEvent",
"TransformStream",
"TransitionEvent",
"TreeWalker",
"TypeError",
"UIEvent",
"URIError",
"URL",
"URLSearchParams",
"Uint16Array",
"Uint32Array",
"Uint8Array",
"Uint8ClampedArray",
"UserActivation",
"VTTCue",
"ValidityState",
"VisualViewport",
"WaveShaperNode",
"WeakMap",
"WeakSet",
"WebAssembly",
"WebGL2RenderingContext",
"WebGLActiveInfo",
"WebGLBuffer",
"WebGLContextEvent",
"WebGLFramebuffer",
"WebGLProgram",
"WebGLQuery",
"WebGLRenderbuffer",
"WebGLRenderingContext",
"WebGLSampler",
"WebGLShader",
"WebGLShaderPrecisionFormat",
"WebGLSync",
"WebGLTexture",
"WebGLTransformFeedback",
"WebGLUniformLocation",
"WebGLVertexArrayObject",
"WebKitCSSMatrix",
"WebKitMutationObserver",
"WebSocket",
"WheelEvent",
"Window",
"Worker",
"WritableStream",
"XMLDocument",
"XMLHttpRequest",
"XMLHttpRequestEventTarget",
"XMLHttpRequestUpload",
"XMLSerializer",
"XPathEvaluator",
"XPathExpression",
"XPathResult",
"XSLTProcessor",
"alert",
"atob",
"blur",
"btoa",
"cancelAnimationFrame",
"cancelIdleCallback",
"captureEvents",
"chrome",
"clear",
"clearInterval",
"clearTimeout",
"clientInformation",
"close",
"closed",
"confirm",
"console",
"copy",
"createImageBitmap",
"crypto",
"customElements",
"debug",
"decodeURI",
"decodeURIComponent",
"defaultStatus",
"defaultstatus",
"devicePixelRatio",
"dir",
"dirxml",
"document",
"encodeURI",
"encodeURIComponent",
"escape",
"eval",
"event",
"external",
"fetch",
"find",
"focus",
"frameElement",
"frames",
"getComputedStyle",
"getEventListeners",
"getSelection",
"globalThis",
"history",
"indexedDB",
"innerHeight",
"innerWidth",
"inspect",
"isFinite",
"isNaN",
"isSecureContext",
"keys",
"length",
"localStorage",
"location",
"locationbar",
"matchMedia",
"menubar",
"monitor",
"monitorEvents",
"moveBy",
"moveTo",
"name",
"navigator",
"offscreenBuffering",
"onabort",
"onafterprint",
"onanimationend",
"onanimationiteration",
"onanimationstart",
"onappinstalled",
"onauxclick",
"onbeforeinstallprompt",
"onbeforeprint",
"onbeforeunload",
"onblur",
"oncancel",
"oncanplay",
"oncanplaythrough",
"onchange",
"onclick",
"onclose",
"oncontextmenu",
"oncuechange",
"ondblclick",
"ondevicemotion",
"ondeviceorientation",
"ondeviceorientationabsolute",
"ondrag",
"ondragend",
"ondragenter",
"ondragleave",
"ondragover",
"ondragstart",
"ondrop",
"ondurationchange",
"onemptied",
"onended",
"onerror",
"onfocus",
"ongotpointercapture",
"onhashchange",
"oninput",
"oninvalid",
"onkeydown",
"onkeypress",
"onkeyup",
"onlanguagechange",
"onload",
"onloadeddata",
"onloadedmetadata",
"onloadstart",
"onlostpointercapture",
"onmessage",
"onmessageerror",
"onmousedown",
"onmouseenter",
"onmouseleave",
"onmousemove",
"onmouseout",
"onmouseover",
"onmouseup",
"onmousewheel",
"onoffline",
"ononline",
"onpagehide",
"onpageshow",
"onpause",
"onplay",
"onplaying",
"onpointercancel",
"onpointerdown",
"onpointerenter",
"onpointerleave",
"onpointermove",
"onpointerout",
"onpointerover",
"onpointerup",
"onpopstate",
"onprogress",
"onratechange",
"onrejectionhandled",
"onreset",
"onresize",
"onscroll",
"onsearch",
"onseeked",
"onseeking",
"onselect",
"onselectionchange",
"onselectstart",
"onstalled",
"onstorage",
"onsubmit",
"onsuspend",
"ontimeupdate",
"ontoggle",
"ontransitionend",
"onunhandledrejection",
"onunload",
"onvolumechange",
"onwaiting",
"onwebkitanimationend",
"onwebkitanimationiteration",
"onwebkitanimationstart",
"onwebkittransitionend",
"onwheel",
"open",
"openDatabase",
"opener",
"origin",
"outerHeight",
"outerWidth",
"pageXOffset",
"pageYOffset",
"parent",
"parseFloat",
"parseInt",
"performance",
"personalbar",
"postMessage",
"print",
"profile",
"profileEnd",
"prompt",
"queryObjects",
"queueMicrotask",
"releaseEvents",
"requestAnimationFrame",
"requestIdleCallback",
"resizeBy",
"resizeTo",
"screen",
"screenLeft",
"screenTop",
"screenX",
"screenY",
"scroll",
"scrollBy",
"scrollTo",
"scrollX",
"scrollY",
"scrollbars",
"self",
"sessionStorage",
"setInterval",
"setTimeout",
"speechSynthesis",
"status",
"statusbar",
"stop",
"styleMedia",
"table",
"toolbar",
"top",
"undebug",
"undefined",
"unescape",
"unmonitor",
"unmonitorEvents",
"values",
"visualViewport",
"webkitCancelAnimationFrame",
"webkitMediaStream",
"webkitRTCPeerConnection",
"webkitRequestAnimationFrame",
"webkitRequestFileSystem",
"webkitResolveLocalFileSystemURL",
"webkitSpeechGrammar",
"webkitSpeechGrammarList",
"webkitSpeechRecognition",
"webkitSpeechRecognitionError",
"webkitSpeechRecognitionEvent",
"webkitStorageInfo",
"webkitURL",
"window"
]
window.__proto__ (3)
["PERSISTENT", "TEMPORARY", "constructor"]
window.__proto__.__proto__
["constructor"]
window.__proto__.__proto__.__proto__ (4)
["addEventListener", "constructor", "dispatchEvent", "removeEventListener"]
window.__proto__.__proto__.__proto__.__proto__ (12)
["__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__",
"__proto__", "constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable",
"toLocaleString", "toString", "valueOf"]

Firefox 66

window Array(771) [
"AbortController",
"AbortSignal",
"AnalyserNode",
"Animation",
"AnimationEffect",
"AnimationEvent",
"AnimationPlaybackEvent",
"Array",
"ArrayBuffer",
"Attr",
"Audio",
"AudioBuffer",
"AudioBufferSourceNode",
"AudioContext",
"AudioDestinationNode",
"AudioListener",
"AudioNode",
"AudioParam",
"AudioProcessingEvent",
"AudioScheduledSourceNode",
"BarProp",
"BaseAudioContext",
"BatteryManager",
"BeforeUnloadEvent",
"BiquadFilterNode",
"Blob",
"BlobEvent",
"Boolean",
"BroadcastChannel",
"ByteLengthQueuingStrategy",
"CDATASection",
"CSS",
"CSS2Properties",
"CSSConditionRule",
"CSSCounterStyleRule",
"CSSFontFaceRule",
"CSSFontFeatureValuesRule",
"CSSGroupingRule",
"CSSImportRule",
"CSSKeyframeRule",
"CSSKeyframesRule",
"CSSMediaRule",
"CSSMozDocumentRule",
"CSSNamespaceRule",
"CSSPageRule",
"CSSRule",
"CSSRuleList",
"CSSStyleDeclaration",
"CSSStyleRule",
"CSSStyleSheet",
"CSSSupportsRule",
"Cache",
"CacheStorage",
"CanvasCaptureMediaStream",
"CanvasGradient",
"CanvasPattern",
"CanvasRenderingContext2D",
"CaretPosition",
"ChannelMergerNode",
"ChannelSplitterNode",
"CharacterData",
"ClipboardEvent",
"CloseEvent",
"Comment",
"CompositionEvent",
"ConstantSourceNode",
"ConvolverNode",
"CountQueuingStrategy",
"Crypto",
"CryptoKey",
"CustomElementRegistry",
"CustomEvent",
"DOMError",
"DOMException",
"DOMImplementation",
"DOMMatrix",
"DOMMatrixReadOnly",
"DOMParser",
"DOMPoint",
"DOMPointReadOnly",
"DOMQuad",
"DOMRect",
"DOMRectList",
"DOMRectReadOnly",
"DOMRequest",
"DOMStringList",
"DOMStringMap",
"DOMTokenList",
"DataTransfer",
"DataTransferItem",
"DataTransferItemList",
"DataView",
"Date",
"DelayNode",
"DeviceMotionEvent",
"DeviceOrientationEvent",
"Directory",
"Document",
"DocumentFragment",
"DocumentType",
"DragEvent",
"DynamicsCompressorNode",
"Element",
"Error",
"ErrorEvent",
"EvalError",
"Event",
"EventSource",
"EventTarget",
"File",
"FileList",
"FileReader",
"FileSystem",
"FileSystemDirectoryEntry",
"FileSystemDirectoryReader",
"FileSystemEntry",
"FileSystemFileEntry",
"Float32Array",
"Float64Array",
"FocusEvent",
"FontFace",
"FontFaceSet",
"FontFaceSetLoadEvent",
"FormData",
"Function",
"GainNode",
"Gamepad",
"GamepadButton",
"GamepadEvent",
"GamepadHapticActuator",
"GamepadPose",
"HTMLAllCollection",
"HTMLAnchorElement",
"HTMLAreaElement",
"HTMLAudioElement",
"HTMLBRElement",
"HTMLBaseElement",
"HTMLBodyElement",
"HTMLButtonElement",
"HTMLCanvasElement",
"HTMLCollection",
"HTMLDListElement",
"HTMLDataElement",
"HTMLDataListElement",
"HTMLDetailsElement",
"HTMLDirectoryElement",
"HTMLDivElement",
"HTMLDocument",
"HTMLElement",
"HTMLEmbedElement",
"HTMLFieldSetElement",
"HTMLFontElement",
"HTMLFormControlsCollection",
"HTMLFormElement",
"HTMLFrameElement",
"HTMLFrameSetElement",
"HTMLHRElement",
"HTMLHeadElement",
"HTMLHeadingElement",
"HTMLHtmlElement",
"HTMLIFrameElement",
"HTMLImageElement",
"HTMLInputElement",
"HTMLLIElement",
"HTMLLabelElement",
"HTMLLegendElement",
"HTMLLinkElement",
"HTMLMapElement",
"HTMLMarqueeElement",
"HTMLMediaElement",
"HTMLMenuElement",
"HTMLMenuItemElement",
"HTMLMetaElement",
"HTMLMeterElement",
"HTMLModElement",
"HTMLOListElement",
"HTMLObjectElement",
"HTMLOptGroupElement",
"HTMLOptionElement",
"HTMLOptionsCollection",
"HTMLOutputElement",
"HTMLParagraphElement",
"HTMLParamElement",
"HTMLPictureElement",
"HTMLPreElement",
"HTMLProgressElement",
"HTMLQuoteElement",
"HTMLScriptElement",
"HTMLSelectElement",
"HTMLSlotElement",
"HTMLSourceElement",
"HTMLSpanElement",
"HTMLStyleElement",
"HTMLTableCaptionElement",
"HTMLTableCellElement",
"HTMLTableColElement",
"HTMLTableElement",
"HTMLTableRowElement",
"HTMLTableSectionElement",
"HTMLTemplateElement",
"HTMLTextAreaElement",
"HTMLTimeElement",
"HTMLTitleElement",
"HTMLTrackElement",
"HTMLUListElement",
"HTMLUnknownElement",
"HTMLVideoElement",
"HashChangeEvent",
"Headers",
"History",
"IDBCursor",
"IDBCursorWithValue",
"IDBDatabase",
"IDBFactory",
"IDBFileHandle",
"IDBFileRequest",
"IDBIndex",
"IDBKeyRange",
"IDBMutableFile",
"IDBObjectStore",
"IDBOpenDBRequest",
"IDBRequest",
"IDBTransaction",
"IDBVersionChangeEvent",
"IIRFilterNode",
"IdleDeadline",
"Image",
"ImageBitmap",
"ImageBitmapRenderingContext",
"ImageData",
"Infinity",
"InputEvent",
"InstallTrigger",
"Int16Array",
"Int32Array",
"Int8Array",
"InternalError",
"IntersectionObserver",
"IntersectionObserverEntry",
"Intl",
"JSON",
"KeyEvent",
"KeyboardEvent",
"KeyframeEffect",
"Location",
"Map",
"Math",
"MediaCapabilities",
"MediaCapabilitiesInfo",
"MediaDeviceInfo",
"MediaDevices",
"MediaElementAudioSourceNode",
"MediaEncryptedEvent",
"MediaError",
"MediaKeyError",
"MediaKeyMessageEvent",
"MediaKeySession",
"MediaKeyStatusMap",
"MediaKeySystemAccess",
"MediaKeys",
"MediaList",
"MediaQueryList",
"MediaQueryListEvent",
"MediaRecorder",
"MediaRecorderErrorEvent",
"MediaSource",
"MediaStream",
"MediaStreamAudioDestinationNode",
"MediaStreamAudioSourceNode",
"MediaStreamEvent",
"MediaStreamTrack",
"MediaStreamTrackEvent",
"MessageChannel",
"MessageEvent",
"MessagePort",
"MimeType",
"MimeTypeArray",
"MouseEvent",
"MouseScrollEvent",
"MutationEvent",
"MutationObserver",
"MutationRecord",
"NaN",
"NamedNodeMap",
"Navigator",
"Node",
"NodeFilter",
"NodeIterator",
"NodeList",
"Notification",
"NotifyPaintEvent",
"Number",
"Object",
"OfflineAudioCompletionEvent",
"OfflineAudioContext",
"Option",
"OscillatorNode",
"PageTransitionEvent",
"PaintRequest",
"PaintRequestList",
"PannerNode",
"Path2D",
"Performance",
"PerformanceEntry",
"PerformanceMark",
"PerformanceMeasure",
"PerformanceNavigation",
"PerformanceNavigationTiming",
"PerformanceObserver",
"PerformanceObserverEntryList",
"PerformanceResourceTiming",
"PerformanceTiming",
"PeriodicWave",
"PermissionStatus",
"Permissions",
"Plugin",
"PluginArray",
"PointerEvent",
"PopStateEvent",
"PopupBlockedEvent",
"ProcessingInstruction",
"ProgressEvent",
"Promise",
"Proxy",
"PushManager",
"PushSubscription",
"PushSubscriptionOptions",
"RTCCertificate",
"RTCDTMFSender",
"RTCDTMFToneChangeEvent",
"RTCDataChannel",
"RTCDataChannelEvent",
"RTCIceCandidate",
"RTCPeerConnection",
"RTCPeerConnectionIceEvent",
"RTCRtpReceiver",
"RTCRtpSender",
"RTCRtpTransceiver",
"RTCSessionDescription",
"RTCStatsReport",
"RTCTrackEvent",
"RadioNodeList",
"Range",
"RangeError",
"ReadableStream",
"ReferenceError",
"Reflect",
"RegExp",
"Request",
"Response",
"SVGAElement",
"SVGAngle",
"SVGAnimateElement",
"SVGAnimateMotionElement",
"SVGAnimateTransformElement",
"SVGAnimatedAngle",
"SVGAnimatedBoolean",
"SVGAnimatedEnumeration",
"SVGAnimatedInteger",
"SVGAnimatedLength",
"SVGAnimatedLengthList",
"SVGAnimatedNumber",
"SVGAnimatedNumberList",
"SVGAnimatedPreserveAspectRatio",
"SVGAnimatedRect",
"SVGAnimatedString",
"SVGAnimatedTransformList",
"SVGAnimationElement",
"SVGCircleElement",
"SVGClipPathElement",
"SVGComponentTransferFunctionElement",
"SVGDefsElement",
"SVGDescElement",
"SVGElement",
"SVGEllipseElement",
"SVGFEBlendElement",
"SVGFEColorMatrixElement",
"SVGFEComponentTransferElement",
"SVGFECompositeElement",
"SVGFEConvolveMatrixElement",
"SVGFEDiffuseLightingElement",
"SVGFEDisplacementMapElement",
"SVGFEDistantLightElement",
"SVGFEDropShadowElement",
"SVGFEFloodElement",
"SVGFEFuncAElement",
"SVGFEFuncBElement",
"SVGFEFuncGElement",
"SVGFEFuncRElement",
"SVGFEGaussianBlurElement",
"SVGFEImageElement",
"SVGFEMergeElement",
"SVGFEMergeNodeElement",
"SVGFEMorphologyElement",
"SVGFEOffsetElement",
"SVGFEPointLightElement",
"SVGFESpecularLightingElement",
"SVGFESpotLightElement",
"SVGFETileElement",
"SVGFETurbulenceElement",
"SVGFilterElement",
"SVGForeignObjectElement",
"SVGGElement",
"SVGGeometryElement",
"SVGGradientElement",
"SVGGraphicsElement",
"SVGImageElement",
"SVGLength",
"SVGLengthList",
"SVGLineElement",
"SVGLinearGradientElement",
"SVGMPathElement",
"SVGMarkerElement",
"SVGMaskElement",
"SVGMatrix",
"SVGMetadataElement",
"SVGNumber",
"SVGNumberList",
"SVGPathElement",
"SVGPathSegList",
"SVGPatternElement",
"SVGPoint",
"SVGPointList",
"SVGPolygonElement",
"SVGPolylineElement",
"SVGPreserveAspectRatio",
"SVGRadialGradientElement",
"SVGRect",
"SVGRectElement",
"SVGSVGElement",
"SVGScriptElement",
"SVGSetElement",
"SVGStopElement",
"SVGStringList",
"SVGStyleElement",
"SVGSwitchElement",
"SVGSymbolElement",
"SVGTSpanElement",
"SVGTextContentElement",
"SVGTextElement",
"SVGTextPathElement",
"SVGTextPositioningElement",
"SVGTitleElement",
"SVGTransform",
"SVGTransformList",
"SVGUnitTypes",
"SVGUseElement",
"SVGViewElement",
"SVGZoomAndPan",
"Screen",
"ScreenOrientation",
"ScriptProcessorNode",
"ScrollAreaEvent",
"SecurityPolicyViolationEvent",
"Selection",
"ServiceWorker",
"ServiceWorkerRegistration",
"Set",
"ShadowRoot",
"SharedWorker",
"SourceBuffer",
"SourceBufferList",
"SpeechSynthesis",
"SpeechSynthesisErrorEvent",
"SpeechSynthesisEvent",
"SpeechSynthesisUtterance",
"SpeechSynthesisVoice",
"StereoPannerNode",
"Storage",
"StorageEvent",
"String",
"StyleSheet",
"StyleSheetList",
"SubtleCrypto",
"Symbol",
"SyntaxError",
"Text",
"TextDecoder",
"TextEncoder",
"TextMetrics",
"TextTrack",
"TextTrackCue",
"TextTrackCueList",
"TextTrackList",
"TimeEvent",
"TimeRanges",
"TrackEvent",
"TransitionEvent",
"TreeWalker",
"TypeError",
"UIEvent",
"URIError",
"URL",
"URLSearchParams",
"Uint16Array",
"Uint32Array",
"Uint8Array",
"Uint8ClampedArray",
"VRDisplay",
"VRDisplayCapabilities",
"VRDisplayEvent",
"VREyeParameters",
"VRFieldOfView",
"VRFrameData",
"VRPose",
"VRStageParameters",
"VTTCue",
"VTTRegion",
"ValidityState",
"VideoPlaybackQuality",
"VisualViewport",
"WaveShaperNode",
"WeakMap",
"WeakSet",
"WebAssembly",
"WebGL2RenderingContext",
"WebGLActiveInfo",
"WebGLBuffer",
"WebGLContextEvent",
"WebGLFramebuffer",
"WebGLProgram",
"WebGLQuery",
"WebGLRenderbuffer",
"WebGLRenderingContext",
"WebGLSampler",
"WebGLShader",
"WebGLShaderPrecisionFormat",
"WebGLSync",
"WebGLTexture",
"WebGLTransformFeedback",
"WebGLUniformLocation",
"WebGLVertexArrayObject",
"WebKitCSSMatrix",
"WebSocket",
"WheelEvent",
"Window",
"Worker",
"XMLDocument",
"XMLHttpRequest",
"XMLHttpRequestEventTarget",
"XMLHttpRequestUpload",
"XMLSerializer",
"XPathEvaluator",
"XPathExpression",
"XPathResult",
"XSLTProcessor",
"alert",
"atob",
"blur",
"btoa",
"caches",
"cancelAnimationFrame",
"cancelIdleCallback",
"captureEvents",
"clearInterval",
"clearTimeout",
"close",
"closed",
"confirm",
"console",
"content",
"createImageBitmap",
"crypto",
"customElements",
"decodeURI",
"decodeURIComponent",
"devicePixelRatio",
"document",
"dump",
"encodeURI",
"encodeURIComponent",
"escape",
"eval",
"event",
"external",
"fetch",
"find",
"focus",
"frameElement",
"frames",
"fullScreen",
"getComputedStyle",
"getDefaultComputedStyle",
"getSelection",
"history",
"indexedDB",
"innerHeight",
"innerWidth",
"isFinite",
"isNaN",
"isSecureContext",
"length",
"localStorage",
"location",
"locationbar",
"matchMedia",
"menubar",
"moveBy",
"moveTo",
"mozInnerScreenX",
"mozInnerScreenY",
"mozPaintCount",
"mozRTCIceCandidate",
"mozRTCPeerConnection",
"mozRTCSessionDescription",
"name",
"navigator",
"netscape",
"onabort",
"onabsolutedeviceorientation",
"onafterprint",
"onanimationcancel",
"onanimationend",
"onanimationiteration",
"onanimationstart",
"onauxclick",
"onbeforeprint",
"onbeforeunload",
"onblur",
"oncanplay",
"oncanplaythrough",
"onchange",
"onclick",
"onclose",
"oncontextmenu",
"ondblclick",
"ondevicelight",
"ondevicemotion",
"ondeviceorientation",
"ondeviceproximity",
"ondrag",
"ondragend",
"ondragenter",
"ondragexit",
"ondragleave",
"ondragover",
"ondragstart",
"ondrop",
"ondurationchange",
"onemptied",
"onended",
"onerror",
"onfocus",
"ongotpointercapture",
"onhashchange",
"oninput",
"oninvalid",
"onkeydown",
"onkeypress",
"onkeyup",
"onlanguagechange",
"onload",
"onloadeddata",
"onloadedmetadata",
"onloadend",
"onloadstart",
"onlostpointercapture",
"onmessage",
"onmessageerror",
"onmousedown",
"onmouseenter",
"onmouseleave",
"onmousemove",
"onmouseout",
"onmouseover",
"onmouseup",
"onmozfullscreenchange",
"onmozfullscreenerror",
"onoffline",
"ononline",
"onpagehide",
"onpageshow",
"onpause",
"onplay",
"onplaying",
"onpointercancel",
"onpointerdown",
"onpointerenter",
"onpointerleave",
"onpointermove",
"onpointerout",
"onpointerover",
"onpointerup",
"onpopstate",
"onprogress",
"onratechange",
"onreset",
"onresize",
"onscroll",
"onseeked",
"onseeking",
"onselect",
"onselectstart",
"onshow",
"onstalled",
"onstorage",
"onsubmit",
"onsuspend",
"ontimeupdate",
"ontoggle",
"ontransitioncancel",
"ontransitionend",
"ontransitionrun",
"ontransitionstart",
"onunload",
"onuserproximity",
"onvolumechange",
"onvrdisplayactivate",
"onvrdisplayconnect",
"onvrdisplaydeactivate",
"onvrdisplaydisconnect",
"onvrdisplaypresentchange",
"onwaiting",
"onwebkitanimationend",
"onwebkitanimationiteration",
"onwebkitanimationstart",
"onwebkittransitionend",
"onwheel",
"open",
"opener",
"origin",
"outerHeight",
"outerWidth",
"pageXOffset",
"pageYOffset",
"parent",
"parseFloat",
"parseInt",
"performance",
"personalbar",
"postMessage",
"print",
"prompt",
"releaseEvents",
"requestAnimationFrame",
"requestIdleCallback",
"resizeBy",
"resizeTo",
"screen",
"screenLeft",
"screenTop",
"screenX",
"screenY",
"scroll",
"scrollBy",
"scrollByLines",
"scrollByPages",
"scrollMaxX",
"scrollMaxY",
"scrollTo",
"scrollX",
"scrollY",
"scrollbars",
"self",
"sessionStorage",
"setInterval",
"setResizable",
"setTimeout",
"sidebar",
"sizeToContent",
"speechSynthesis",
"status",
"statusbar",
"stop",
"toolbar",
"top",
"undefined",
"unescape",
"uneval",
"updateCommands",
"window"
]
window.__proto__
Array [ "constructor" ]
window.__proto__.__proto__
Array []
window.__proto__.__proto__.__proto__
Array(4) [ "addEventListener", "constructor", "dispatchEvent", "removeEventListener" ]
window.__proto__.__proto__.__proto__.__proto__
Array(13) [ "__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__",
"__proto__", "constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable",
"toLocaleString", "toSource", "toString", "valueOf" ]
EC2 サーバの ssh 接続を自動切断されないようにする
サーバ側で自動切断設定してるのかと sshd の設定を切断されないローカル VM と見比べても特に違いはなし

調べても日本語の個人サイトでは人によって書いてることが違ってどれが正しいかわかりません
設定は Server と Client どっちでもいいと書いてたり 理由や説明もなく動いたからと貼り付けてるだけでよくわからなかったので StackOveflow に行くといい回答がありました
やっぱり技術系の調べ物は英語のほうがいいですね

https://stackoverflow.com/questions/7210011/amazon-ec2-ssh-timeout-due-inactivity

EC2 サーバの設定ではなく AWS が一定時間通信がないと自動で切断するようです
それも リージョンによって間隔が違って短いと 1 分の通信なしで切られるそうです
ということで 50 秒ごとにサーバと疎通確認の通信を送っていればサーバから通信がないからと切断されることがなくなるようです

ServerAliveInterval 50

これをクライアントの ~/.ssh/config に追記します

JavaScript で if 式
あってほしいと思ってるのに JavaScript には if 式がありません
ただ eval は最後に評価した値が返ってくることを利用すれば

const x = eval(`
if(1) 1
else 2
`)
console.log(x)
// 1

const y = eval(`
if(0) 1
else 2
`)
console.log(y)
// 2
簡単に別タイムゾーンの日本時間を調べる
ネットを見てて 「20:00 UTC」 「15:30 PDT」 とか書いてても日本で何時なのかがぱっとわかりません
UTC ならよく扱うので 9 時間進めたのが日本だとわかりますがそれ以外はわかる気がしません
ググって何時間の時間差かを確認して計算ってするのも面倒です

JavaScript の Date 型でいけるんじゃない?と思ってやってみると

new Date("1/1/1 15:30 PDT")
// Tue Jan 02 2001 07:30:00 GMT+0900 (日本標準時)

とできました

基本ブラウザ使ってる最中なので F12 → 上のように調べたい時刻とタイムゾーンを入力 ですぐわかるのが便利ですね
日付はいらないのですが必須なので楽にかける 1/1/1 にしてます

最近の Chrome は実行前に結果プレビューしてくれるのでいちいちエンター押して複数回実行しなくても 日付の文字を変えるとその場で結果も変わるのもいいところです
util.promisify(child_process.exec)
> node -e "util.promisify(child_process.exec)(`node -e 'console.log(1);console.error(2)'`).then((...x) => console.log('T', x), (...x) => console.log('F', x))"
T [ { stdout: '1\n', stderr: '2\n' } ]

正常終了 exitcode が 0 のときは stdout, stderr がプロパティのオブジェクトを then の引数で受け取れる
それぞれに出力が入ってる
基本行末に改行があるので === するときは trim 必要なのに注意

> node -e "util.promisify(child_process.exec)(`node -e 'console.log(1);console.error(2);process.exit(1)'`).then((...x) => console.log('T', x), (...x) => console.log('F', x))"
F [ { Error: Command failed: node -e 'console.log(1);console.error(2);process.exit(1)'
2


at ChildProcess.exithandler (child_process.js:294:12)
at ChildProcess.emit (events.js:189:13)
at maybeClose (internal/child_process.js:970:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
killed: false,
code: 1,
signal: null,
cmd:
'node -e \'console.log(1);console.error(2);process.exit(1)\'',
stdout: '1\n',
stderr: '2\n' } ]

エラー終了 exitcode が 0 でないときは エラーオブジェクトを catch の引数で受け取れる
code プロパティに exitcode
stdout/stderr に各出力が入ってる
エラーのメッセージは stderr が使われる