Skip to content

Instantly share code, notes, and snippets.

@aconz2
Created June 12, 2017 20:52
Show Gist options
  • Save aconz2/14586ea32190ff5b5b339e00415799bd to your computer and use it in GitHub Desktop.
Save aconz2/14586ea32190ff5b5b339e00415799bd to your computer and use it in GitHub Desktop.
Load more job results when bottom of page is reached on Upwork
// ==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