Discussions » Creation Requests

Change Facebook Notification Sound - (Convert Chrome extension to userscript)

q1k
§
Posted: 2015-10-19
Edited: 2015-10-20

Change Facebook Notification Sound - (Convert Chrome extension to userscript)

So there is this Chrome extension. And of course it won't work on Firefox, or any other browser for that matter.

What I'm asking here is someone to make it into a userscript that will play a sound from a location on our PC or from a web-url. For Example

§
Posted: 2015-10-25

I've looked through and rewritten it without jQuery so it's faster. But I'm still dissatisfied with setInterval 1000 (checking each second) so I changed it to 5 seconds.

You can change parts you wish on your PC it's quite easy code... https://greasyfork.org/uk/scripts/13346-change-facebook-notification-sound/code

§
Posted: 2015-10-25

I don't see a need in interface there are two possible variables in line 18 and 19, url and interval.

§
Posted: 2015-10-25

Don't use interval lower than 2 your browser could lag with it.

q1k
§
Posted: 2015-10-25
Edited: 2015-10-25

Thanks,
but is there any way to add a button in the chat settings menu, which then opens a popup and lets us choose a sound, be it URL or local location on disk. Also a reset feature would be nice too.

And I have lowered the interval to one second, 5 seconds is just too much..

§
Posted: 2015-10-25

As I said, it would be easier to change url in line 18, edit script and you'll see. It's just copy/paste.

§
Posted: 2015-10-25

If you'll have problems with changing it, I'll make interface especially for you.

q1k
§
Posted: 2015-10-25
Edited: 2015-10-25

Well for some reason if I change anything it doesn't work.

So I was thinking of, adding a button in the fb chat settings that would open an interface to choose file be it from url or locally.
Something like this:


And maybe also add an option to change the interval too?

§
Posted: 2015-10-25
Edited: 2015-10-25

I've added interface but it's without local option. I'm sorry but GM_config (that I used) does not have 'file' type field. And it would take more time to write it down.

If you wish you could make another request about local option, but I can't help you there...

You can find settings window in Greasemonkey's "User Script Commands" http://wiki.greasespot.net/GreasemonkeyManual:MonkeyMenu

q1k
§
Posted: 2015-10-26

ok.

But where is the button to open the UI?
I can't find it..

wOxxOmMod
§
Posted: 2015-10-26

You can probably just store base64-encoded file contents (atob() and btoa()) with GMsetValue/GMgetValue. However there's a possibility of hitting some userscript data size limit.

q1k
§
Posted: 2015-10-26

And another problem is when we click on the chat window that has a new message, it plays the sound again, as if another message was received. And I've also checked the chrome extension and this doesn't happen there.

§
Posted: 2015-10-26
Edited: 2015-10-26

http://take.ms/CHypE Here is a small screencast, also I'll check about chat window problem.

§
Posted: 2015-10-26
Edited: 2015-10-26

I've added screenshots to a userscript page

q1k
§
Posted: 2015-10-26

Alright, looking forward to your update.

§
Posted: 2015-10-26
Edited: 2015-10-26

I showed current version.

§
Posted: 2015-10-26
Edited: 2015-10-26

I pushed version update, also here is another message sound I used https://instaud.io/_/dEa.mp3

No double sounds and I've cleaned intervals now.

q1k
§
Posted: 2015-10-26
Edited: 2015-10-26

Just noticed there is still double sound, when reloading/opening a page.

§
Posted: 2015-10-26
Edited: 2015-10-26

Ok I'll check it on Seamonkey, also I cold have fixed one thing abd broken another, this stuff often needs debugging sorry about that I was just writing down small script ))), also could you check maybe you have two versions of script in script list? (if yes telodar thee older one)

q1k
§
Posted: 2015-10-27

1000% sure I have only 1 version of it installed.

q1k
§
Posted: 2015-10-31

Also another problem is that when we have more then 1 tab open we can hear the sound multiple times, once from each tab.

§
Posted: 2015-10-31

Khm, ok I'll look into it, *(about multiple sound in multiple tabs, I haven't checked it)

§
Posted: 2015-10-31

I'm not sure I've fixed everything, please check new version on multiple windows...

q1k
§
Posted: 2015-10-31
Edited: 2015-10-31

Now when we click on the chat windows in the newly opened tab the sound plays again (even multiple times..).

Also if the message has been received a while ago and later when we click on the window with new message(s) the sound plays again. This might be causing the other thing to happen.

And if a message was received while offline, once we open fb the sound plays, even though the message might have been sent hours ago, maybe days.

§
Posted: 2015-10-31

Now sound would only be played on increase in messages ) (I've changed a lot of code and now I hope it would work good cross tabs) I'm also not sure if it would play multiple times, please check now...

§
Posted: 2015-11-01

I'm not using facebook much so I'm bad at testing it. Also I think it's almost done, I'm sorry it took so long to fix it...

q1k
§
Posted: 2015-11-01
Edited: 2015-11-02

WTF. Now it keeps playing the sound over and over as many times as there are tabs open.


EDIT:
The previous version (0.2.2) seems to be better in that regard,
but one small problem there too.
If a facebook tab is in focus (the one that we are curently looking at), the sound doesn't play.
I enabled fb chat sounds, and the original sound does play.


EDIT 2:
v0.2.2 - On the first message received sound doesn't play, but after that the sound does play.
Not a big deal, but I wanted to point it out.

§
Posted: 2015-11-03

Oh, so I've broken it once more, ok, I'll make it work but on this weekend, the first message I'll fix it... )

§
Posted: 2015-11-09

Please try v0.2.4 it might not fix initial sound but I recovered it to version 0.2.2 and added changes I hipe might fix it on initial launch. I can't replicate them though. In the end you can use my skype dirrectly and test it with me online. *(skype login: dexmaster)

q1k
§
Posted: 2015-11-09
Edited: 2015-11-09

OK, will test it now
Seems to be working fine, but the initial sound still doesn't play

q1k
§
Posted: 2016-04-29
Edited: 2016-04-29

Ok, I have just one more requirement.

Is it possible that when I disable the sound through the greesemonkey script commands, to disble the sounds instantly without the need to reload the page.?

Because what's the point of the enable/disable option if I have to reload the page...
I could just as easily just disable the whole script and reload the page (heck, it's even faster).

But the point is to not have to reload the page at all.


And another thing, is it possible to get the initial sound to play? (it still doesn't work)

Post reply

Sign in to post a reply.