Implement 'Disable Autoplaying Sounds' option.
This commit is contained in:
parent
7c476cc4c6
commit
a70e273597
@ -101,6 +101,10 @@ Config =
|
||||
true
|
||||
'Rewrite the URL of the current page, removing stubs and changing /res/ to /thread/.'
|
||||
]
|
||||
'Disable Autoplaying Sounds': [
|
||||
false
|
||||
'Prevent sounds on the page from autoplaying.'
|
||||
]
|
||||
|
||||
'Linkification':
|
||||
'Linkify': [
|
||||
|
||||
@ -285,6 +285,7 @@ Main =
|
||||
['Catalog Links', CatalogLinks]
|
||||
['Settings', Settings]
|
||||
['Index Generator', Index]
|
||||
['Disable Autoplay', AntiAutoplay]
|
||||
['Announcement Hiding', PSAHiding]
|
||||
['Fourchan thingies', Fourchan]
|
||||
['Color User IDs', IDColor]
|
||||
|
||||
@ -99,10 +99,14 @@ hr + div.center:not(.ad-cnt):not(.topad):not(.middlead):not(.bottomad) {
|
||||
unicode-bidi: -moz-isolate;
|
||||
unicode-bidi: -webkit-isolate;
|
||||
}
|
||||
/* party hats */
|
||||
.thread > img:first-child {
|
||||
/* party hats */
|
||||
pointer-events: none;
|
||||
}
|
||||
.center > audio {
|
||||
display: block;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
/* fixed, z-index */
|
||||
#overlay,
|
||||
|
||||
10
src/Miscellaneous/AntiAutoplay.coffee
Normal file
10
src/Miscellaneous/AntiAutoplay.coffee
Normal file
@ -0,0 +1,10 @@
|
||||
AntiAutoplay =
|
||||
init: ->
|
||||
return if !Conf['Disable Autoplaying Sounds']
|
||||
$.ready @ready
|
||||
|
||||
ready: ->
|
||||
for audio in $$ 'audio[autoplay]'
|
||||
audio.pause()
|
||||
audio.autoplay = false
|
||||
audio.controls = true
|
||||
Loading…
x
Reference in New Issue
Block a user