brandon1024 / find

A find-in-page extension for Chrome and Firefox that supports regular expressions.
https://chrome.google.com/webstore/detail/find%2B-regex-find-in-page/fddffkdncgkkdjobemgbpojjeffmmofb
GNU General Public License v3.0
402 stars 52 forks source link

Feature request: Add ScrollMarkers #368

Open dnngll opened 2 years ago

dnngll commented 2 years ago

Hello,

would it be possible to add ScrollMarkers, just like in the regular search? Or even altered, like in the extension Selection Highlighter? Snippet:

...

  areScrollMarkersEnabled: function () {
    return true;
  },

  scrollMarkerClassName: 'highlighted_selection_scroll_marker',

  scrollMarkerStyles: function ({ window, document, highlightedNode }) {
    const clientRect = highlightedNode.getBoundingClientRect();
    if (!clientRect.width || !clientRect.height) {
      return false;
    }

    return {
      height: '1px',
      width: '40px',
      boxSizing: 'content-box',
      border: '1px solid grey',
      position: 'fixed',
      top: (
        // window height times percent of element position in document
        window.innerHeight * (
          + window.scrollY
          + clientRect.top
          + (0.5 * (clientRect.top - clientRect.bottom))
        ) / document.body.clientHeight
      ) + 'px',
      right: '0px',
      backgroundColor: 'green',
      zIndex: '2147483647',
    };
  }

...

Thanks!