I wanted to try my hand at making an extension for Chrome to perform an alert for FR's Crafting page, which has a timer and page auto-refresh when the timer expires. However, it's easy to miss the page refresh if the internet is fast, and there's no on-site signal that the crafting is complete.
Basically, I want to make some little initial thing that'll detect when the crafting timer is complete, then make some kind of notification signal for me to add more stuff to the crafter, a pop-up or tab title flash or something I can see (maybe even play a .wav if I get really ambitious).
I'm not unfamiliar with lightweight coding (previous experience in HTML and some PHP), but I'm severely out of practice and sort of having trouble bridging between the 'Hello World' initial extension example, to making something that'll detect changes and then perform a second alert effect. I think I'm starting simple enough, with only wanting the extension to "count" along with the on-site timer and then alert me for now.
I've been reading through the (you need an account to see links) as I work on this, but I think the problem for now is I don't know what area will do what I want. I've been focusing on Content Scripts but I can't quite put the two concepts of "This is how you make an extension unpack correctly" to "this is how you get an extension to scrape a page for information > act on that information" together.
I'd like a nudge from someone who might know how to work Chrome to let me know what areas I should be focusing on so I can work this out and build this thing.
Oh cool! I'd heard of Greasemonkey, but not this one. I'm going to give this a look and try it out. Would you be okay with me occasionally pming you if I really run into a wall?
var player = document.createElement('audio');
player.src = 'https://dl.dropbox.com/u/7079101/coin.mp3';
player.preload = 'auto';
var timer = ( select timer element );
if ( timer.text() == "00:00" ) { // if the timer is at zero
player.play(); //Play a tone
alert( "Timer complete" ); // and then popup with an alert
} else { // otherwise
setTimeout( function() { //wait 2 seconds (2000ms)
location.reload(); // and then reload the page
}, 2000 );
}
I'm going to give the documentation a read and see about plugging it all in and debugging tomorrow after work. I'll let you know how it goes if you're interested.
I would love that! There isn't anything really special about it. it's just javascript so as long as you know how to use javascript or jquery you're good to go. Hopefully should only take like 30 minuntes