DragonianBrickHill / Brick hill instant-purchase buttons

// ==UserScript==
// @name         Brick hill instant-purchase buttons
// @namespace    http://brick-hill.com/
// @version      0.1
// @description  Removes the confirmation popup in purchase buttons
// @author       Dragonian
// @require      https://code.jquery.com/jquery-latest.min.js
// @match        https://*/shop/*
// @license      MIT
// ==/UserScript==

const buttons = ["buyBits", "buyBucks", "buyFree"];

for (let buy of buttons) {
  if ($(`input[onclick="${buy}()"`).length) {
    $(`input[onclick="${buy}()"`).on('click', () => {
      $.post('', {
        csrf_token: $('input[name="csrf_token"]').val(),
        [buy]: 'Buy Now'
      }, () => {
        return location.reload();
      });
    });
  }
}

// Created by Dragonian; https://www.brick-hill.com/user?id=2760