Sync Koinly Wallets

Finds all "Sync Wallet" buttons in the HTML and programmatically clicks each one.

目前為 2021-11-28 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Sync Koinly Wallets
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Finds all "Sync Wallet" buttons in the HTML and programmatically clicks each one.
// @author       You
// @match        https://app.koinly.io/p/wallets
// @icon         https://www.google.com/s2/favicons?domain=koinly.io
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    const cl = console.log

    document.addEventListener('keydown', event => {
        if (event.ctrlKey && event.shiftKey && event.code === 'KeyS') {
            syncWallets()
        }
    });

    async function syncWallets () {
        const $table = document.querySelector('.wallets-table')
        const $syncBtns = $table.querySelectorAll('.wallet-well-more button')

        for (const $btn of $syncBtns) {
            if ($btn.innerText.includes('Sync')) {
                $btn.click()
            }
        }
    }

})();