![]() ![]() |
hi, im not very user-script-smart. i was wondering if anyone knows where i can find a script that plays a sound (windows logon ect...) when another script takes me to a certain URL. eg, when i voyage to "www.google.com" a sound will play. thanks (please note, i am a massive N00B when it somes to scripts lol.
|
![]() ![]() |
anyone? |
![]() ![]() |
Try searching the forums. Similar requests have been made and solved before. |
![]() ![]() |
Here: document.body.innerHTML += '<div style="display:none;"><audio src="http://www.skierpage.com/moz_bugs/Albanian_numbers.ogg" controls="true" autoplay></audio></div>'; ______________________________________________
______________________________________________
example CSS visibility property
A div is created. Inline css is used to hide it. If you remove The audio tag goes into the div. Autoplay is set to true. The document.body.innerHTML = document.body.innerHTML + '<div style="display:none;"><audio src="http://www.skierpage.com/moz_bugs/Albanian_numbers.ogg" controls="true" autoplay></audio></div>'; The audio is a guy counting in Albanian. I didn't feel like looking around for something better. I assume that only .ogg files can be used. I assume there's some way to set the volume. Maybe as simple as |
![]() ![]() |
ekbworldwide wrote: Well it would be much better to create the div and then append it to the body. Your way would break any eventlisteners, etc. newDiv = document.createElement("div");
newDiv.innerHTML = "<audio src=\"http://www.skierpage.com/moz_bugs/Albanian_numbers.ogg\" controls=\"true\" autoplay></audio>";
newDiv.style.display = "none";
document.body.appendChild(newDiv);
|
![]() ![]() |
im quite confused, i dont mean to duplicate posts either however i cannot literally make sense of anything anyone makes.
|
![]() ![]() |
______________________________
______________________________
>> without step by step explanations I could give you even more detailed step by step instructsions on my code, but there's a problem. My code is flawed. What znerp posted is far better, but much harder to explain. Your first step is go to google and use sites like like w3schools.com Go to such a site and go through - page by page - their html tutorial. And their css tutorial. And their javascript tutorial. Most code isn't going to be one line. Or four. There's an alternative... You could post a thread with a different theme. "Could somebody make a script that ..." znerp's code does what you want. You don't have to understand it to use it. |
![]() ![]() |
@AMAZINGN00B: To create your script, look at this Dive into Greasemonkey page. |
![]() ![]() |
Thanks everyone for trying to help.
document.title = "Google ";
|



