Created
June 12, 2017 20:52
-
-
Save aconz2/14586ea32190ff5b5b339e00415799bd to your computer and use it in GitHub Desktop.
Load more job results when bottom of page is reached on Upwork
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Upwork MoreResults | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Load more job results when bottom of page is reached | |
// @author aconz2 | |
// @match https://www.upwork.com/ab/find-work/* | |
// @require http://code.jquery.com/jquery-latest.js | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function getDocHeight() { | |
var D = document; | |
return Math.max( | |
D.body.scrollHeight, D.documentElement.scrollHeight, | |
D.body.offsetHeight, D.documentElement.offsetHeight, | |
D.body.clientHeight, D.documentElement.clientHeight | |
); | |
} | |
$(window).scroll(function() { | |
if($(window).scrollTop() + $(window).height() == getDocHeight()) { | |
angular.element(document.getElementById('load-more-button')).controller().getOlderJobs(); | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment