Skip to content

intelligently detect header type elements without depending on the std_header selector? #198

@ghost

Description

Try this:

repeat for y = 10, 20, 30, 40, 50

  • find the element at point (page_width/2, y), using document.elementFromPoint()
  • if it's different from all elements found so far, check if it has any ancestor which has position:fixed. check if such ancestor has both width and height > 100 (say) and lies within the top 300 pixels of the screen. if so, consider it a 'fixed header' type element for calculation of unusable space at the top.
  • if more than one fixed-header-type element is found, consider the bottom most one

(Even if this works, the std_header selector should still be part of urlData since it's useful semantic data anyway?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions