-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOMGNASDefaultFolderChanger.ts
More file actions
53 lines (48 loc) · 2.54 KB
/
Copy pathOMGNASDefaultFolderChanger.ts
File metadata and controls
53 lines (48 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// ==UserScript==
// @name:zh-tw OMG NAS 自動點開常用資料夾
// @name OMG NAS Auto open default folder
// @namespace com.sherryyue.omgnasdefaultfolderchanger
// @version 0.4
// @description:zh-tw 開啟NAS後自動點開對內共用區
// @description Automatically open the folder "對內共用區" after opening the NAS
// @author SherryYue
// @copyright SherryYue
// @license MIT
// @match *://nas.wpkgg.com:5001/*
// @run-at document-end
// @contributionURL https://sherryyuechiu.github.io/card
// @supportURL sherryyue.c@protonmail.com
// @icon https://sherryyuechiu.github.io/card/images/logo/maskable_icon_x96.png
// @supportURL "https://github.com/sherryyuechiu/GreasyMonkeyScripts/issues"
// @homepage "https://github.com/sherryyuechiu/GreasyMonkeyScripts"
// @require http://code.jquery.com/jquery-3.4.1.min.js
// @require https://greasyfork.org/scripts/383527-wait-for-key-elements/code/Wait_for_key_elements.js?version=701631
// @grant none
// @downloadURL https://update.greasyfork.org/scripts/507753/OMG%20NAS%20Auto%20open%20default%20folder.user.js
// @updateURL https://update.greasyfork.org/scripts/507753/OMG%20NAS%20Auto%20open%20default%20folder.meta.js
// ==/UserScript==
(function () {
'use strict';
const fileStation = '#ext-gen135';
// @ts-ignore
waitForKeyElements(fileStation, () => {
document.querySelector<HTMLElement>(fileStation).click();
console.log('已幫您自動點開「File station」');
const folder0 = '[ext\\:tree-node-id="remote\\/對內共用區"]';
// @ts-ignore
waitForKeyElements(folder0, () => {
(document.querySelector<HTMLElement>(folder0).children[1] as HTMLElement).click();
console.log('已幫您自動點開「對內共用區」');
// const folder1 = '[ext\\:tree-node-id="remote/對內共用區/1018S-招財聚寶"]';
// waitForKeyElements(folder1, () => {
// document.querySelector(folder1).children[1].click();
// console.log('已幫您自動點開「1018S」');
// const folder2 = '[ext\\:tree-node-id="remote/對內共用區/1018S-招財聚寶/移交給程式檔"]';
// waitForKeyElements(folder2, () => {
// document.querySelector(folder2).click();
// console.log('已幫您自動點開「移交給程式檔」');
// });
// });
});
});
})();