Created
November 2, 2021 00:40
-
-
Save stoph/30a63a54c1fa8a3bbad858172b9aac85 to your computer and use it in GitHub Desktop.
Bookmarklet to view a gallery image from Car and Driver full screen
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
javascript:void%20function(){function htmlToElement(e){var t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild}var img=document.getElementsByClassName("active")[0].getElementsByClassName("slide-image-wrap")[0].getElementsByTagName("picture")[0].getElementsByTagName("img")[0],img_src=img.src.split("?")[0];document.body.appendChild(htmlToElement('<div id="view_image" style="display:flex;position:fixed; max-width: 100%;max-height: 100%;z-index:999; top: 0; left:0;" onclick="this.remove()"><img style="object-fit: contain;width:auto;height:auto;object-fit: contain;" src="'+img_src+'"></div>'));}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment