Userscripts, help information etc.

Discussion in 'Off-topic' started by Nameless, Mar 29, 2014.

  1. Nameless

    Nameless Beta Tester

    Joined:
    Mar 19, 2014
    Messages:
    723
    Does anyone know the best way to see how a site works to make your own userscripts to bypass parts? Reason i ask is because im new to third party addons and the ones im using now needs an update but, i dont know how to do it and i dont have the "old" site code to compare and try and fix myself.

    Here is the code that use to work:
    Code:
        //firedrive
        $('.continue').click();
        $('#fdvabox').remove();
        setInterval(function () { //autostart firedrive
            var selector = '#play_video';
            if ($(selector).is(":visible")){
                $( selector ).click();
                $( selector ).remove();
            }
        }, 1000);
    
    this is the code the site is currently using making the above code invalid (page stalls on loading)

    Code:
    $(document).ready(function(){
    	
    	setTimeout(function(){
    		
    		$('#fd_prepare_image').fadeOut('fast');
    		$('#fd_prepare_image_done').fadeIn('fast');
    		$('#prepare_continue_btn').removeClass('prepare_btn_loading').addClass('prepare_btn_done');
    		$('#prepare_continue_btn').html('Continue to file <span class="prepare_done_arrow"></span>');
    		
    		$(document).on('click', '#prepare_continue_btn', function(){
    			$('#confirm_form').submit();
    		});
    		
    	}, 1000);
    		
    	if(typeof _gaq !== 'undefined'){
    		var ga_visit_cat = 'Archive';
    		_gaq.push(['_trackEvent', ga_visit_cat, 'interpage']);
    	}
    	
    	
    });
    
    i believ i have right parts of the code but unsure what i need to do which brings me onto the next question.

    If i install an addon to adguard is it reading the script from the site or your computer? If its the computer where is it stored, this is a new area i need to look into and learn i guess just need to knwo where to start lol
     
  2. avatar

    avatar Administrator Staff Member Administrator

    Joined:
    Oct 26, 2010
    Messages:
    11,947
    So you want to modify third-party userscript, am I right?

    The right way - create your own fork, modify @updateURL and @downloadURL and install it into Adguard.
    The second option - download original userscript, remove @updateURL and @downloadURL, modify it's code and install it into Adguard (use the path to the file instead of URL).

    Installed userscripts are stored in %programdata%\Adguard\userscripts.
     
  3. Nameless

    Nameless Beta Tester

    Joined:
    Mar 19, 2014
    Messages:
    723
    Thanks avatar.

    Yes i mean so i could modify the script soon as i figured out what i needed to do, userscripts and javascript is new to me will have to research stuff when i get chance.
     
  4. Boo Berry

    Boo Berry Moderator + Beta Tester Moderator

    Joined:
    May 30, 2012
    Messages:
    2,424
  5. avatar

    avatar Administrator Staff Member Administrator

    Joined:
    Oct 26, 2010
    Messages:
    11,947
    Modifying and debugging userscripts is not our strong side for now.

    So the best way to debug it now - use a greasemonkey.
     
  6. Nameless

    Nameless Beta Tester

    Joined:
    Mar 19, 2014
    Messages:
    723
    After today i have decided not to use the extension feature for userscripts as it seems to be more hassle than its worth at the moment with scripts not working, plus the script i was using just would not update in adguard even though their had been two updates without me uninstalling and re-installing which of cause means i need to re-find the script though my browser as there is no linking system within adguard just uninstall and disable. - guess that could be something thats added a link to the installed scripts.

    Also tamper monkey makes it easier to edit the script once installed so i could chance a 3second wait time to 1 second (what? every second counts! lol).

    All in all im liking the product and will end up buying it once my trial ends in September as its obvious admuncher isn't going to change its ways its been 3-4 weeks for a video of admuncher 5 now.
     
  7. Boo Berry

    Boo Berry Moderator + Beta Tester Moderator

    Joined:
    May 30, 2012
    Messages:
    2,424
    Yeah, I'm really hoping the compatibility with problematic scripts improves for v6. But, gotta admit for the scripts it does work with, it's pretty darn decent indeed and is an awesome step in the right direction. :D
     
  8. Nameless

    Nameless Beta Tester

    Joined:
    Mar 19, 2014
    Messages:
    723
    Yeh, once the system is in place and fully functional with a few updates it should be good though at the same time i can see it being abit of an issue as people will no doubt come here asking for help creating a script to do this and that etc.

    Updates i found that could be added are:
    More compatible scripts if not all - otherwise its just going to be a useless feature imo
    Updating feature working and/or link back to the script online
    A way to open/edit the script even if its just a link that opens notepad for minor changes anything more detailed then of cause you download your own coding application, i suppose a setting could be added so people could choose there default editing program too but idk.
     
  9. avatar

    avatar Administrator Staff Member Administrator

    Joined:
    Oct 26, 2010
    Messages:
    11,947
    That's why extensions feature is available in extended interface only. It is not good enough yet to be on the main screen.
    Also I don't like the situation when the casual user should search and test userscripts by his own, not sure if it is compatible or not.

    We plan to create our own small userscripts repository, containing 100% compatible userscripts.

    Which script do you use? We'd like to find out what's wrong with updates.
     
  10. Nameless

    Nameless Beta Tester

    Joined:
    Mar 19, 2014
    Messages:
    723
    Building your own repo is a nice idea but of cause is more work for you specially if there is a script already out there being updated (are you goiing to update the scripts yourselfs or are you looking for users to create and update them?) but i can see why you would want to do this as it of cause means their is no security risk as some scripts are not nice (malware etc) and there is less chances of people complaining about this and that.

    As for the script update it was this script: http://userscripts.org/scripts/review/386953
    Dont know why it would not update and there hasn;t been an update since to check it with tampermonkey.

    Sorry if what im saying isn;t making much sense my brain really isn't working today finding it hard to concentrate.
     
  11. avatar

    avatar Administrator Staff Member Administrator

    Joined:
    Oct 26, 2010
    Messages:
    11,947
    We'll add some trustworthy userscripts like Youtube Center.
    And also we plan to add some our own userscripts (so we'll update them by ourselves).

    Thanks, we'll check it!
     
  12. Nameless

    Nameless Beta Tester

    Joined:
    Mar 19, 2014
    Messages:
    723
    Yeh youtube center is ok i use that myself via the chrome plugin as for your own scripts be interesting to see whats added in the future.

    As for the firedrive script is should mention its not compatible with adguard as it will not re-direct in fact i think it just gets stuck loading the page i forgot.
     
  13. Boo Berry

    Boo Berry Moderator + Beta Tester Moderator

    Joined:
    May 30, 2012
    Messages:
    2,424
    My guess why it doesn't update is, it isn't specifying a URL to do so (via @update) like some other userscripts do. I'm guessing Tampermonkey when it checks for updates simply re-downloads the scripts instead of checking for a @update URL like Greasemonkey specifies.
     
  14. Nameless

    Nameless Beta Tester

    Joined:
    Mar 19, 2014
    Messages:
    723
    I will admit i do remember someone mentioning updateurl but with me not knowing much about usescripts was unsure if it was needed specially with me giving adguard the url to start with making it null and void but i guess that url isnt saved.
     
  15. avatar

    avatar Administrator Staff Member Administrator

    Joined:
    Oct 26, 2010
    Messages:
    11,947
    Maybe we should also re-download if updateURL is not specified.
     
  16. Boo Berry

    Boo Berry Moderator + Beta Tester Moderator

    Joined:
    May 30, 2012
    Messages:
    2,424
    Probably wouldn't be a bad idea. :)