pake-cli 2.0.4 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -58,9 +58,25 @@
58
58
  </td>
59
59
  </tr>
60
60
  <tr>
61
- <td><img src=https://cdn.fliggy.com/upic/0khyI4.png width=600/></td>
61
+ <td><img src=https://cdn.fliggy.com/upic/rdeeLu.jpg width=600/></td>
62
62
  <td><img src=https://cdn.fliggy.com/upic/7QUfi3.png width=600/></td>
63
63
  </tr>
64
+ <tr>
65
+ <td>YouTube Music
66
+ <a href="https://github.com/tw93/Pake/releases/latest/download/YouTubeMusic.dmg">Mac</a>
67
+ <a href="https://github.com/tw93/Pake/releases/latest/download/YouTubeMusic_x64.msi">Windows</a>
68
+ <a href="https://github.com/tw93/Pake/releases/latest/download/YouTubeMusic_x86_64.deb">Linux</a>
69
+ </td>
70
+ <td>YouTube
71
+ <a href="https://github.com/tw93/Pake/releases/latest/download/YouTube.dmg">Mac</a>
72
+ <a href="https://github.com/tw93/Pake/releases/latest/download/YouTube_x64.msi">Windows</a>
73
+ <a href="https://github.com/tw93/Pake/releases/latest/download/YouTube_x86_64.deb">Linux</a>
74
+ </td>
75
+ </tr>
76
+ <tr>
77
+ <td><img src=https://cdn.fliggy.com/upic/iz3mtQ.png width=600/></td>
78
+ <td><img src=https://cdn.fliggy.com/upic/s4ZLNC.jpg width=600/></td>
79
+ </tr>
64
80
  <tr>
65
81
  <td>LiZhi
66
82
  <a href="https://github.com/tw93/Pake/releases/latest/download/LiZhi.dmg">Mac</a>
@@ -78,52 +94,36 @@
78
94
  <td><img src=https://cdn.fliggy.com/upic/0C9lju.jpg width=600/></td>
79
95
  </tr>
80
96
  <tr>
81
- <td>YouTube
82
- <a href="https://github.com/tw93/Pake/releases/latest/download/YouTube.dmg">Mac</a>
83
- <a href="https://github.com/tw93/Pake/releases/latest/download/YouTube_x64.msi">Windows</a>
84
- <a href="https://github.com/tw93/Pake/releases/latest/download/YouTube_x86_64.deb">Linux</a>
97
+ <td>Qwerty
98
+ <a href="https://github.com/tw93/Pake/releases/latest/download/Qwerty.dmg">Mac</a>
99
+ <a href="https://github.com/tw93/Pake/releases/latest/download/Qwerty_x64.msi">Windows</a>
100
+ <a href="https://github.com/tw93/Pake/releases/latest/download/Qwerty_x86_64.deb">Linux</a>
85
101
  </td>
86
- <td>XiaoHongShu
87
- <a href="https://github.com/tw93/Pake/releases/latest/download/XiaoHongShu.dmg">Mac</a>
88
- <a href="https://github.com/tw93/Pake/releases/latest/download/XiaoHongShu_x64.msi">Windows</a>
89
- <a href="https://github.com/tw93/Pake/releases/latest/download/XiaoHongShu_x86_64.deb">Linux</a>
102
+ <td>CodeRunner
103
+ <a href="https://github.com/tw93/Pake/releases/latest/download/CodeRunner.dmg">Mac</a>
104
+ <a href="https://github.com/tw93/Pake/releases/latest/download/CodeRunner_x64.msi">Windows</a>
105
+ <a href="https://github.com/tw93/Pake/releases/latest/download/CodeRunner_x86_64.deb">Linux</a>
90
106
  </td>
91
107
  </tr>
92
108
  <tr>
93
- <td><img src=https://cdn.fliggy.com/upic/s4ZLNC.jpg width=600/></td>
94
- <td><img src=https://cdn.fliggy.com/upic/sKN5Bn.png width=600/></td>
109
+ <td><img src=https://cdn.fliggy.com/upic/i2eg6G.png width=600/></td>
110
+ <td><img src=https://cdn.fliggy.com/upic/fS1lVi.jpg width=600/></td>
95
111
  </tr>
96
- <tr>
112
+ <tr>
97
113
  <td>Flomo
98
114
  <a href="https://github.com/tw93/Pake/releases/latest/download/Flomo.dmg">Mac</a>
99
115
  <a href="https://github.com/tw93/Pake/releases/latest/download/Flomo_x64.msi">Windows</a>
100
116
  <a href="https://github.com/tw93/Pake/releases/latest/download/Flomo_x86_64.deb">Linux</a>
101
117
  </td>
102
- <td>Qwerty
103
- <a href="https://github.com/tw93/Pake/releases/latest/download/Qwerty.dmg">Mac</a>
104
- <a href="https://github.com/tw93/Pake/releases/latest/download/Qwerty_x64.msi">Windows</a>
105
- <a href="https://github.com/tw93/Pake/releases/latest/download/Qwerty_x86_64.deb">Linux</a>
118
+ <td>XiaoHongShu
119
+ <a href="https://github.com/tw93/Pake/releases/latest/download/XiaoHongShu.dmg">Mac</a>
120
+ <a href="https://github.com/tw93/Pake/releases/latest/download/XiaoHongShu_x64.msi">Windows</a>
121
+ <a href="https://github.com/tw93/Pake/releases/latest/download/XiaoHongShu_x86_64.deb">Linux</a>
106
122
  </td>
107
123
  </tr>
108
124
  <tr>
109
125
  <td><img src=https://gw.alipayobjects.com/zos/k/30/RoUSUf.png width=600/></td>
110
- <td><img src=https://cdn.fliggy.com/upic/i2eg6G.png width=600/></td>
111
- </tr>
112
- <tr>
113
- <td>Reference
114
- <a href="https://github.com/tw93/Pake/releases/latest/download/Reference.dmg">Mac</a>
115
- <a href="https://github.com/tw93/Pake/releases/latest/download/Reference_x64.msi">Windows</a>
116
- <a href="https://github.com/tw93/Pake/releases/latest/download/Reference_x86_64.deb">Linux</a>
117
- </td>
118
- <td>CodeRunner
119
- <a href="https://github.com/tw93/Pake/releases/latest/download/CodeRunner.dmg">Mac</a>
120
- <a href="https://github.com/tw93/Pake/releases/latest/download/CodeRunner_x64.msi">Windows</a>
121
- <a href="https://github.com/tw93/Pake/releases/latest/download/CodeRunner_x86_64.deb">Linux</a>
122
- </td>
123
- </tr>
124
- <tr>
125
- <td><img src=https://cdn.fliggy.com/upic/SPGMRY.png width=600/></td>
126
- <td><img src=https://cdn.fliggy.com/upic/fS1lVi.jpg width=600/></td>
126
+ <td><img src=https://cdn.fliggy.com/upic/yJVwyi.png width=600/></td>
127
127
  </tr>
128
128
  </table>
129
129
 
@@ -248,25 +248,25 @@ Pake's development can not be without these Hackers. They contributed a lot of c
248
248
  </a>
249
249
  </td>
250
250
  <td align="center">
251
- <a href="https://github.com/m1911star">
252
- <img src="https://avatars.githubusercontent.com/u/4948120?v=4" width="90;" alt="m1911star"/>
251
+ <a href="https://github.com/AielloChan">
252
+ <img src="https://avatars.githubusercontent.com/u/7900765?v=4" width="90;" alt="AielloChan"/>
253
253
  <br />
254
- <sub><b>Horus</b></sub>
254
+ <sub><b>Aiello</b></sub>
255
255
  </a>
256
256
  </td></tr>
257
257
  <tr>
258
258
  <td align="center">
259
- <a href="https://github.com/Pake-Actions">
260
- <img src="https://avatars.githubusercontent.com/u/126550811?v=4" width="90;" alt="Pake-Actions"/>
259
+ <a href="https://github.com/m1911star">
260
+ <img src="https://avatars.githubusercontent.com/u/4948120?v=4" width="90;" alt="m1911star"/>
261
261
  <br />
262
- <sub><b>Pake Actions</b></sub>
262
+ <sub><b>Horus</b></sub>
263
263
  </a>
264
264
  </td>
265
265
  <td align="center">
266
- <a href="https://github.com/AielloChan">
267
- <img src="https://avatars.githubusercontent.com/u/7900765?v=4" width="90;" alt="AielloChan"/>
266
+ <a href="https://github.com/Pake-Actions">
267
+ <img src="https://avatars.githubusercontent.com/u/126550811?v=4" width="90;" alt="Pake-Actions"/>
268
268
  <br />
269
- <sub><b>Aiello</b></sub>
269
+ <sub><b>Pake Actions</b></sub>
270
270
  </a>
271
271
  </td>
272
272
  <td align="center">
@@ -333,6 +333,13 @@ Pake's development can not be without these Hackers. They contributed a lot of c
333
333
  <sub><b>Hyzhao</b></sub>
334
334
  </a>
335
335
  </td>
336
+ <td align="center">
337
+ <a href="https://github.com/lakca">
338
+ <img src="https://avatars.githubusercontent.com/u/16255922?v=4" width="90;" alt="lakca"/>
339
+ <br />
340
+ <sub><b>Null</b></sub>
341
+ </a>
342
+ </td>
336
343
  <td align="center">
337
344
  <a href="https://github.com/liusishan">
338
345
  <img src="https://avatars.githubusercontent.com/u/33129823?v=4" width="90;" alt="liusishan"/>
package/dist/cli.js CHANGED
@@ -1695,9 +1695,9 @@ function mergeTauriConfig(url, options, tauriConf) {
1695
1695
  const cli_path = path.join(new_dir, "cli.js");
1696
1696
  const cli_path_target = path.join(old_dir, "cli.js");
1697
1697
  const about_pake_path = path.join(new_dir, "about_pake.html");
1698
- const about_patk_path_target = path.join(old_dir, "about_pake.html");
1698
+ const about_pake_path_target = path.join(old_dir, "about_pake.html");
1699
1699
  fs$1.copyFile(cli_path, cli_path_target);
1700
- fs$1.copyFile(about_pake_path, about_patk_path_target);
1700
+ fs$1.copyFile(about_pake_path, about_pake_path_target);
1701
1701
  }
1702
1702
  tauriConf.pake.windows[0].url = file_name;
1703
1703
  tauriConf.pake.windows[0].url_type = "local";
@@ -1837,7 +1837,7 @@ function mergeTauriConfig(url, options, tauriConf) {
1837
1837
  if (icon_exists) {
1838
1838
  // 需要判断图标格式,默认只支持ico和png两种
1839
1839
  let iconExt = path.extname(systemTrayIcon).toLowerCase();
1840
- if (iconExt == ".png" || iconExt == ".icon") {
1840
+ if (iconExt == ".png" || iconExt == ".ico") {
1841
1841
  useDefaultIcon = false;
1842
1842
  const trayIcoPath = path.join(npmDirectory, `src-tauri/png/${name.toLowerCase()}${iconExt}`);
1843
1843
  tauriConf.tauri.systemTray.iconPath = `png/${name.toLowerCase()}${iconExt}`;
@@ -2523,7 +2523,7 @@ class BuilderFactory {
2523
2523
  }
2524
2524
 
2525
2525
  var name = "pake-cli";
2526
- var version = "2.0.4";
2526
+ var version = "2.0.6";
2527
2527
  var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。";
2528
2528
  var engines = {
2529
2529
  node: ">=16.0.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pake-cli",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。",
5
5
  "engines": {
6
6
  "node": ">=16.0.0"
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -26,6 +26,7 @@ pub fn get_window(app: &mut App, config: PakeConfig, _data_dir: PathBuf) -> Wind
26
26
  .resizable(window_config.resizable)
27
27
  .fullscreen(window_config.fullscreen)
28
28
  .inner_size(window_config.width, window_config.height)
29
+ .disable_file_drop_handler() //Very annoying, otherwise dragging files to the window will not work.
29
30
  .initialization_script(include_str!("../inject/style.js"))
30
31
  .initialization_script(include_str!("../inject/event.js"))
31
32
  .initialization_script(include_str!("../inject/component.js"));
@@ -1,204 +1,224 @@
1
1
  const shortcuts = {
2
- ArrowUp: () => scrollTo(0, 0),
3
- ArrowDown: () => scrollTo(0, document.body.scrollHeight),
4
- ArrowLeft: () => window.history.back(),
5
- ArrowRight: () => window.history.forward(),
6
- '[': () => window.history.back(),
7
- ']': () => window.history.forward(),
8
- r: () => window.location.reload(),
9
- '-': () => zoomOut(),
10
- '=': () => zoomIn(),
11
- '+': () => zoomIn(),
12
- 0: () => setZoom('100%'),
2
+ ArrowUp: () => scrollTo(0, 0),
3
+ ArrowDown: () => scrollTo(0, document.body.scrollHeight),
4
+ // Don't use command + ArrowLeft or command + ArrowRight
5
+ // When editing text in page, it causes unintended page navigation.
6
+ // ArrowLeft: () => window.history.back(),
7
+ // ArrowRight: () => window.history.forward(),
8
+ '[': () => window.history.back(),
9
+ ']': () => window.history.forward(),
10
+ r: () => window.location.reload(),
11
+ '-': () => zoomOut(),
12
+ '=': () => zoomIn(),
13
+ '+': () => zoomIn(),
14
+ 0: () => setZoom('100%'),
13
15
  };
14
16
 
15
17
  function setZoom(zoom) {
16
- const html = document.getElementsByTagName('html')[0];
17
- html.style.zoom = zoom;
18
- window.localStorage.setItem('htmlZoom', zoom);
18
+ const html = document.getElementsByTagName('html')[0];
19
+ html.style.zoom = zoom;
20
+ window.localStorage.setItem('htmlZoom', zoom);
19
21
  }
20
22
 
21
23
  function zoomCommon(zoomChange) {
22
- const currentZoom = window.localStorage.getItem('htmlZoom') || '100%';
23
- setZoom(zoomChange(currentZoom));
24
+ const currentZoom = window.localStorage.getItem('htmlZoom') || '100%';
25
+ setZoom(zoomChange(currentZoom));
24
26
  }
25
27
 
26
28
  function zoomIn() {
27
- zoomCommon((currentZoom) => `${Math.min(parseInt(currentZoom) + 10, 200)}%`);
29
+ zoomCommon((currentZoom) => `${Math.min(parseInt(currentZoom) + 10, 200)}%`);
28
30
  }
29
31
 
30
32
  function zoomOut() {
31
- zoomCommon((currentZoom) => `${Math.max(parseInt(currentZoom) - 10, 30)}%`);
33
+ zoomCommon((currentZoom) => `${Math.max(parseInt(currentZoom) - 10, 30)}%`);
32
34
  }
33
35
 
34
36
  function handleShortcut(event) {
35
- if (shortcuts[event.key]) {
36
- event.preventDefault();
37
- shortcuts[event.key]();
38
- }
37
+ if (shortcuts[event.key]) {
38
+ event.preventDefault();
39
+ shortcuts[event.key]();
40
+ }
39
41
  }
40
42
 
41
43
  //这里参考 ChatGPT 的代码
42
44
  const uid = () => window.crypto.getRandomValues(new Uint32Array(1))[0];
43
- function transformCallback(callback = () => {}, once = false) {
44
- const identifier = uid();
45
- const prop = `_${identifier}`;
46
- Object.defineProperty(window, prop, {
47
- value: (result) => {
48
- if (once) {
49
- Reflect.deleteProperty(window, prop);
50
- }
51
- return callback(result);
52
- },
53
- writable: false,
54
- configurable: true,
55
- });
56
- return identifier;
45
+
46
+ function transformCallback(callback = () => {
47
+ }, once = false) {
48
+ const identifier = uid();
49
+ const prop = `_${identifier}`;
50
+ Object.defineProperty(window, prop, {
51
+ value: (result) => {
52
+ if (once) {
53
+ Reflect.deleteProperty(window, prop);
54
+ }
55
+ return callback(result);
56
+ },
57
+ writable: false,
58
+ configurable: true,
59
+ });
60
+ return identifier;
57
61
  }
62
+
58
63
  async function invoke(cmd, args) {
59
- return new Promise((resolve, reject) => {
60
- if (!window.__TAURI_POST_MESSAGE__)
61
- reject('__TAURI_POST_MESSAGE__ does not exist~');
62
- const callback = transformCallback((e) => {
63
- resolve(e);
64
- Reflect.deleteProperty(window, `_${error}`);
65
- }, true);
66
- const error = transformCallback((e) => {
67
- reject(e);
68
- Reflect.deleteProperty(window, `_${callback}`);
69
- }, true);
70
- window.__TAURI_POST_MESSAGE__({
71
- cmd,
72
- callback,
73
- error,
74
- ...args,
64
+ return new Promise((resolve, reject) => {
65
+ if (!window.__TAURI_POST_MESSAGE__)
66
+ reject('__TAURI_POST_MESSAGE__ does not exist~');
67
+ const callback = transformCallback((e) => {
68
+ resolve(e);
69
+ Reflect.deleteProperty(window, `_${error}`);
70
+ }, true);
71
+ const error = transformCallback((e) => {
72
+ reject(e);
73
+ Reflect.deleteProperty(window, `_${callback}`);
74
+ }, true);
75
+ window.__TAURI_POST_MESSAGE__({
76
+ cmd,
77
+ callback,
78
+ error,
79
+ ...args,
80
+ });
75
81
  });
76
- });
77
82
  }
78
83
 
79
- document.addEventListener('DOMContentLoaded', () => {
80
- const topDom = document.createElement('div');
81
- topDom.id = 'pack-top-dom';
82
- document.body.appendChild(topDom);
83
- const domEl = document.getElementById('pack-top-dom');
84
-
85
- domEl.addEventListener('mousedown', (e) => {
86
- e.preventDefault();
87
- if (e.buttons === 1 && e.detail !== 2) {
88
- invoke('drag_window');
89
- }
90
- });
84
+ // Judgment of file download.
85
+ function isDownloadLink(url) {
86
+ const fileExtensions = [
87
+ '3gp', '7z', 'ai', 'apk', 'avi', 'bmp', 'csv', 'dmg', 'doc', 'docx', 'fla', 'flv', 'gif', 'gz', 'gzip',
88
+ 'ico', 'iso', 'indd', 'jar', 'jpeg', 'jpg', 'm3u8', 'mov', 'mp3', 'mp4', 'mpa', 'mpg',
89
+ 'mpeg', 'msi', 'odt', 'ogg', 'ogv', 'pdf', 'png', 'ppt', 'pptx', 'psd', 'rar', 'raw', 'rss', 'svg',
90
+ 'swf', 'tar', 'tif', 'tiff', 'ts', 'txt', 'wav', 'webm', 'webp', 'wma', 'wmv', 'xls', 'xlsx', 'xml', 'zip'
91
+ ];
92
+ const downloadLinkPattern = new RegExp(`\\.(${fileExtensions.join('|')})$`, 'i');
93
+ return downloadLinkPattern.test(url);
94
+ }
91
95
 
92
- domEl.addEventListener('touchstart', () => {
93
- invoke('drag_window');
94
- });
96
+ // No need to go to the download link.
97
+ function externalDownLoadLink() {
98
+ return ['quickref.me'].indexOf(location.hostname) > -1;
99
+ }
95
100
 
96
- domEl.addEventListener('dblclick', () => {
97
- invoke('fullscreen');
98
- });
101
+ document.addEventListener('DOMContentLoaded', () => {
102
+ const topDom = document.createElement('div');
103
+ topDom.id = 'pack-top-dom';
104
+ document.body.appendChild(topDom);
105
+ const domEl = document.getElementById('pack-top-dom');
99
106
 
100
- document.addEventListener('keyup', (event) => {
101
- if (/windows|linux/i.test(navigator.userAgent) && event.ctrlKey) {
102
- handleShortcut(event);
103
- }
104
- if (/macintosh|mac os x/i.test(navigator.userAgent) && event.metaKey) {
105
- handleShortcut(event);
106
- }
107
- });
108
-
109
- document.addEventListener('click', (e) => {
110
- const anchorElement = e.target.closest('a');
111
-
112
- if (anchorElement && anchorElement.href) {
113
- const target = anchorElement.target;
114
- anchorElement.target = '_self';
115
- const hrefUrl = new URL(anchorElement.href);
116
- const absoluteUrl = hrefUrl.href;
117
-
118
- // Handling external link redirection.
119
- if (
120
- window.location.host !== hrefUrl.host &&
121
- (target === '_blank' || target === '_new')
122
- ) {
107
+ domEl.addEventListener('mousedown', (e) => {
123
108
  e.preventDefault();
124
- invoke('open_browser', { url: absoluteUrl });
125
- return;
126
- }
127
-
128
- // Process download links for Rust to handle.
129
- if (
130
- /\.[a-zA-Z0-9]+$/i.test(removeUrlParameters(absoluteUrl)) &&
131
- !externalDownLoadLink()
132
- ) {
133
- e.preventDefault();
134
- invoke('download_file', {
135
- params: {
136
- url: absoluteUrl,
137
- filename: getFilenameFromUrl(absoluteUrl),
138
- },
139
- });
140
- }
141
- }
142
- });
143
-
144
- // Rewrite the window.open function.
145
- const originalWindowOpen = window.open;
146
- window.open = function (url, name, specs) {
147
- // Apple login and google login
148
- if (name === 'AppleAuthentication') {
149
- //do nothing
150
- } else if (specs.includes('height=') || specs.includes('width=')) {
151
- location.href = url;
152
- } else {
153
- const baseUrl = window.location.origin + window.location.pathname;
154
- const hrefUrl = new URL(url, baseUrl);
155
- invoke('open_browser', { url: hrefUrl.href });
109
+ if (e.buttons === 1 && e.detail !== 2) {
110
+ invoke('drag_window');
111
+ }
112
+ });
113
+
114
+ domEl.addEventListener('touchstart', () => {
115
+ invoke('drag_window');
116
+ });
117
+
118
+ domEl.addEventListener('dblclick', () => {
119
+ invoke('fullscreen');
120
+ });
121
+
122
+ document.addEventListener('keyup', (event) => {
123
+ if (/windows|linux/i.test(navigator.userAgent) && event.ctrlKey) {
124
+ handleShortcut(event);
125
+ }
126
+ if (/macintosh|mac os x/i.test(navigator.userAgent) && event.metaKey) {
127
+ handleShortcut(event);
128
+ }
129
+ });
130
+
131
+ // Prevent some special websites from executing in advance, before the click event is triggered.
132
+ document.addEventListener('mousedown', (e) => {
133
+ const anchorElement = e.target.closest('a');
134
+
135
+ if (anchorElement && anchorElement.href) {
136
+ const target = anchorElement.target;
137
+ anchorElement.target = '_self';
138
+ const hrefUrl = new URL(anchorElement.href);
139
+ const absoluteUrl = hrefUrl.href;
140
+
141
+ // Handling external link redirection.
142
+ if (
143
+ window.location.host !== hrefUrl.host &&
144
+ (target === '_blank' || target === '_new')
145
+ ) {
146
+ e.preventDefault();
147
+ invoke('open_browser', {url: absoluteUrl});
148
+ return;
149
+ }
150
+
151
+ let filename = anchorElement.download ? anchorElement.download : getFilenameFromUrl(absoluteUrl)
152
+ // Process download links for Rust to handle.
153
+ // If the download attribute is set, the download attribute is used as the file name.
154
+ if ((anchorElement.download || e.metaKey || e.ctrlKey || isDownloadLink(absoluteUrl))
155
+ && !externalDownLoadLink()
156
+ ) {
157
+ e.preventDefault();
158
+ invoke('download_file', {
159
+ params: {
160
+ url: absoluteUrl,
161
+ filename,
162
+ },
163
+ });
164
+ }
165
+ }
166
+ });
167
+
168
+ // Rewrite the window.open function.
169
+ const originalWindowOpen = window.open;
170
+ window.open = function (url, name, specs) {
171
+ // Apple login and google login
172
+ if (name === 'AppleAuthentication') {
173
+ //do nothing
174
+ } else if (specs.includes('height=') || specs.includes('width=')) {
175
+ location.href = url;
176
+ } else {
177
+ const baseUrl = window.location.origin + window.location.pathname;
178
+ const hrefUrl = new URL(url, baseUrl);
179
+ invoke('open_browser', {url: hrefUrl.href});
180
+ }
181
+ // Call the original window.open function to maintain its normal functionality.
182
+ return originalWindowOpen.call(window, url, name, specs);
183
+ };
184
+
185
+ // Set the default zoom, There are problems with Loop without using try-catch.
186
+ try {
187
+ setDefaultZoom();
188
+ } catch (e) {
189
+ console.log(e);
156
190
  }
157
- // Call the original window.open function to maintain its normal functionality.
158
- return originalWindowOpen.call(window, url, name, specs);
159
- };
160
-
161
- // Set the default zoom, There are problems with Loop without using try-catch.
162
- try {
163
- setDefaultZoom();
164
- } catch (e) {
165
- console.log(e);
166
- }
167
191
  });
168
192
 
169
193
  function setDefaultZoom() {
170
- const htmlZoom = window.localStorage.getItem('htmlZoom');
171
- if (htmlZoom) {
172
- setZoom(htmlZoom);
173
- }
194
+ const htmlZoom = window.localStorage.getItem('htmlZoom');
195
+ if (htmlZoom) {
196
+ setZoom(htmlZoom);
197
+ }
174
198
  }
175
199
 
176
200
  function getFilenameFromUrl(url) {
177
- const urlPath = new URL(url).pathname;
178
- const filename = urlPath.substring(urlPath.lastIndexOf('/') + 1);
179
- return filename;
201
+ const urlPath = new URL(url).pathname;
202
+ const filename = urlPath.substring(urlPath.lastIndexOf('/') + 1);
203
+ return filename;
180
204
  }
181
205
 
182
206
  function removeUrlParameters(url) {
183
- const parsedUrl = new URL(url);
184
- parsedUrl.search = '';
185
- return parsedUrl.toString();
207
+ const parsedUrl = new URL(url);
208
+ parsedUrl.search = '';
209
+ return parsedUrl.toString();
186
210
  }
187
211
 
188
- // No need to go to the download link.
189
- function externalDownLoadLink() {
190
- return ['quickref.me'].indexOf(location.hostname) > -1;
191
- }
192
212
 
193
213
  // Toggle video playback when the window is hidden.
194
214
  function toggleVideoPlayback(pause) {
195
- const videos = document.getElementsByTagName('video');
196
- for (const video of videos) {
197
- if (pause) {
198
- video.pause();
199
- } else {
200
- video.play();
215
+ const videos = document.getElementsByTagName('video');
216
+ for (const video of videos) {
217
+ if (pause) {
218
+ video.pause();
219
+ } else {
220
+ video.play();
221
+ }
201
222
  }
202
- }
203
223
  }
204
224
 
@@ -57,6 +57,11 @@ window.addEventListener('DOMContentLoaded', (_event) => {
57
57
  min-width: 260px;
58
58
  }
59
59
 
60
+ #__next > div.overflow-hidden.w-full.h-full.relative.flex.z-0 > div.relative.flex.h-full.max-w-full.flex-1.overflow-hidden > div > main > div.absolute.left-2.top-2.z-10.hidden.md\\:inline-block{
61
+ margin-top:20px;
62
+ margin-left: 10px;
63
+ }
64
+
60
65
  .chakra-ui-light #app .chakra-heading,
61
66
  .chakra-ui-dark #app .chakra-heading,
62
67
  .chakra-ui-light #app .chakra-stack,
@@ -71,18 +76,32 @@ window.addEventListener('DOMContentLoaded', (_event) => {
71
76
  display: none;
72
77
  }
73
78
 
74
- #__next .overflow-hidden>.hidden.bg-gray-900 .scrollbar-trigger{
75
- padding-top: 20px;
79
+ #__next .overflow-hidden>.overflow-x-hidden .scrollbar-trigger > nav {
80
+ padding-top: 30px;
76
81
  }
77
82
 
78
83
  #__next .absolute .px-3.pt-2.pb-3.text-center {
79
84
  visibility: hidden;
85
+ padding-bottom: 4px;
80
86
  }
81
87
 
82
88
  #__next > div.overflow-hidden.w-full.h-full.relative.flex > div.dark.hidden.flex-shrink-0.bg-gray-900.md\\:flex.md\\:w-\\[260px\\].md\\:flex-col > div > div > nav {
83
89
  width: 100%;
84
90
  }
85
91
 
92
+ #tabs-sidebar--tabpanel-0 > div.tw-flex.tw-items-center.tw-mb-\\[12px\\].tw-mt-\\[14px\\].tw-px-4 {
93
+ padding-top: 15px;
94
+ }
95
+
96
+ #tabs-sidebar--tabpanel-1 > div > div.tw-p-\\[16px\\].tw-flex.tw-flex-col.tw-gap-1\\.5{
97
+ padding-top: 30px;
98
+ }
99
+
100
+ #tabs-sidebar--tabpanel-2 > div > h2 {
101
+ padding-top: 20px;
102
+ height: 70px;
103
+ }
104
+
86
105
  .lark > .dashboard-sidebar, .lark > .dashboard-sidebar > .sidebar-user-info , .lark > .dashboard-sidebar .index-module_wrapper_F-Wbq{
87
106
  padding-top:15px;
88
107
  }
@@ -134,10 +153,12 @@ window.addEventListener('DOMContentLoaded', (_event) => {
134
153
  margin-top:24px;
135
154
  }
136
155
 
156
+
137
157
  #react-root [data-testid="placementTracking"] article,
138
158
  #react-root a[href*="quick_promote_web"],
139
159
  #react-root [data-testid="AppTabBar_Explore_Link"],
140
160
  #react-root a[href*="/lists"][role="link"][aria-label],
161
+ #react-root a[href*="/i/communitynotes"][role="link"][aria-label],
141
162
  #react-root a[href*="/i/verified-orgs-signup"][role="link"][aria-label] {
142
163
  display: none !important;
143
164
  }
@@ -294,9 +315,9 @@ window.addEventListener('DOMContentLoaded', (_event) => {
294
315
  }
295
316
  }
296
317
 
297
- @media (min-width:640px){
298
- #__next .sticky.top-0{
299
- padding-top: 15px;
318
+ @media (max-width:767px){
319
+ #__next .overflow-hidden.w-full .max-w-full>.sticky.top-0 {
320
+ padding-top: 20px;
300
321
  }
301
322
  }
302
323