Results 1 to 6 of 6

Thread: Help Getting Started in Chrome Extensions

  1. #1
    PabstBlueRibbon's Avatar
    Joined
    Jan 2017
    Posts
    144
    Userbars
    4
    Thanks
    91
    Thanked
    123/68
    Mentioned
    39 times
    Time Online
    9d 1h 35m
    Avg. Time Online
    4m

    Help Getting Started in Chrome Extensions

    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.

  2. #2
    LucyTurtle's Avatar
    Joined
    Jul 2018
    Posts
    16
    Userbars
    0
    Thanks
    0
    Thanked
    3/3
    DL/UL
    7/0
    Mentioned
    3 times
    Time Online
    7h 42m
    Avg. Time Online
    N/A
    @(you need an account to see links)

    This would be really easy with tampermonkey if you're familiar with javascript. I woul be more than willing to write it for you or help you out!

  3. #3
    PabstBlueRibbon's Avatar
    Joined
    Jan 2017
    Posts
    144
    Userbars
    4
    Thanks
    91
    Thanked
    123/68
    Mentioned
    39 times
    Time Online
    9d 1h 35m
    Avg. Time Online
    4m
    @(you need an account to see links)

    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?

  4. #4
    LucyTurtle's Avatar
    Joined
    Jul 2018
    Posts
    16
    Userbars
    0
    Thanks
    0
    Thanked
    3/3
    DL/UL
    7/0
    Mentioned
    3 times
    Time Online
    7h 42m
    Avg. Time Online
    N/A
    @(you need an account to see links) yeah it's no problem!

    here is the basic layout for your script. i'm not too familiar with what the page looks like otherwise I'd provide more specifics lol

    // ==UserScript==
    // @(you need an account to see links) FR Crafting Timer
    // @(you need an account to see links)space (you need an account to see links)
    // @version 0.1
    // @(you need an account to see links)cription try to take over the world!
    // @author You
    // @(you need an account to see links)ch (you need an account to see links)
    // @grant none
    // @include (you need an account to see links) <-- replace
    // ==/UserScript==

    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 );
    }

  5. #5
    PabstBlueRibbon's Avatar
    Joined
    Jan 2017
    Posts
    144
    Userbars
    4
    Thanks
    91
    Thanked
    123/68
    Mentioned
    39 times
    Time Online
    9d 1h 35m
    Avg. Time Online
    4m
    @(you need an account to see links)

    Thank you!

    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.

  6. #6
    LucyTurtle's Avatar
    Joined
    Jul 2018
    Posts
    16
    Userbars
    0
    Thanks
    0
    Thanked
    3/3
    DL/UL
    7/0
    Mentioned
    3 times
    Time Online
    7h 42m
    Avg. Time Online
    N/A
    @(you need an account to see links)

    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

    I would love updates (:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •