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

Function followLink

content_scripts/mode_normal.js:390–399  ·  view source on GitHub ↗
(linkElement)

Source from the content-addressed store, hash-verified

388
389// used by the findAndFollow* functions.
390const followLink = function (linkElement) {
391 if (linkElement.nodeName.toLowerCase() === "link") {
392 globalThis.location.href = linkElement.href;
393 } else {
394 // if we can click on it, don't simply set location.href: some next/prev links are meant to
395 // trigger AJAX calls, like the 'more' button on GitHub's newsfeed.
396 linkElement.scrollIntoView();
397 DomUtils.simulateClick(linkElement);
398 }
399};
400
401// Find links which have text matching any one of `linkStrings`. If there are multiple candidates,
402// they are prioritized for shortness, by their position in `linkStrings`, how far down the page

Callers 2

goPreviousFunction · 0.85
goNextFunction · 0.85

Calls 1

scrollIntoViewMethod · 0.80

Tested by

no test coverage detected