KevinPayravi / indie-wiki-buddy

Browser extension that automatically notifies and redirects you to independent wikis.
https://getindie.wiki
MIT License
267 stars 74 forks source link

Prevent banner from covering navigation bar #427

Open SnorlaxMonster opened 8 months ago

SnorlaxMonster commented 8 months ago

While the point of the extension is to send users to a different wiki, ideally the banner would not obstruct the navigation bar of the origin wiki (which typically includes the "Search" button too). Users may wish to be aware of the independent wiki, but still want to browse the non-independent wiki without obstruction.

On Fextralife, the Indie Wiki Buddy completely covers the navigation bar at the top of the page. image image

The same thing happens on mobile Fandom (desktop Fandom is mostly unaffected). image image

KevinPayravi commented 8 months ago

Thanks for sharing this.

The IWB banner is inserted into the root of the DOM with CSS values z-index: 2147483647; position: sticky; top: 0;, to stay at the top of the screen and (ideally) push the rest of the page content down. Looks like in the case of Fextra and mobile Fandom, their navigation bars have fixed positioning at the top, so the two elements overlap.

Might be a tricky fix...I'll have to play around with it. The best idea I can come up with off the top of my head is using JavaScript to query the height of the fixed navigation bar, and then offset the IWB banner by that height.