Implement 'Disable Autoplaying Sounds' option.
This commit is contained in:
parent
7c476cc4c6
commit
a70e273597
@ -101,6 +101,10 @@ Config =
|
|||||||
true
|
true
|
||||||
'Rewrite the URL of the current page, removing stubs and changing /res/ to /thread/.'
|
'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':
|
'Linkification':
|
||||||
'Linkify': [
|
'Linkify': [
|
||||||
|
|||||||
@ -285,6 +285,7 @@ Main =
|
|||||||
['Catalog Links', CatalogLinks]
|
['Catalog Links', CatalogLinks]
|
||||||
['Settings', Settings]
|
['Settings', Settings]
|
||||||
['Index Generator', Index]
|
['Index Generator', Index]
|
||||||
|
['Disable Autoplay', AntiAutoplay]
|
||||||
['Announcement Hiding', PSAHiding]
|
['Announcement Hiding', PSAHiding]
|
||||||
['Fourchan thingies', Fourchan]
|
['Fourchan thingies', Fourchan]
|
||||||
['Color User IDs', IDColor]
|
['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: -moz-isolate;
|
||||||
unicode-bidi: -webkit-isolate;
|
unicode-bidi: -webkit-isolate;
|
||||||
}
|
}
|
||||||
/* party hats */
|
|
||||||
.thread > img:first-child {
|
.thread > img:first-child {
|
||||||
|
/* party hats */
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
.center > audio {
|
||||||
|
display: block;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
/* fixed, z-index */
|
/* fixed, z-index */
|
||||||
#overlay,
|
#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