Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #36002 > unrolled thread

Re: Element ids as global names

Started byJJ <jj4public@vfemail.net>
First post2019-02-09 19:17 +0700
Last post2019-02-14 17:11 +0100
Articles 9 — 5 participants

Back to article view | Back to comp.lang.javascript

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Element ids as global names JJ <jj4public@vfemail.net> - 2019-02-09 19:17 +0700
    Re: Element ids as global names Jon Ribbens <jon+usenet@unequivocal.eu> - 2019-02-09 13:27 +0000
      Re: Element ids as global names Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-02-14 03:15 +0100
        Re: Element ids as global names "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-02-14 11:30 +0100
        Re: Element ids as global names Jon Ribbens <jon+usenet@unequivocal.eu> - 2019-02-14 11:24 +0000
          Re: Element ids as global names "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-02-14 14:01 +0100
            Re: Element ids as global names Jon Ribbens <jon+usenet@unequivocal.eu> - 2019-02-14 15:02 +0000
              Re: Element ids as global names "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-02-14 22:48 +0100
            Re: Element ids as global names Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2019-02-14 17:11 +0100

#36002 — Re: Element ids as global names

FromJJ <jj4public@vfemail.net>
Date2019-02-09 19:17 +0700
SubjectRe: Element ids as global names
Message-ID<18pygd4tukp3u.1i0v2p2nfrl0d.dlg@40tude.net>
On 5 Feb 2019 11:54:09 GMT, Stefan Ram wrote:
>   When one has an element
> 
> <em id=a>abc</em>
> 
>   and then evaluates »a« in JavaScript, that element is yielded.
> 
>   Which of the following lines is the best expression for this element
>   (from the point of view of programming style and maintainability)?
> 
> this.document.getElementById( 'a' )
> window.document.getElementById( 'a' )
> document.getElementById( 'a' )
> a 
> (or something else, I have not listed above?)
> 
>   ?
> 
>   And why?
> 
>   Is the feature to make the HTML ids become global names in
>   JavaScript deprecated (obsolete) or expected to become
>   deprecated (obsolencent)?

Element ID as a global variable is not reliable, because it applies only if
there isn't any variable previously declared with the same name as the
element ID. e.g.

  <script>
    var content = "abc";
  </script>
  <div id="content"></div>
  <script>
    console.log(content); //"abc"
  </script>

[toc] | [next] | [standalone]


#36003

FromJon Ribbens <jon+usenet@unequivocal.eu>
Date2019-02-09 13:27 +0000
Message-ID<slrnq5tl98.34b.jon+usenet@sable.unequivocal.eu>
In reply to#36002
On 2019-02-09, JJ <jj4public@vfemail.net> wrote:
> Element ID as a global variable is not reliable, because it applies only if
> there isn't any variable previously declared with the same name as the
> element ID. e.g.
>
>  <script>
>     var content = "abc";
>  </script>
>  <div id="content"></div>
>  <script>
>     console.log(content); //"abc"
>  </script>

More than that, it also doesn't work if the browser itself has
a built-in property of the window object with the same name,
and the list of built-in properties varies from browser to
browser and from browser version to browser version*.

For example, the following:

    <div id=sidebar><div>
    <script>console.log(window.sidebar)</script>

will log the 'div' element from the page in Chrome, but will
log a totally unrelated native browser object in Firefox.
So you cannot assume that 'window.foo' will reliably access
an element from your page - even if it works when you test it
it may suddenly stop working even in the next version of the
browser you tested it under, let alone a different one.


* as an illustration, the window object has 771 properties in
  Firefox 65, 827 in Chrome 71, 819 in Chrome 72 and 821 in
  Chrome 73.

[toc] | [prev] | [next] | [standalone]


#36013

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2019-02-14 03:15 +0100
Message-ID<3c6e5038-3558-8396-8322-54ed773696aa@PointedEars.de>
In reply to#36003
Jon Ribbens wrote:
>     <div id=sidebar><div>
>     <script>console.log(window.sidebar)</script>
> 
> will log the 'div' element from the page in Chrome, but will
> log a totally unrelated native browser object in Firefox.
> So you cannot assume that 'window.foo' will reliably access
> an element from your page - even if it works when you test it
> it may suddenly stop working even in the next version of the
> browser you tested it under, let alone a different one.

Good point.

> * as an illustration, the window object has 771 properties in
>   Firefox 65, 827 in Chrome 71, 819 in Chrome 72 and 821 in
>   Chrome 73.

How did you obtain these figures?

-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#36014

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2019-02-14 11:30 +0100
Message-ID<XnsA9F67516BD7B1eejj99@194.109.6.166>
In reply to#36013
Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote on 14 Feb 2019 in 
comp.lang.javascript:

>> * as an illustration, the window object has 771 properties in
>>   Firefox 65, 827 in Chrome 71, 819 in Chrome 72 and 821 in
>>   Chrome 73.
> 
> How did you obtain these figures?

I get on Chrome 72: 169 + 694 = 853

<https://stackoverflow.com/questions/8639010/how-to-get-all-properties-of-
an-object/41399876>

returns in the console with Chrome Version 72.0.3626.96:

object: "[object Window]"
test.html:50 
	Properties: 169
	------------------
[.....]
	Methods: 694
	------------------

test.html:58 Uncaught ReferenceError: functools is not defined
    at introspect (test.html:58)
    at test.html:64

