TWSE tweak

顯示表格全部資料

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @author craftwar
// @name TWSE tweak
// @description 顯示表格全部資料
// @copyright 2022, craftwar (https://craftwarblog.blogspot.com/)
// @license GPL-3.0-or-later; https://www.gnu.org/licenses/gpl-3.0.txt
// @homepageURL https://github.com/craftwar/userscript/tree/master/TWSE
// @version 0.1.20220830
// @namespace github.com.craftwar
// @match https://www.twse.com.tw/zh/page/trading/fund/TWT43U.html
// @match https://www.twse.com.tw/zh/page/trading/exchange/TWT93U.html
// @grant none
// @run-at document-idle
// ==/UserScript==

'use strict';
(() => {
	new MutationObserver((record, observer) => {
		const report_len = document.querySelector('select[name="report-table_length"]')
		if (report_len) {
			observer.disconnect();

			report_len.value = -1
			report_len.dispatchEvent(new Event('change'))
		}
	}).observe(document.body, { subtree: true, childList: true });
})();