Last active
January 24, 2021 13:47
-
-
Save CTurt/455286b909c847692fd1099736d81f31 to your computer and use it in GitHub Desktop.
Bookmark specific location within page without any id attributes; only works for pages that allow iframe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data:text/html,<html><body style="margin:0; padding:0;"><iframe id='i' src='http://forecast.weather.gov/MapClick.php?CityName=Las+Vegas&state=NV&site=VEF&textField1=36.175&textField2=-115.136&e=0' width=100% frameborder=0 margin=0 scrolling=no style="height: calc(100vh + 170px + 200px);"></iframe></body><script>window.scrollTo(0, 170);window.onscroll = function(e) {if((window.innerHeight + window.scrollY) >= document.body.offsetHeight - 200) {document.getElementById('i').style.height = window.innerHeight + window.scrollY + 200;}};</script></html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The trick is, we can't get the height of the page, so we just hijack the scrolling event to make the page taller once we approach the bottom.