So incomplete but it gets you on the way.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#36015

FromJon Ribbens <jon+usenet@unequivocal.eu>
Date2019-02-14 11:24 +0000
Message-ID<slrnq6ak03.34b.jon+usenet@sable.unequivocal.eu>
In reply to#36013
On 2019-02-14, Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote:
> Jon Ribbens wrote:
>> * as an illustration, the window object has 771 properties in
>>   Firefox 65, 827 in Chrome 71, 819 in Chrome 72 and 821 in
>>   Chrome 73.
>
> How did you obtain these figures?

I opened "about:blank" in a browser and ran the following in the
browser console:

    Object.getOwnPropertyNames(window).length

I figured this would give good enough figures to illustrate the
point that 'window' has a *lot* of properties and that the list of
them is not standardised and varies a lot.

[toc] | [prev] | [next] | [standalone]


#36016

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2019-02-14 14:01 +0100
Message-ID<XnsA9F68EA7691ACeejj99@194.109.6.166>
In reply to#36015
Jon Ribbens <jon+usenet@unequivocal.eu> wrote on 14 Feb 2019 in 
comp.lang.javascript:

> On 2019-02-14, Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote:
>> Jon Ribbens wrote:
>>> * as an illustration, the window object has 771 properties in
>>>   Firefox 65, 827 in Chrome 71, 819 in Chrome 72 and 821 in
>>>   Chrome 73.
>>
>> How did you obtain these figures?
> 
> I opened "about:blank" in a browser and ran the following in the
> browser console:
> 
>     Object.getOwnPropertyNames(window).length
> 
> I figured this would give good enough figures to illustrate the
> point that 'window' has a *lot* of properties and that the list of
> them is not standardised and varies a lot.

919 on my Chrome 72

============

[0 … 99]
0: "Object"
1: "Function"
2: "Array"
3: "Number"
4: "parseFloat"
5: "parseInt"
6: "Infinity"
7: "NaN"
8: "undefined"
9: "Boolean"
10: "String"
11: "Symbol"
12: "Date"
13: "Promise"
14: "RegExp"
15: "Error"
16: "EvalError"
17: "RangeError"
18: "ReferenceError"
19: "SyntaxError"
20: "TypeError"
21: "URIError"
22: "JSON"
23: "Math"
24: "console"
25: "Intl"
26: "ArrayBuffer"
27: "Uint8Array"
28: "Int8Array"
29: "Uint16Array"
30: "Int16Array"
31: "Uint32Array"
32: "Int32Array"
33: "Float32Array"
34: "Float64Array"
35: "Uint8ClampedArray"
36: "BigUint64Array"
37: "BigInt64Array"
38: "DataView"
39: "Map"
40: "BigInt"
41: "Set"
42: "WeakMap"
43: "WeakSet"
44: "Proxy"
45: "Reflect"
46: "decodeURI"
47: "decodeURIComponent"
48: "encodeURI"
49: "encodeURIComponent"
50: "escape"
51: "unescape"
52: "eval"
53: "isFinite"
54: "isNaN"
55: "ByteLengthQueuingStrategy"
56: "CountQueuingStrategy"
57: "webkitRTCPeerConnection"
58: "webkitMediaStream"
59: "WebSocket"
60: "WebGLContextEvent"
61: "WaveShaperNode"
62: "TextEncoder"
63: "TextDecoder"
64: "SyncManager"
65: "SubtleCrypto"
66: "StorageEvent"
67: "Storage"
68: "StereoPannerNode"
69: "SourceBufferList"
70: "SourceBuffer"
71: "ScriptProcessorNode"
72: "ScreenOrientation"
73: "RTCTrackEvent"
74: "RTCStatsReport"
75: "RTCSessionDescription"
76: "RTCRtpTransceiver"
77: "RTCRtpSender"
78: "RTCRtpReceiver"
79: "RTCRtpContributingSource"
80: "RTCPeerConnectionIceEvent"
81: "RTCPeerConnection"
82: "RTCIceCandidate"
83: "RTCDataChannelEvent"
84: "RTCDataChannel"
85: "RTCDTMFToneChangeEvent"
86: "RTCDTMFSender"
87: "RTCCertificate"
88: "Plugin"
89: "PluginArray"
90: "PhotoCapabilities"
91: "PeriodicWave"
92: "PannerNode"
93: "OverconstrainedError"
94: "OscillatorNode"
95: "OfflineAudioContext"
96: "OfflineAudioCompletionEvent"
97: "NetworkInformation"
98: "MimeType"
99: "MimeTypeArray"
[100 … 199]
100: "MediaStreamTrackEvent"
101: "MediaStreamTrack"
102: "MediaStreamEvent"
103: "MediaStream"
104: "MediaStreamAudioSourceNode"
105: "MediaStreamAudioDestinationNode"
106: "MediaSource"
107: "MediaSettingsRange"
108: "MediaRecorder"
109: "MediaEncryptedEvent"
110: "MediaElementAudioSourceNode"
111: "MediaDevices"
112: "MediaDeviceInfo"
113: "MediaCapabilities"
114: "MIDIPort"
115: "MIDIOutputMap"
116: "MIDIOutput"
117: "MIDIMessageEvent"
118: "MIDIInputMap"
119: "MIDIInput"
120: "MIDIConnectionEvent"
121: "MIDIAccess"
122: "InputDeviceInfo"
123: "ImageCapture"
124: "ImageBitmapRenderingContext"
125: "IIRFilterNode"
126: "IDBVersionChangeEvent"
127: "IDBTransaction"
128: "IDBRequest"
129: "IDBOpenDBRequest"
130: "IDBObjectStore"
131: "IDBKeyRange"
132: "IDBIndex"
133: "IDBFactory"
134: "IDBDatabase"
135: "IDBCursorWithValue"
136: "IDBCursor"
137: "GamepadEvent"
138: "Gamepad"
139: "GamepadButton"
140: "GainNode"
141: "EventSource"
142: "DynamicsCompressorNode"
143: "DeviceOrientationEvent"
144: "DeviceMotionEvent"
145: "DelayNode"
146: "DOMError"
147: "CryptoKey"
148: "Crypto"
149: "ConvolverNode"
150: "ConstantSourceNode"
151: "CloseEvent"
152: "ChannelSplitterNode"
153: "ChannelMergerNode"
154: "CanvasRenderingContext2D"
155: "CanvasCaptureMediaStreamTrack"
156: "BroadcastChannel"
157: "BlobEvent"
158: "BiquadFilterNode"
159: "BeforeInstallPromptEvent"
160: "BatteryManager"
161: "BaseAudioContext"
162: "AudioWorkletNode"
163: "AudioScheduledSourceNode"
164: "AudioProcessingEvent"
165: "AudioParamMap"
166: "AudioParam"
167: "AudioNode"
168: "AudioListener"
169: "AudioDestinationNode"
170: "AudioContext"
171: "AudioBufferSourceNode"
172: "AudioBuffer"
173: "AnalyserNode"
174: "postMessage"
175: "blur"
176: "focus"
177: "close"
178: "XPathResult"
179: "XPathExpression"
180: "XPathEvaluator"
181: "XMLSerializer"
182: "XMLHttpRequestUpload"
183: "XMLHttpRequestEventTarget"
184: "XMLHttpRequest"
185: "XMLDocument"
186: "WritableStream"
187: "Worker"
188: "Window"
189: "WheelEvent"
190: "VisualViewport"
191: "ValidityState"
192: "VTTCue"
193: "URLSearchParams"
194: "URL"
195: "UIEvent"
196: "TreeWalker"
197: "TransitionEvent"
198: "TransformStream"
199: "TrackEvent"
[200 … 299]
200: "TouchList"
201: "TouchEvent"
202: "Touch"
203: "TimeRanges"
204: "TextTrackList"
205: "TextTrackCueList"
206: "TextTrackCue"
207: "TextTrack"
208: "TextMetrics"
209: "TextEvent"
210: "Text"
211: "TaskAttributionTiming"
212: "StyleSheetList"
213: "StyleSheet"
214: "StylePropertyMapReadOnly"
215: "StylePropertyMap"
216: "StaticRange"
217: "ShadowRoot"
218: "Selection"
219: "SecurityPolicyViolationEvent"
220: "Screen"
221: "SVGViewElement"
222: "SVGUseElement"
223: "SVGUnitTypes"
224: "SVGTransformList"
225: "SVGTransform"
226: "SVGTitleElement"
227: "SVGTextPositioningElement"
228: "SVGTextPathElement"
229: "SVGTextElement"
230: "SVGTextContentElement"
231: "SVGTSpanElement"
232: "SVGSymbolElement"
233: "SVGSwitchElement"
234: "SVGStyleElement"
235: "SVGStringList"
236: "SVGStopElement"
237: "SVGSetElement"
238: "SVGScriptElement"
239: "SVGSVGElement"
240: "SVGRectElement"
241: "SVGRect"
242: "SVGRadialGradientElement"
243: "SVGPreserveAspectRatio"
244: "SVGPolylineElement"
245: "SVGPolygonElement"
246: "SVGPointList"
247: "SVGPoint"
248: "SVGPatternElement"
249: "SVGPathElement"
250: "SVGNumberList"
251: "SVGNumber"
252: "SVGMetadataElement"
253: "SVGMatrix"
254: "SVGMaskElement"
255: "SVGMarkerElement"
256: "SVGMPathElement"
257: "SVGLinearGradientElement"
258: "SVGLineElement"
259: "SVGLengthList"
260: "SVGLength"
261: "SVGImageElement"
262: "SVGGraphicsElement"
263: "SVGGradientElement"
264: "SVGGeometryElement"
265: "SVGGElement"
266: "SVGForeignObjectElement"
267: "SVGFilterElement"
268: "SVGFETurbulenceElement"
269: "SVGFETileElement"
270: "SVGFESpotLightElement"
271: "SVGFESpecularLightingElement"
272: "SVGFEPointLightElement"
273: "SVGFEOffsetElement"
274: "SVGFEMorphologyElement"
275: "SVGFEMergeNodeElement"
276: "SVGFEMergeElement"
277: "SVGFEImageElement"
278: "SVGFEGaussianBlurElement"
279: "SVGFEFuncRElement"
280: "SVGFEFuncGElement"
281: "SVGFEFuncBElement"
282: "SVGFEFuncAElement"
283: "SVGFEFloodElement"
284: "SVGFEDropShadowElement"
285: "SVGFEDistantLightElement"
286: "SVGFEDisplacementMapElement"
287: "SVGFEDiffuseLightingElement"
288: "SVGFEConvolveMatrixElement"
289: "SVGFECompositeElement"
290: "SVGFEComponentTransferElement"
291: "SVGFEColorMatrixElement"
292: "SVGFEBlendElement"
293: "SVGEllipseElement"
294: "SVGElement"
295: "SVGDiscardElement"
296: "SVGDescElement"
297: "SVGDefsElement"
298: "SVGComponentTransferFunctionElement"
299: "SVGClipPathElement"
[300 … 399]
300: "SVGCircleElement"
301: "SVGAnimationElement"
302: "SVGAnimatedTransformList"
303: "SVGAnimatedString"
304: "SVGAnimatedRect"
305: "SVGAnimatedPreserveAspectRatio"
306: "SVGAnimatedNumberList"
307: "SVGAnimatedNumber"
308: "SVGAnimatedLengthList"
309: "SVGAnimatedLength"
310: "SVGAnimatedInteger"
311: "SVGAnimatedEnumeration"
312: "SVGAnimatedBoolean"
313: "SVGAnimatedAngle"
314: "SVGAnimateTransformElement"
315: "SVGAnimateMotionElement"
316: "SVGAnimateElement"
317: "SVGAngle"
318: "SVGAElement"
319: "Response"
320: "ResizeObserverEntry"
321: "ResizeObserver"
322: "Request"
323: "ReportingObserver"
324: "ReadableStream"
325: "Range"
326: "RadioNodeList"
327: "PromiseRejectionEvent"
328: "ProgressEvent"
329: "ProcessingInstruction"
330: "PopStateEvent"
331: "PointerEvent"
332: "PerformanceTiming"
333: "PerformanceServerTiming"
334: "PerformanceResourceTiming"
335: "PerformancePaintTiming"
336: "PerformanceObserverEntryList"
337: "PerformanceObserver"
338: "PerformanceNavigationTiming"
339: "PerformanceNavigation"
340: "PerformanceMeasure"
341: "PerformanceMark"
342: "PerformanceLongTaskTiming"
343: "PerformanceEntry"
344: "Performance"
345: "PageTransitionEvent"
346: "NodeList"
347: "NodeIterator"
348: "NodeFilter"
349: "Node"
350: "Navigator"
351: "NamedNodeMap"
352: "MutationRecord"
353: "MutationObserver"
354: "MutationEvent"
355: "MouseEvent"
356: "MessagePort"
357: "MessageEvent"
358: "MessageChannel"
359: "MediaQueryListEvent"
360: "MediaQueryList"
361: "MediaList"
362: "MediaError"
363: "Location"
364: "KeyboardEvent"
365: "IntersectionObserverEntry"
366: "IntersectionObserver"
367: "InputEvent"
368: "InputDeviceCapabilities"
369: "ImageData"
370: "ImageBitmap"
371: "IdleDeadline"
372: "History"
373: "Headers"
374: "HashChangeEvent"
375: "HTMLVideoElement"
376: "HTMLUnknownElement"
377: "HTMLUListElement"
378: "HTMLTrackElement"
379: "HTMLTitleElement"
380: "HTMLTimeElement"
381: "HTMLTextAreaElement"
382: "HTMLTemplateElement"
383: "HTMLTableSectionElement"
384: "HTMLTableRowElement"
385: "HTMLTableElement"
386: "HTMLTableColElement"
387: "HTMLTableCellElement"
388: "HTMLTableCaptionElement"
389: "HTMLStyleElement"
390: "HTMLSpanElement"
391: "HTMLSourceElement"
392: "HTMLSlotElement"
393: "HTMLShadowElement"
394: "HTMLSelectElement"
395: "HTMLScriptElement"
396: "HTMLQuoteElement"
397: "HTMLProgressElement"
398: "HTMLPreElement"
399: "HTMLPictureElement"
[400 … 499]
400: "HTMLParamElement"
401: "HTMLParagraphElement"
402: "HTMLOutputElement"
403: "HTMLOptionsCollection"
404: "Option"
405: "HTMLOptionElement"
406: "HTMLOptGroupElement"
407: "HTMLObjectElement"
408: "HTMLOListElement"
409: "HTMLModElement"
410: "HTMLMeterElement"
411: "HTMLMetaElement"
412: "HTMLMenuElement"
413: "HTMLMediaElement"
414: "HTMLMarqueeElement"
415: "HTMLMapElement"
416: "HTMLLinkElement"
417: "HTMLLegendElement"
418: "HTMLLabelElement"
419: "HTMLLIElement"
420: "HTMLInputElement"
421: "Image"
422: "HTMLImageElement"
423: "HTMLIFrameElement"
424: "HTMLHtmlElement"
425: "HTMLHeadingElement"
426: "HTMLHeadElement"
427: "HTMLHRElement"
428: "HTMLFrameSetElement"
429: "HTMLFrameElement"
430: "HTMLFormElement"
431: "HTMLFormControlsCollection"
432: "HTMLFontElement"
433: "HTMLFieldSetElement"
434: "HTMLEmbedElement"
435: "HTMLElement"
436: "HTMLDocument"
437: "HTMLDivElement"
438: "HTMLDirectoryElement"
439: "HTMLDialogElement"
440: "HTMLDetailsElement"
441: "HTMLDataListElement"
442: "HTMLDataElement"
443: "HTMLDListElement"
444: "HTMLContentElement"
445: "HTMLCollection"
446: "HTMLCanvasElement"
447: "HTMLButtonElement"
448: "HTMLBodyElement"
449: "HTMLBaseElement"
450: "HTMLBRElement"
451: "Audio"
452: "HTMLAudioElement"
453: "HTMLAreaElement"
454: "HTMLAnchorElement"
455: "HTMLAllCollection"
456: "FormData"
457: "FontFaceSetLoadEvent"
458: "FocusEvent"
459: "FileReader"
460: "FileList"
461: "File"
462: "EventTarget"
463: "Event"
464: "ErrorEvent"
465: "Element"
466: "DragEvent"
467: "DocumentType"
468: "DocumentFragment"
469: "Document"
470: "DataTransferItemList"
471: "DataTransferItem"
472: "DataTransfer"
473: "DOMTokenList"
474: "DOMStringMap"
475: "DOMStringList"
476: "DOMRectReadOnly"
477: "DOMRectList"
478: "DOMRect"
479: "DOMQuad"
480: "DOMPointReadOnly"
481: "DOMPoint"
482: "DOMParser"
483: "DOMMatrixReadOnly"
484: "DOMMatrix"
485: "DOMImplementation"
486: "DOMException"
487: "CustomEvent"
488: "CustomElementRegistry"
489: "CompositionEvent"
490: "Comment"
491: "ClipboardEvent"
492: "CharacterData"
493: "CSSVariableReferenceValue"
494: "CSSUnparsedValue"
495: "CSSUnitValue"
496: "CSSTranslate"
497: "CSSTransformValue"
498: "CSSTransformComponent"
499: "CSSSupportsRule"
[500 … 599]
500: "CSSStyleValue"
501: "CSSStyleSheet"
502: "CSSStyleRule"
503: "CSSStyleDeclaration"
504: "CSSSkewY"
505: "CSSSkewX"
506: "CSSSkew"
507: "CSSScale"
508: "CSSRuleList"
509: "CSSRule"
510: "CSSRotate"
511: "CSSPositionValue"
512: "CSSPerspective"
513: "CSSPageRule"
514: "CSSNumericValue"
515: "CSSNumericArray"
516: "CSSNamespaceRule"
517: "CSSMediaRule"
518: "CSSMatrixComponent"
519: "CSSMathValue"
520: "CSSMathSum"
521: "CSSMathProduct"
522: "CSSMathNegate"
523: "CSSMathMin"
524: "CSSMathMax"
525: "CSSMathInvert"
526: "CSSKeywordValue"
527: "CSSKeyframesRule"
528: "CSSKeyframeRule"
529: "CSSImportRule"
530: "CSSImageValue"
531: "CSSGroupingRule"
532: "CSSFontFaceRule"
533: "CSS"
534: "CSSConditionRule"
535: "CDATASection"
536: "Blob"
537: "BeforeUnloadEvent"
538: "BarProp"
539: "Attr"
540: "AnimationEvent"
541: "AbortSignal"
542: "AbortController"
543: "WebKitCSSMatrix"
544: "WebKitMutationObserver"
545: "webkitURL"
546: "parent"
547: "opener"
548: "top"
549: "length"
550: "frames"
551: "closed"
552: "location"
553: "self"
554: "window"
555: "document"
556: "name"
557: "customElements"
558: "history"
559: "locationbar"
560: "menubar"
561: "personalbar"
562: "scrollbars"
563: "statusbar"
564: "toolbar"
565: "status"
566: "frameElement"
567: "navigator"
568: "origin"
569: "external"
570: "screen"
571: "innerWidth"
572: "innerHeight"
573: "scrollX"
574: "pageXOffset"
575: "scrollY"
576: "pageYOffset"
577: "visualViewport"
578: "screenX"
579: "screenY"
580: "outerWidth"
581: "outerHeight"
582: "devicePixelRatio"
583: "clientInformation"
584: "event"
585: "offscreenBuffering"
586: "screenLeft"
587: "screenTop"
588: "defaultStatus"
589: "defaultstatus"
590: "styleMedia"
591: "onanimationend"
592: "onanimationiteration"
593: "onanimationstart"
594: "onsearch"
595: "ontransitionend"
596: "onwebkitanimationend"
597: "onwebkitanimationiteration"
598: "onwebkitanimationstart"
599: "onwebkittransitionend"
[600 … 699]
600: "isSecureContext"
601: "onabort"
602: "onblur"
603: "oncancel"
604: "oncanplay"
605: "oncanplaythrough"
606: "onchange"
607: "onclick"
608: "onclose"
609: "oncontextmenu"
610: "oncuechange"
611: "ondblclick"
612: "ondrag"
613: "ondragend"
614: "ondragenter"
615: "ondragleave"
616: "ondragover"
617: "ondragstart"
618: "ondrop"
619: "ondurationchange"
620: "onemptied"
621: "onended"
622: "onerror"
623: "onfocus"
624: "oninput"
625: "oninvalid"
626: "onkeydown"
627: "onkeypress"
628: "onkeyup"
629: "onload"
630: "onloadeddata"
631: "onloadedmetadata"
632: "onloadstart"
633: "onmousedown"
634: "onmouseenter"
635: "onmouseleave"
636: "onmousemove"
637: "onmouseout"
638: "onmouseover"
639: "onmouseup"
640: "onmousewheel"
641: "onpause"
642: "onplay"
643: "onplaying"
644: "onprogress"
645: "onratechange"
646: "onreset"
647: "onresize"
648: "onscroll"
649: "onseeked"
650: "onseeking"
651: "onselect"
652: "onstalled"
653: "onsubmit"
654: "onsuspend"
655: "ontimeupdate"
656: "ontoggle"
657: "onvolumechange"
658: "onwaiting"
659: "onwheel"
660: "onauxclick"
661: "ongotpointercapture"
662: "onlostpointercapture"
663: "onpointerdown"
664: "onpointermove"
665: "onpointerup"
666: "onpointercancel"
667: "onpointerover"
668: "onpointerout"
669: "onpointerenter"
670: "onpointerleave"
671: "onselectstart"
672: "onselectionchange"
673: "onafterprint"
674: "onbeforeprint"
675: "onbeforeunload"
676: "onhashchange"
677: "onlanguagechange"
678: "onmessage"
679: "onmessageerror"
680: "onoffline"
681: "ononline"
682: "onpagehide"
683: "onpageshow"
684: "onpopstate"
685: "onrejectionhandled"
686: "onstorage"
687: "onunhandledrejection"
688: "onunload"
689: "performance"
690: "stop"
691: "open"
692: "alert"
693: "confirm"
694: "prompt"
695: "print"
696: "queueMicrotask"
697: "requestAnimationFrame"
698: "cancelAnimationFrame"
699: "captureEvents"
[700 … 799]
700: "releaseEvents"
701: "requestIdleCallback"
702: "cancelIdleCallback"
703: "getComputedStyle"
704: "matchMedia"
705: "moveTo"
706: "moveBy"
707: "resizeTo"
708: "resizeBy"
709: "scroll"
710: "scrollTo"
711: "scrollBy"
712: "getSelection"
713: "find"
714: "webkitRequestAnimationFrame"
715: "webkitCancelAnimationFrame"
716: "fetch"
717: "btoa"
718: "atob"
719: "setTimeout"
720: "clearTimeout"
721: "setInterval"
722: "clearInterval"
723: "createImageBitmap"
724: "onappinstalled"
725: "onbeforeinstallprompt"
726: "crypto"
727: "ondevicemotion"
728: "ondeviceorientation"
729: "ondeviceorientationabsolute"
730: "indexedDB"
731: "webkitStorageInfo"
732: "sessionStorage"
733: "localStorage"
734: "SharedArrayBuffer"
735: "Atomics"
736: "globalThis"
737: "chrome"
738: "WebAssembly"
739: "OffscreenCanvas"
740: "SharedWorker"
741: "FontFace"
742: "UserActivation"
743: "XSLTProcessor"
744: "TextDecoderStream"
745: "TextEncoderStream"
746: "GamepadHapticActuator"
747: "Notification"
748: "OffscreenCanvasRenderingContext2D"
749: "PaymentInstruments"
750: "PaymentManager"
751: "PaymentRequestUpdateEvent"
752: "Permissions"
753: "PermissionStatus"
754: "EnterPictureInPictureEvent"
755: "PictureInPictureWindow"
756: "PushManager"
757: "PushSubscription"
758: "PushSubscriptionOptions"
759: "RemotePlayback"
760: "webkitSpeechGrammar"
761: "webkitSpeechGrammarList"
762: "webkitSpeechRecognition"
763: "webkitSpeechRecognitionError"
764: "webkitSpeechRecognitionEvent"
765: "SpeechSynthesisErrorEvent"
766: "SpeechSynthesisEvent"
767: "SpeechSynthesisUtterance"
768: "CanvasGradient"
769: "CanvasPattern"
770: "Path2D"
771: "WebGL2RenderingContext"
772: "WebGLActiveInfo"
773: "WebGLBuffer"
774: "WebGLFramebuffer"
775: "WebGLProgram"
776: "WebGLQuery"
777: "WebGLRenderbuffer"
778: "WebGLRenderingContext"
779: "WebGLSampler"
780: "WebGLShader"
781: "WebGLShaderPrecisionFormat"
782: "WebGLSync"
783: "WebGLTexture"
784: "WebGLTransformFeedback"
785: "WebGLUniformLocation"
786: "WebGLVertexArrayObject"
787: "BluetoothUUID"
788: "speechSynthesis"
789: "webkitRequestFileSystem"
790: "webkitResolveLocalFileSystemURL"
791: "openDatabase"
792: "applicationCache"
793: "Worklet"
794: "ApplicationCache"
795: "ApplicationCacheErrorEvent"
796: "caches"
797: "AudioWorklet"
798: "Cache"
799: "CacheStorage"
[800 … 899]
800: "Clipboard"
801: "Credential"
802: "CredentialsContainer"
803: "FederatedCredential"
804: "Keyboard"
805: "KeyboardLayoutMap"
806: "Lock"
807: "LockManager"
808: "MediaKeyMessageEvent"
809: "MediaKeys"
810: "MediaKeySession"
811: "MediaKeyStatusMap"
812: "MediaKeySystemAccess"
813: "NavigationPreloadManager"
814: "PasswordCredential"
815: "ServiceWorker"
816: "ServiceWorkerContainer"
817: "ServiceWorkerRegistration"
818: "StorageManager"
819: "PaymentAddress"
820: "PaymentRequest"
821: "PaymentResponse"
822: "Presentation"
823: "PresentationAvailability"
824: "PresentationConnection"
825: "PresentationConnectionAvailableEvent"
826: "PresentationConnectionCloseEvent"
827: "PresentationConnectionList"
828: "PresentationReceiver"
829: "PresentationRequest"
830: "AbsoluteOrientationSensor"
831: "Accelerometer"
832: "Gyroscope"
833: "LinearAccelerationSensor"
834: "OrientationSensor"
835: "RelativeOrientationSensor"
836: "Sensor"
837: "SensorErrorEvent"
838: "AuthenticatorAssertionResponse"
839: "AuthenticatorAttestationResponse"
840: "AuthenticatorResponse"
841: "PublicKeyCredential"
842: "Bluetooth"
843: "BluetoothCharacteristicProperties"
844: "BluetoothDevice"
845: "BluetoothRemoteGATTCharacteristic"
846: "BluetoothRemoteGATTDescriptor"
847: "BluetoothRemoteGATTServer"
848: "BluetoothRemoteGATTService"
849: "USB"
850: "USBAlternateInterface"
851: "USBConfiguration"
852: "USBConnectionEvent"
853: "USBDevice"
854: "USBEndpoint"
855: "USBInterface"
856: "USBInTransferResult"
857: "USBIsochronousInTransferPacket"
858: "USBIsochronousInTransferResult"
859: "USBIsochronousOutTransferPacket"
860: "USBIsochronousOutTransferResult"
861: "USBOutTransferResult"
862: "configData"
863: "$"
864: "ntpApiHandle"
865: "BACKGROUND_CUSTOMIZATION_LOG_TYPE"
866: "tilesAreLoaded"
867: "numDdllogResponsesReceived"
868: "lastDdllogResponse"
869: "onDdllogResponse"
870: "LocalNTP"
871: "getChromeUILanguage"
872: "og"
873: "gbar_"
874: "gbar"
875: "__PVT"
876: "gapi"
877: "___jsl"
878: "closure_uid_111262610"
879: "closure_lm_82846"
880: "osapi"
881: "gadgets"
882: "shindig"
883: "pos"
884: "googleapis"
885: "iframer"
886: "ToolbarApi"
887: "iframes"
888: "IframeBase"
889: "Iframe"
890: "IframeProxy"
891: "IframeWindow"
892: "__gapi_jstiming__"
893: "dir"
894: "dirxml"
895: "profile"
896: "profileEnd"
897: "clear"
898: "table"
899: "keys"
[900 … 918]
900: "values"
901: "debug"
902: "undebug"
903: "monitor"
904: "unmonitor"
905: "inspect"
906: "copy"
907: "queryObjects"
908: "$_"
909: "$0"
910: "$1"
911: "$2"
912: "$3"
913: "$4"
914: "getEventListeners"
915: "monitorEvents"
916: "unmonitorEvents"
917: "$$"
918: "$x"
length: 919


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#36017

