Skip to content

Instantly share code, notes, and snippets.

@dagadbm
Last active March 20, 2026 11:28
Show Gist options
  • Select an option

  • Save dagadbm/71e4cd2cac8ffac06d9dcd149c28e4c7 to your computer and use it in GitHub Desktop.

Select an option

Save dagadbm/71e4cd2cac8ffac06d9dcd149c28e4c7 to your computer and use it in GitHub Desktop.
Beeper
sound:
```
javascript:void(function(){var cfg={selector:'[id="7c6174f21b3e0850bd4f32e2cd4bcb75"]',volume:50,pitch:440,duration:0.25};var ctx=new(window.AudioContext||window.webkitAudioContext);var el=document.querySelector(cfg.selector);if(!el){console.log('%c[[Beep](javascript:void(function(){var cfg={selector:'[id="7c6174f21b3e0850bd4f32e2cd4bcb75"]',volume:50,pitch:440,duration:0.25};var ctx=new(window.AudioContext||window.webkitAudioContext);var el=document.querySelector(cfg.selector);if(!el){console.log('%c[Beeper] Element not found: '+cfg.selector,'color:red;font-weight:bold');return}console.log('%c[Beeper] Element found: '+cfg.selector,'color:lime;font-weight:bold');console.log('%c[Beeper] Click anywhere on the page to arm','color:yellow;font-weight:bold');document.addEventListener('click',function u(){ctx.resume();document.removeEventListener('click',u);console.log('%c[Beeper] Armed and ready!','color:deepskyblue;font-weight:bold')});var prev=null;function beep(){if(prev)try{prev.stop()}catch(e){}var o=ctx.createOscillator(),g=ctx.createGain();o.connect(g);g.connect(ctx.destination);o.frequency.value=cfg.pitch;g.gain.value=cfg.volume/100;o.start();o.stop(ctx.currentTime+cfg.duration);prev=o}new MutationObserver(function(){beep()}).observe(el,{childList:true,subtree:true,characterData:true,attributes:true})}()))er] Element not found: '+cfg.selector,'color:red;font-weight:bold');return}console.log('%c[Beeper] Element found: '+cfg.selector,'color:lime;font-weight:bold');console.log('%c[Beeper] Click anywhere on the page to arm','color:yellow;font-weight:bold');document.addEventListener('click',function u(){ctx.resume();document.removeEventListener('click',u);console.log('%c[Beeper] Armed and ready!','color:deepskyblue;font-weight:bold')});var prev=null;function beep(){if(prev)try{prev.stop()}catch(e){}var o=ctx.createOscillator(),g=ctx.createGain();o.connect(g);g.connect(ctx.destination);o.frequency.value=cfg.pitch;g.gain.value=cfg.volume/100;o.start();o.stop(ctx.currentTime+cfg.duration);prev=o}new MutationObserver(function(){beep()}).observe(el,{childList:true,subtree:true,characterData:true,attributes:true})}())
```
notification:
```
javascript:void(function(){var cfg={selector:'[id="7c6174f21b3e0850bd4f32e2cd4bcb75"]',title:'Beeper',body:'DOM changed!'};var el=document.querySelector(cfg.selector);if(!el){console.log('%c[Beeper] Element not found: '+cfg.selector,'color:red;font-weight:bold');return}console.log('%c[Beeper] Element found: '+cfg.selector,'color:lime;font-weight:bold');console.log('%c[Beeper] Click anywhere on the page to arm','color:yellow;font-weight:bold');document.addEventListener('click',function u(){Notification.requestPermission().then(function(p){if(p==='granted'){console.log('%c[Beeper] Armed and ready!','color:deepskyblue;font-weight:bold')}else{console.log('%c[Beeper] Notification permission denied','color:red;font-weight:bold')}});document.removeEventListener('click',u)});function notify(){new Notification(cfg.title,{body:cfg.body})}new MutationObserver(function(){notify()}).observe(el,{childList:true,subtree:true,characterData:true,attributes:true})}())
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment