PodRefreshAll

Path of Diablo refresh all button

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         PodRefreshAll
// @namespace    https://github.com/mdczaplicki
// @version      1.1
// @description  Path of Diablo refresh all button
// @author       Marek Czaplicki
// @match        https://pathofdiablo.com/p/?account*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    function $$(selector, context) {
      context = context || document;
      var elements = context.querySelectorAll(selector);
      return Array.prototype.slice.call(elements);
    }
    var pane = $('h4:contains("Offer")');

    var button = $("<button></button>");
    button.text("Refresh all!");
    button.addClass('btn');
    button.addClass('btn-success');
    button.addClass('btn-xs');

    button.css('float', 'right');
    button.css('width', '300px');

    button.click(function() {refreshAll();});

    pane.append(button);

    function refreshAll() {
        var buttons = $$('.btn.btn-success.btn-xs');
        for (var i = 0; i < buttons.length; ++i) {
            doRefresh(buttons[i]);
        }
    }
})();