Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Add ScrollMarkers #368

Open
dnngll opened this issue Nov 22, 2021 · 0 comments
Open

Feature request: Add ScrollMarkers #368

dnngll opened this issue Nov 22, 2021 · 0 comments
Labels
feature This issue is a new feature.

Comments

@dnngll
Copy link

dnngll commented Nov 22, 2021

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!

@brandon1024 brandon1024 added the feature This issue is a new feature. label Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue is a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants