pake-cli 0.0.4 → 0.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 +34 -30
- package/dist/cli.js +1 -1
- package/package.json +2 -2
- package/pake-default.icns +0 -0
- package/src-tauri/Cargo.lock +412 -409
- package/src-tauri/Cargo.toml +6 -10
- package/src-tauri/icons/icon.icns +0 -0
- package/src-tauri/src/main.rs +42 -3
- package/src-tauri/src/pake.js +155 -1
- package/src-tauri/tauri.conf.json +2 -2
- package/dist/twitter.css +0 -176
package/src-tauri/Cargo.toml
CHANGED
|
@@ -12,27 +12,23 @@ rust-version = "1.61.0"
|
|
|
12
12
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
13
13
|
|
|
14
14
|
[build-dependencies]
|
|
15
|
-
tauri-build = { version = "1.2.
|
|
16
|
-
|
|
15
|
+
tauri-build = { version = "1.2.1", features = [] }
|
|
17
16
|
|
|
18
17
|
[dependencies]
|
|
19
18
|
serde_json = "1.0.88"
|
|
20
19
|
serde = { version = "1.0.147", features = ["derive"] }
|
|
21
|
-
tauri = { version = "1.2.
|
|
20
|
+
tauri = { version = "1.2.1", features = ["api-all"] }
|
|
22
21
|
image = "0.24.5"
|
|
23
|
-
tauri-utils = "1.2.
|
|
22
|
+
tauri-utils = "1.2.1"
|
|
24
23
|
webbrowser = "0.8.2"
|
|
25
|
-
|
|
26
|
-
[dependencies.wry]
|
|
27
|
-
git = "https://github.com/tauri-apps/wry.git"
|
|
28
|
-
rev = "7c6d64acea4414f7c960b38b80ea9ec3628db2a8"
|
|
24
|
+
wry = "0.22.5"
|
|
29
25
|
|
|
30
26
|
[features]
|
|
31
27
|
# by default Tauri runs in production mode
|
|
32
28
|
# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL
|
|
33
|
-
default = [
|
|
29
|
+
default = ["custom-protocol"]
|
|
34
30
|
# this feature is used used for production builds where `devPath` points to the filesystem
|
|
35
31
|
# DO NOT remove this
|
|
36
|
-
custom-protocol = [
|
|
32
|
+
custom-protocol = ["tauri/custom-protocol"]
|
|
37
33
|
# Enable DevTools for debugging.
|
|
38
34
|
devtools = []
|
|
Binary file
|
package/src-tauri/src/main.rs
CHANGED
|
@@ -37,7 +37,7 @@ use wry::{
|
|
|
37
37
|
menu::MenuType,
|
|
38
38
|
window::{Fullscreen, Window, WindowBuilder},
|
|
39
39
|
},
|
|
40
|
-
webview::WebViewBuilder,
|
|
40
|
+
webview::{WebContext, WebViewBuilder},
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
fn main() -> wry::Result<()> {
|
|
@@ -110,6 +110,7 @@ fn main() -> wry::Result<()> {
|
|
|
110
110
|
let event_loop = EventLoop::new();
|
|
111
111
|
|
|
112
112
|
let common_window = WindowBuilder::new()
|
|
113
|
+
.with_title("")
|
|
113
114
|
.with_resizable(resizable)
|
|
114
115
|
.with_fullscreen(if fullscreen {
|
|
115
116
|
Some(Fullscreen::Borderless(None))
|
|
@@ -123,13 +124,12 @@ fn main() -> wry::Result<()> {
|
|
|
123
124
|
#[cfg(target_os = "windows")]
|
|
124
125
|
let window = common_window
|
|
125
126
|
.with_decorations(true)
|
|
126
|
-
.with_title("")
|
|
127
127
|
.with_window_icon(Some(icon))
|
|
128
128
|
.build(&event_loop)
|
|
129
129
|
.unwrap();
|
|
130
130
|
|
|
131
131
|
#[cfg(target_os = "linux")]
|
|
132
|
-
let window = common_window.
|
|
132
|
+
let window = common_window.build(&event_loop).unwrap();
|
|
133
133
|
|
|
134
134
|
#[cfg(target_os = "macos")]
|
|
135
135
|
let window = common_window
|
|
@@ -156,11 +156,50 @@ fn main() -> wry::Result<()> {
|
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
158
|
|
|
159
|
+
// 用于欺骗部分页面对于浏览器的强检测
|
|
160
|
+
let user_agent_string = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15";
|
|
161
|
+
|
|
162
|
+
#[cfg(target_os = "macos")]
|
|
163
|
+
let webview = WebViewBuilder::new(window)?
|
|
164
|
+
.with_user_agent(user_agent_string)
|
|
165
|
+
.with_accept_first_mouse(true)
|
|
166
|
+
.with_url(&url.to_string())?
|
|
167
|
+
.with_devtools(cfg!(feature = "devtools"))
|
|
168
|
+
.with_initialization_script(include_str!("pake.js"))
|
|
169
|
+
.with_ipc_handler(handler)
|
|
170
|
+
.with_back_forward_navigation_gestures(true)
|
|
171
|
+
.build()?;
|
|
172
|
+
|
|
173
|
+
#[cfg(target_os = "windows")]
|
|
174
|
+
let webview = WebViewBuilder::new(window)?
|
|
175
|
+
.with_user_agent(user_agent_string)
|
|
176
|
+
.with_accept_first_mouse(true)
|
|
177
|
+
.with_url(&url.to_string())?
|
|
178
|
+
.with_devtools(cfg!(feature = "devtools"))
|
|
179
|
+
.with_initialization_script(include_str!("pake.js"))
|
|
180
|
+
.with_ipc_handler(handler)
|
|
181
|
+
.with_back_forward_navigation_gestures(true)
|
|
182
|
+
.build()?;
|
|
183
|
+
// 自定义cookie文件夹,仅用于Linux
|
|
184
|
+
// Custom Cookie folder, only for Linux
|
|
185
|
+
#[cfg(target_os = "linux")]
|
|
186
|
+
let data_path =
|
|
187
|
+
std::path::PathBuf::from(concat!("/home/", env!("USER"), "/.config/com-tw93-weread/"));
|
|
188
|
+
#[cfg(target_os = "linux")]
|
|
189
|
+
if !std::path::Path::new(&data_path).exists() {
|
|
190
|
+
std::fs::create_dir(&data_path)?;
|
|
191
|
+
}
|
|
192
|
+
#[cfg(target_os = "linux")]
|
|
193
|
+
let mut web_content = WebContext::new(Some(data_path));
|
|
194
|
+
#[cfg(target_os = "linux")]
|
|
159
195
|
let webview = WebViewBuilder::new(window)?
|
|
196
|
+
.with_user_agent(user_agent_string)
|
|
197
|
+
.with_accept_first_mouse(true)
|
|
160
198
|
.with_url(&url.to_string())?
|
|
161
199
|
.with_devtools(cfg!(feature = "devtools"))
|
|
162
200
|
.with_initialization_script(include_str!("pake.js"))
|
|
163
201
|
.with_ipc_handler(handler)
|
|
202
|
+
.with_web_context(&mut web_content)
|
|
164
203
|
.with_back_forward_navigation_gestures(true)
|
|
165
204
|
.build()?;
|
|
166
205
|
|
package/src-tauri/src/pake.js
CHANGED
|
@@ -51,7 +51,7 @@ window.addEventListener("DOMContentLoaded", (_event) => {
|
|
|
51
51
|
display: none !important;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
#page .main_header {
|
|
54
|
+
#page .main_header, .cb-layout-basic--navbar{
|
|
55
55
|
padding-top: 20px;
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -92,6 +92,160 @@ window.addEventListener("DOMContentLoaded", (_event) => {
|
|
|
92
92
|
margin-top:24px;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
[data-testid="placementTracking"] article,
|
|
96
|
+
a[href*="quick_promote_web"],
|
|
97
|
+
[data-testid="AppTabBar_Explore_Link"],
|
|
98
|
+
a[href*="/lists"][role="link"][aria-label],
|
|
99
|
+
a[href="/i/bookmarks"] {
|
|
100
|
+
display: none !important;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
[data-testid="DMDrawer"] {
|
|
104
|
+
visibility: hidden !important;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
[data-testid="primaryColumn"] > div > div {
|
|
108
|
+
position: relative !important;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
[data-testid="sidebarColumn"] {
|
|
112
|
+
visibility: hidden !important;
|
|
113
|
+
width: 0 !important;
|
|
114
|
+
margin: 0 !important;
|
|
115
|
+
padding: 0 !important;
|
|
116
|
+
z-index: 1 !important;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@media only screen and (min-width: 1000px) {
|
|
120
|
+
main[role="main"] {
|
|
121
|
+
align-items: center !important;
|
|
122
|
+
overflow-x: clip !important;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
[data-testid="primaryColumn"] {
|
|
126
|
+
width: 700px !important;
|
|
127
|
+
max-width: 700px !important;
|
|
128
|
+
margin: 0 auto !important;
|
|
129
|
+
}
|
|
130
|
+
[data-testid="primaryColumn"] > div > div:last-child,
|
|
131
|
+
[data-testid="primaryColumn"] > div > div:last-child div {
|
|
132
|
+
max-width: unset !important;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
div[aria-label][role="group"][id^="id__"] {
|
|
136
|
+
margin-right: 81px !important;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
header[role="banner"] {
|
|
140
|
+
position: fixed !important;
|
|
141
|
+
left: 0 !important;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
header[role="banner"] > div > div > div {
|
|
145
|
+
justify-content: center !important;
|
|
146
|
+
padding-top: 0;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
form[role="search"] > div:nth-child(1) > div {
|
|
150
|
+
background-color: transparent !important;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
h1[role="heading"] {
|
|
154
|
+
padding-top: 4px !important;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
header[role="banner"]
|
|
158
|
+
nav[role="navigation"]
|
|
159
|
+
*
|
|
160
|
+
div[dir="auto"]:not([aria-label])
|
|
161
|
+
> span,
|
|
162
|
+
[data-testid="SideNav_AccountSwitcher_Button"] > div:not(:first-child) {
|
|
163
|
+
display: inline-block !important;
|
|
164
|
+
opacity: 0 !important;
|
|
165
|
+
transition: 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
166
|
+
}
|
|
167
|
+
header[role="banner"]
|
|
168
|
+
nav[role="navigation"]:hover
|
|
169
|
+
*
|
|
170
|
+
div[dir="auto"]:not([aria-label])
|
|
171
|
+
> span,
|
|
172
|
+
[data-testid="SideNav_AccountSwitcher_Button"]:hover > div:not(:first-child) {
|
|
173
|
+
opacity: 1 !important;
|
|
174
|
+
}
|
|
175
|
+
header[role="banner"] nav[role="navigation"]:hover > * > div {
|
|
176
|
+
backdrop-filter: blur(12px) !important;
|
|
177
|
+
}
|
|
178
|
+
header[role="banner"] nav[role="navigation"] > a {
|
|
179
|
+
position: relative;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
header[role="banner"] nav[role="navigation"] > a::before {
|
|
183
|
+
content: "";
|
|
184
|
+
position: absolute;
|
|
185
|
+
top: 0px;
|
|
186
|
+
right: -40px;
|
|
187
|
+
bottom: 0px;
|
|
188
|
+
left: 0px;
|
|
189
|
+
}
|
|
190
|
+
[data-testid="SideNav_AccountSwitcher_Button"] {
|
|
191
|
+
bottom: 18px !important;
|
|
192
|
+
left: 1px !important;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
[data-testid="SideNav_NewTweet_Button"] {
|
|
196
|
+
position: fixed !important;
|
|
197
|
+
right: 16px !important;
|
|
198
|
+
bottom: 24px !important;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
@media only screen and (min-width: 1000px) and (max-width: 1265px) {
|
|
203
|
+
body {
|
|
204
|
+
padding-left: 88px;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@media only screen and (min-width: 1265px) {
|
|
209
|
+
[data-testid="sidebarColumn"] form[role="search"] {
|
|
210
|
+
visibility: visible !important;
|
|
211
|
+
position: fixed !important;
|
|
212
|
+
top: 12px !important;
|
|
213
|
+
right: 16px !important;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
[data-testid="sidebarColumn"] input[placeholder="Search Twitter"] {
|
|
217
|
+
width: 150px;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
[data-testid="sidebarColumn"] form[role="search"]:focus-within {
|
|
221
|
+
width: 374px !important;
|
|
222
|
+
backdrop-filter: blur(12px) !important;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
[data-testid="sidebarColumn"] input[placeholder="Search Twitter"]:focus {
|
|
226
|
+
width: 328px !important;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
div[style*="left: -12px"] {
|
|
230
|
+
left: unset !important;
|
|
231
|
+
}
|
|
232
|
+
div[style="left: -8px; width: 306px;"] {
|
|
233
|
+
left: unset !important;
|
|
234
|
+
width: 374px !important;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.searchFilters {
|
|
238
|
+
visibility: visible !important;
|
|
239
|
+
position: fixed;
|
|
240
|
+
top: 12px;
|
|
241
|
+
right: 16px;
|
|
242
|
+
width: 240px;
|
|
243
|
+
}
|
|
244
|
+
.searchFilters > div > div:first-child {
|
|
245
|
+
display: none;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
95
249
|
#pack-top-dom:active {
|
|
96
250
|
cursor: grabbing;
|
|
97
251
|
cursor: -webkit-grabbing;
|
package/dist/twitter.css
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
[data-testid="placementTracking"] article,
|
|
2
|
-
a[href*="quick_promote_web"],
|
|
3
|
-
[data-testid="AppTabBar_Explore_Link"],
|
|
4
|
-
a[href*="/lists"][role="link"][aria-label],
|
|
5
|
-
a[href="/i/bookmarks"] {
|
|
6
|
-
display: none !important;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/* Hide Messages Drawer */
|
|
10
|
-
[data-testid="DMDrawer"] {
|
|
11
|
-
visibility: hidden !important;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
[data-testid="primaryColumn"] > div > div {
|
|
15
|
-
position: relative !important;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/* Hide sidebar */
|
|
19
|
-
[data-testid="sidebarColumn"] {
|
|
20
|
-
visibility: hidden !important;
|
|
21
|
-
width: 0 !important;
|
|
22
|
-
margin: 0 !important;
|
|
23
|
-
padding: 0 !important;
|
|
24
|
-
z-index: 1 !important;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/* Twitter has a large screen breakpoint at 1000px */
|
|
28
|
-
/* Twitter web's small screen styles (< 988px) are minimal */
|
|
29
|
-
@media only screen and (min-width: 1000px) {
|
|
30
|
-
/* Center the Timeline */
|
|
31
|
-
/* Prevent horizontal scroll */
|
|
32
|
-
main[role="main"] {
|
|
33
|
-
align-items: center !important;
|
|
34
|
-
overflow-x: clip !important;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/* Match widths for feed */
|
|
38
|
-
[data-testid="primaryColumn"] {
|
|
39
|
-
width: 700px !important;
|
|
40
|
-
max-width: 700px !important;
|
|
41
|
-
margin: 0 auto !important;
|
|
42
|
-
}
|
|
43
|
-
[data-testid="primaryColumn"] > div > div:last-child,
|
|
44
|
-
[data-testid="primaryColumn"] > div > div:last-child div {
|
|
45
|
-
max-width: unset !important;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* Nudge engagement row 81px right */
|
|
49
|
-
/* In default feed: 506px - 425px */
|
|
50
|
-
div[aria-label][role="group"][id^="id__"] {
|
|
51
|
-
margin-right: 81px !important;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/* Fix navigation to left */
|
|
55
|
-
header[role="banner"] {
|
|
56
|
-
position: fixed !important;
|
|
57
|
-
left: 0 !important;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
header[role="banner"] > div > div > div {
|
|
61
|
-
justify-content: center !important;
|
|
62
|
-
padding-top: 0;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
form[role="search"] > div:nth-child(1) > div {
|
|
66
|
-
background-color: transparent !important;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/* Align Twitter navigation icon with search */
|
|
70
|
-
h1[role="heading"] {
|
|
71
|
-
padding-top: 4px !important;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* Navigation buttons labels and Account button label on hover */
|
|
75
|
-
header[role="banner"]
|
|
76
|
-
nav[role="navigation"]
|
|
77
|
-
*
|
|
78
|
-
div[dir="auto"]:not([aria-label])
|
|
79
|
-
> span,
|
|
80
|
-
[data-testid="SideNav_AccountSwitcher_Button"] > div:not(:first-child) {
|
|
81
|
-
display: inline-block !important;
|
|
82
|
-
opacity: 0 !important;
|
|
83
|
-
transition: 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
84
|
-
}
|
|
85
|
-
header[role="banner"]
|
|
86
|
-
nav[role="navigation"]:hover
|
|
87
|
-
*
|
|
88
|
-
div[dir="auto"]:not([aria-label])
|
|
89
|
-
> span,
|
|
90
|
-
[data-testid="SideNav_AccountSwitcher_Button"]:hover > div:not(:first-child) {
|
|
91
|
-
opacity: 1 !important;
|
|
92
|
-
}
|
|
93
|
-
header[role="banner"] nav[role="navigation"]:hover > * > div {
|
|
94
|
-
backdrop-filter: blur(12px) !important;
|
|
95
|
-
}
|
|
96
|
-
header[role="banner"] nav[role="navigation"] > a {
|
|
97
|
-
position: relative;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
header[role="banner"] nav[role="navigation"] > a::before {
|
|
101
|
-
content: "";
|
|
102
|
-
position: absolute;
|
|
103
|
-
top: 0px;
|
|
104
|
-
right: -40px;
|
|
105
|
-
bottom: 0px;
|
|
106
|
-
left: 0px;
|
|
107
|
-
}
|
|
108
|
-
/* Align account button with floating tweet button */
|
|
109
|
-
[data-testid="SideNav_AccountSwitcher_Button"] {
|
|
110
|
-
bottom: 18px !important;
|
|
111
|
-
left: 1px !important;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/* Floating Tweet Button */
|
|
115
|
-
[data-testid="SideNav_NewTweet_Button"] {
|
|
116
|
-
position: fixed !important;
|
|
117
|
-
right: 16px !important;
|
|
118
|
-
bottom: 24px !important;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/* Add padding equal to navigation size when between 1000px-1265px */
|
|
123
|
-
@media only screen and (min-width: 1000px) and (max-width: 1265px) {
|
|
124
|
-
body {
|
|
125
|
-
padding-left: 88px;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/* Reveal searchbar and search filters at desktop breakpoint */
|
|
130
|
-
@media only screen and (min-width: 1265px) {
|
|
131
|
-
/* Reveal searchbar */
|
|
132
|
-
[data-testid="sidebarColumn"] form[role="search"] {
|
|
133
|
-
visibility: visible !important;
|
|
134
|
-
position: fixed !important;
|
|
135
|
-
top: 12px !important;
|
|
136
|
-
right: 16px !important;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/* Match size of input the placeholder content */
|
|
140
|
-
[data-testid="sidebarColumn"] input[placeholder="Search Twitter"] {
|
|
141
|
-
width: 150px;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/* Match size of focused search container to its dropdown */
|
|
145
|
-
/* Add blur filter to search container for overlap */
|
|
146
|
-
[data-testid="sidebarColumn"] form[role="search"]:focus-within {
|
|
147
|
-
width: 374px !important;
|
|
148
|
-
backdrop-filter: blur(12px) !important;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/* Match size of focused search input to its dropdown */
|
|
152
|
-
[data-testid="sidebarColumn"] input[placeholder="Search Twitter"]:focus {
|
|
153
|
-
width: 328px !important;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/* Reset width and left positioning to align search dropdown */
|
|
157
|
-
div[style*="left: -12px"] {
|
|
158
|
-
left: unset !important;
|
|
159
|
-
}
|
|
160
|
-
div[style="left: -8px; width: 306px;"] {
|
|
161
|
-
left: unset !important;
|
|
162
|
-
width: 374px !important;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/* Search Filters Custom Class */
|
|
166
|
-
.searchFilters {
|
|
167
|
-
visibility: visible !important;
|
|
168
|
-
position: fixed;
|
|
169
|
-
top: 12px;
|
|
170
|
-
right: 16px;
|
|
171
|
-
width: 240px;
|
|
172
|
-
}
|
|
173
|
-
.searchFilters > div > div:first-child {
|
|
174
|
-
display: none;
|
|
175
|
-
}
|
|
176
|
-
}
|