FromJon Ribbens <jon+usenet@unequivocal.eu>
Date2019-02-14 15:02 +0000
Message-ID<slrnq6b0op.34b.jon+usenet@sable.unequivocal.eu>
In reply to#36016
On 2019-02-14, Evertjan. <exxjxw.hannivoort@inter.nl.net> wrote:
> Jon Ribbens <jon+usenet@unequivocal.eu> wrote on 14 Feb 2019 in 
> comp.lang.javascript:
>>>> * as an illustration, the window object has 771 properties in
>>>>   Firefox 65, 827 in Chrome 71, 819 in Chrome 72 and 821 in
>>>>   Chrome 73.
...
> 919 on my Chrome 72

Interesting. The ones that are in your Chrome but not mine are listed
below. I'm guessing that maybe you're using a Mac and maybe you're
on a laptop? It's a good further illustration though that even using
the same version of the same browser, the 'window' properties can be
hugely different.

AbsoluteOrientationSensor
Accelerometer
ApplicationCache
ApplicationCacheErrorEvent
AudioWorklet
AuthenticatorAssertionResponse
AuthenticatorAttestationResponse
AuthenticatorResponse
BACKGROUND_CUSTOMIZATION_LOG_TYPE
Bluetooth
BluetoothCharacteristicProperties
BluetoothDevice
BluetoothRemoteGATTCharacteristic
BluetoothRemoteGATTDescriptor
BluetoothRemoteGATTServer
BluetoothRemoteGATTService
Cache
CacheStorage
Clipboard
Credential
CredentialsContainer
FederatedCredential
Gyroscope
Iframe
IframeBase
IframeProxy
IframeWindow
Keyboard
KeyboardLayoutMap
LinearAccelerationSensor
LocalNTP
Lock
LockManager
MediaKeyMessageEvent
MediaKeySession
MediaKeyStatusMap
MediaKeySystemAccess
MediaKeys
NavigationPreloadManager
OrientationSensor
PasswordCredential
PaymentAddress
PaymentRequest
PaymentResponse
Presentation
PresentationAvailability
PresentationConnection
PresentationConnectionAvailableEvent
PresentationConnectionCloseEvent
PresentationConnectionList
PresentationReceiver
PresentationRequest
PublicKeyCredential
RelativeOrientationSensor
Sensor
SensorErrorEvent
ServiceWorker
ServiceWorkerContainer
ServiceWorkerRegistration
StorageManager
ToolbarApi
USB
USBAlternateInterface
USBConfiguration
USBConnectionEvent
USBDevice
USBEndpoint
USBInTransferResult
USBInterface
USBIsochronousInTransferPacket
USBIsochronousInTransferResult
USBIsochronousOutTransferPacket
USBIsochronousOutTransferResult
USBOutTransferResult
Worklet
__PVT
___jsl
__gapi_jstiming__
applicationCache
caches
closure_lm_82846
closure_uid_111262610
configData
gadgets
gapi
gbar
gbar_
getChromeUILanguage
googleapis
iframer
iframes
lastDdllogResponse
ntpApiHandle
numDdllogResponsesReceived
og
onDdllogResponse
osapi
pos
shindig
tilesAreLoaded

[toc] | [prev] | [next] | [standalone]


#36019

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2019-02-14 22:48 +0100
Message-ID<XnsA9F6E7EFA3E67eejj99@194.109.6.166>
In reply to#36017
Jon Ribbens <jon+usenet@unequivocal.eu> wrote on 14 Feb 2019 in 
comp.lang.javascript:

> On 2019-02-14, Evertjan. <exxjxw.hannivoort@inter.nl.net> wrote:
>> Jon Ribbens <jon+usenet@unequivocal.eu> wrote on 14 Feb 2019 in 
>> comp.lang.javascript:
>>>>> * as an illustration, the window object has 771 properties in
>>>>>   Firefox 65, 827 in Chrome 71, 819 in Chrome 72 and 821 in
>>>>>   Chrome 73.
> ...
>> 919 on my Chrome 72
> 
> Interesting. The ones that are in your Chrome but not mine are listed
> below.

> I'm guessing that maybe you're using a Mac

No, Windows

>  and maybe you're on a laptop?

No, PC

Chrome Version 72.0.3626.109 (Official Build) (64-bit)

> It's a good further illustration though that even using
> the same version of the same browser, the 'window' properties can be
> hugely different.
> 
> AbsoluteOrientationSensor
> Accelerometer
> ApplicationCache
> ApplicationCacheErrorEvent
> AudioWorklet
> AuthenticatorAssertionResponse
> AuthenticatorAttestationResponse
> AuthenticatorResponse
> BACKGROUND_CUSTOMIZATION_LOG_TYPE
> Bluetooth
> BluetoothCharacteristicProperties
> BluetoothDevice
> BluetoothRemoteGATTCharacteristic
> BluetoothRemoteGATTDescriptor
> BluetoothRemoteGATTServer
> BluetoothRemoteGATTService
> Cache
> CacheStorage
> Clipboard
> Credential
> CredentialsContainer
> FederatedCredential
> Gyroscope
> Iframe
> IframeBase
> IframeProxy
> IframeWindow
> Keyboard
> KeyboardLayoutMap
> LinearAccelerationSensor
> LocalNTP
> Lock
> LockManager
> MediaKeyMessageEvent
> MediaKeySession
> MediaKeyStatusMap
> MediaKeySystemAccess
> MediaKeys
> NavigationPreloadManager
> OrientationSensor
> PasswordCredential
> PaymentAddress
> PaymentRequest
> PaymentResponse
> Presentation
> PresentationAvailability
> PresentationConnection
> PresentationConnectionAvailableEvent
> PresentationConnectionCloseEvent
> PresentationConnectionList
> PresentationReceiver
> PresentationRequest
> PublicKeyCredential
> RelativeOrientationSensor
> Sensor
> SensorErrorEvent
> ServiceWorker
> ServiceWorkerContainer
> ServiceWorkerRegistration
> StorageManager
> ToolbarApi
> USB
> USBAlternateInterface
> USBConfiguration
> USBConnectionEvent
> USBDevice
> USBEndpoint
> USBInTransferResult
> USBInterface
> USBIsochronousInTransferPacket
> USBIsochronousInTransferResult
> USBIsochronousOutTransferPacket
> USBIsochronousOutTransferResult
> USBOutTransferResult
> Worklet
> __PVT
> ___jsl
> __gapi_jstiming__
> applicationCache
> caches
> closure_lm_82846
> closure_uid_111262610
> configData
> gadgets
> gapi
> gbar
> gbar_
> getChromeUILanguage
> googleapis
> iframer
> iframes
> lastDdllogResponse
> ntpApiHandle
> numDdllogResponsesReceived
> og
> onDdllogResponse
> osapi
> pos
> shindig
> tilesAreLoaded
> 



-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#36018

FromCezary Tomczyk <cezary.tomczyk@gmail.com>
Date2019-02-14 17:11 +0100
Message-ID<q44401$2fsp$1@csiph.com>
In reply to#36016
On 14/02/2019 14:01, Evertjan. wrote:
> Jon Ribbens <jon+usenet@unequivocal.eu> wrote on 14 Feb 2019 in
> comp.lang.javascript:
> 
>> On 2019-02-14, Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote:
>>> Jon Ribbens wrote:
>>>> * as an illustration, the window object has 771 properties in
>>>>    Firefox 65, 827 in Chrome 71, 819 in Chrome 72 and 821 in
>>>>    Chrome 73.
>>>
>>> How did you obtain these figures?
>>
>> I opened "about:blank" in a browser and ran the following in the
>> browser console:
>>
>>      Object.getOwnPropertyNames(window).length
>>
>> I figured this would give good enough figures to illustrate the
>> point that 'window' has a *lot* of properties and that the list of
>> them is not standardised and varies a lot.
> 
> 919 on my Chrome 72
> 

Chrome MacOS 72.0.3626.109 (Official Build) (64-bit): 1049

-- 
Cezary Tomczyk
http://www.ctomczyk.pl/

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web