Created
August 10, 2019 20:34
-
-
Save SharpCoder/de99c19168652b5d1a1fa0d733e94d6c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| let shown = false; | |
| window.onscroll = (evt) => { | |
| const commentEl = document.getElementById("comments"); | |
| const bounding = commentEl.getBoundingClientRect(); | |
| const height = (window.innerHeight || document.documentElement.clientHeight); | |
| if (height >= bounding.top) { | |
| if (!shown) alert("There be dragons here!"); | |
| shown = true; | |
| } | |
| }; |
This file contains hidden or 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
| { | |
| "name": "YouTube Dragons", | |
| "version": "1.0", | |
| "description": "There be dragons here!", | |
| "content_scripts": [ | |
| { | |
| "matches": ["https://*.youtube.com/*"], | |
| "js": ["contentScript.js"] | |
| } | |
| ], | |
| "manifest_version": 2, | |
| "permissions": [ | |
| "activeTab" | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment