MCPcopy
hub / github.com/philc/vimium / renderHints

Method renderHints

content_scripts/link_hints.js:412–448  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

410 }
411
412 renderHints() {
413 if (this.containerEl == null) {
414 const div = DomUtils.createElement("div");
415 div.id = "vimium-hint-marker-container";
416 div.className = "vimium-reset";
417 this.containerEl = div;
418 document.documentElement.appendChild(div);
419 }
420
421 // Append these markers as top level children instead of as child nodes to the link itself,
422 // because some clickable elements cannot contain children, e.g. submit buttons.
423 const markerEls = this.hintMarkers.filter((m) => m.isLocalMarker()).map((m) => m.element);
424 for (const el of markerEls) {
425 this.containerEl.appendChild(el);
426 }
427
428 // TODO(philc): 2024-03-27 Remove this hasPopoverSupport check once Firefox has popover support.
429 // Also move this CSS into vimium.css.
430 const hasPopoverSupport = this.containerEl.showPopover != null;
431 if (hasPopoverSupport) {
432 this.containerEl.popover = "manual";
433 this.containerEl.showPopover();
434 Object.assign(this.containerEl.style, {
435 top: 0,
436 left: 0,
437 position: "absolute",
438 // This display: block is required to override Github Enterprise's CSS circa 2024-04-01. See
439 // #4446.
440 display: "block",
441 width: "100%",
442 height: "100%",
443 overflow: "visible",
444 });
445 }
446
447 this.setIndicator();
448 }
449
450 setOpenLinkMode(mode, shouldPropagateToOtherFrames) {
451 this.mode = mode;

Callers 2

constructorMethod · 0.95
rotateHintsMethod · 0.95

Calls 3

setIndicatorMethod · 0.95
isLocalMarkerMethod · 0.80
filterMethod · 0.45

Tested by

no test coverage detected