@hraness/sponge 0.6.7 → 0.6.9
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 +42 -0
- package/dist/capture/worker.js +154 -152
- package/dist/contracts/index.d.ts +2 -0
- package/dist/src/acquisition/capture.d.ts +4 -0
- package/dist/src/acquisition/capture.js +8 -2
- package/dist/src/acquisition/child-request.d.ts +5 -0
- package/dist/src/acquisition/normalize.js +3 -0
- package/dist/src/app/archive.d.ts +15 -0
- package/dist/src/app/archive.js +51 -0
- package/dist/src/app/article.d.ts +4 -0
- package/dist/src/app/article.js +24 -10
- package/dist/src/app/markdown.d.ts +2 -0
- package/dist/src/app/markdown.js +6 -0
- package/dist/src/browser/bridge.d.ts +48 -0
- package/dist/src/browser/bridge.js +90 -0
- package/dist/src/browser/host.d.ts +10 -0
- package/dist/src/browser/host.js +147 -0
- package/dist/src/browser/setup.d.ts +26 -0
- package/dist/src/browser/setup.js +103 -0
- package/dist/src/capture/network.d.ts +56 -0
- package/dist/src/capture/network.js +453 -0
- package/dist/src/capture/types.d.ts +26 -0
- package/dist/src/capture/types.js +1 -0
- package/dist/src/cli/commands.js +114 -12
- package/dist/src/cli/status.d.ts +7 -0
- package/dist/src/cli/status.js +33 -0
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.js +2 -0
- package/dist/src/pdf/handler.d.ts +2 -0
- package/dist/src/pdf/handler.js +7 -2
- package/dist/src/store/queue.d.ts +5 -1
- package/dist/src/store/queue.js +10 -4
- package/dist/src/store/types.d.ts +5 -1
- package/dist/src/worker/basic.js +15 -0
- package/extension/background.js +180 -0
- package/extension/manifest.json +25 -0
- package/extension/popup.html +85 -0
- package/extension/popup.js +39 -0
- package/native/runtime-manifest.json +5 -5
- package/package.json +2 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 3,
|
|
3
|
+
"name": "Sponge",
|
|
4
|
+
"version": "0.6.9",
|
|
5
|
+
"description": "Save pages to your local Sponge library with the sign-ins you already have. Cookies never leave the browser.",
|
|
6
|
+
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoSbZrBglr0h0193XOgavySnrG0DQif+WgYJ37CFSrbBwWP43rUz2ZzGRPvNveHgFZvFZlhGITJD0VC4NMQa2kxGAPP66RWEulIZDvGauxKonwcrlSneD+srPY8oMNX5sivTqw819uMwDA70oxBxKyTX4t4vwpwXuFX3Zf+5jwUOD3nz8XZFGT9uDh86MHyYYlURzsZQYBJSf2qAN17+OfhV7NHCWM5FdQodnOau6N/PcH/MstVGnbOaWeaTGged0PS2QGA5NDoOu5WZv1sUTHFqzM/Wsb/h1l8Kt5IfOZAXvhokhBBW7HTyYqgvX4wFHuj5fNioYshBUfMrKeZZFlQIDAQAB",
|
|
7
|
+
"minimum_chrome_version": "116",
|
|
8
|
+
"background": {
|
|
9
|
+
"service_worker": "background.js"
|
|
10
|
+
},
|
|
11
|
+
"action": {
|
|
12
|
+
"default_title": "Sponge",
|
|
13
|
+
"default_popup": "popup.html"
|
|
14
|
+
},
|
|
15
|
+
"permissions": [
|
|
16
|
+
"nativeMessaging",
|
|
17
|
+
"scripting",
|
|
18
|
+
"tabs",
|
|
19
|
+
"storage",
|
|
20
|
+
"contextMenus"
|
|
21
|
+
],
|
|
22
|
+
"host_permissions": [
|
|
23
|
+
"<all_urls>"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>Sponge</title>
|
|
6
|
+
<style>
|
|
7
|
+
:root {
|
|
8
|
+
color-scheme: light dark;
|
|
9
|
+
--ink: #1d1d1f;
|
|
10
|
+
--muted: #6e6e73;
|
|
11
|
+
--paper: #ffffff;
|
|
12
|
+
--line: #d2d2d7;
|
|
13
|
+
--accent: #0a7c5a;
|
|
14
|
+
}
|
|
15
|
+
@media (prefers-color-scheme: dark) {
|
|
16
|
+
:root {
|
|
17
|
+
--ink: #f5f5f7;
|
|
18
|
+
--muted: #a1a1a6;
|
|
19
|
+
--paper: #1c1c1e;
|
|
20
|
+
--line: #3a3a3c;
|
|
21
|
+
--accent: #30c48d;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
body {
|
|
25
|
+
margin: 0;
|
|
26
|
+
width: 280px;
|
|
27
|
+
padding: 14px 16px;
|
|
28
|
+
font:
|
|
29
|
+
13px/1.4 -apple-system,
|
|
30
|
+
BlinkMacSystemFont,
|
|
31
|
+
'Helvetica Neue',
|
|
32
|
+
sans-serif;
|
|
33
|
+
color: var(--ink);
|
|
34
|
+
background: var(--paper);
|
|
35
|
+
}
|
|
36
|
+
h1 {
|
|
37
|
+
margin: 0 0 4px;
|
|
38
|
+
font-size: 15px;
|
|
39
|
+
}
|
|
40
|
+
#state {
|
|
41
|
+
margin: 0 0 12px;
|
|
42
|
+
color: var(--muted);
|
|
43
|
+
}
|
|
44
|
+
button {
|
|
45
|
+
width: 100%;
|
|
46
|
+
padding: 8px;
|
|
47
|
+
border: 0;
|
|
48
|
+
border-radius: 6px;
|
|
49
|
+
font: inherit;
|
|
50
|
+
font-weight: 600;
|
|
51
|
+
color: #fff;
|
|
52
|
+
background: var(--accent);
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
}
|
|
55
|
+
button:disabled {
|
|
56
|
+
opacity: 0.5;
|
|
57
|
+
cursor: default;
|
|
58
|
+
}
|
|
59
|
+
label {
|
|
60
|
+
display: flex;
|
|
61
|
+
gap: 8px;
|
|
62
|
+
align-items: flex-start;
|
|
63
|
+
margin-top: 12px;
|
|
64
|
+
padding-top: 12px;
|
|
65
|
+
border-top: 1px solid var(--line);
|
|
66
|
+
color: var(--muted);
|
|
67
|
+
}
|
|
68
|
+
#result {
|
|
69
|
+
min-height: 1.4em;
|
|
70
|
+
margin: 8px 0 0;
|
|
71
|
+
}
|
|
72
|
+
</style>
|
|
73
|
+
</head>
|
|
74
|
+
<body>
|
|
75
|
+
<h1>Sponge</h1>
|
|
76
|
+
<p id="state">Checking…</p>
|
|
77
|
+
<button id="save" disabled>Save this page</button>
|
|
78
|
+
<p id="result" role="status"></p>
|
|
79
|
+
<label
|
|
80
|
+
><input id="background" type="checkbox" /> Let Sponge load pages with this browser's sign-ins. Pages it loads stay
|
|
81
|
+
private in your library.</label
|
|
82
|
+
>
|
|
83
|
+
<script src="popup.js"></script>
|
|
84
|
+
</body>
|
|
85
|
+
</html>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const state = document.getElementById('state');
|
|
2
|
+
const save = document.getElementById('save');
|
|
3
|
+
const result = document.getElementById('result');
|
|
4
|
+
const background = document.getElementById('background');
|
|
5
|
+
const messages = {
|
|
6
|
+
offline: 'Sponge is not connected. Run `sponge browser setup`, then reopen this.',
|
|
7
|
+
unsupported: 'Sponge cannot save this kind of page.',
|
|
8
|
+
timeout: 'Sponge did not answer. Try again.',
|
|
9
|
+
failed: 'Sponge could not save this page.',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
async function refresh() {
|
|
13
|
+
const status = await chrome.runtime.sendMessage({ type: 'status' });
|
|
14
|
+
background.checked = status.background;
|
|
15
|
+
state.textContent = status.connected
|
|
16
|
+
? status.background
|
|
17
|
+
? 'Connected to your library.'
|
|
18
|
+
: 'Connected. Turn on browser captures below to save pages.'
|
|
19
|
+
: messages.offline;
|
|
20
|
+
const [tab] = await chrome.tabs.query({ active: true, currentWindow: true });
|
|
21
|
+
save.disabled = !status.connected || !status.background || !/^https?:/.test(tab?.url ?? '');
|
|
22
|
+
save.dataset.url = tab?.url ?? '';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
save.addEventListener('click', async () => {
|
|
26
|
+
save.disabled = true;
|
|
27
|
+
result.textContent = 'Saving…';
|
|
28
|
+
const answer = await chrome.runtime.sendMessage({ type: 'save', url: save.dataset.url });
|
|
29
|
+
result.textContent = answer.ok
|
|
30
|
+
? 'Saved. Sponge captures it with your sign-ins.'
|
|
31
|
+
: (messages[answer.code] ?? messages.failed);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
background.addEventListener('change', async () => {
|
|
35
|
+
await chrome.runtime.sendMessage({ type: 'set-background', value: background.checked });
|
|
36
|
+
await refresh();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
void refresh();
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
}
|
|
34
34
|
],
|
|
35
35
|
"build": {
|
|
36
|
-
"asrSourceSha256": "
|
|
36
|
+
"asrSourceSha256": "5e06ba5827fbcacd4386487956ad38650d48a61eccf1b36bdb5268186e50c8ae",
|
|
37
37
|
"clangVersion": "Apple clang version 21.0.0 (clang-2100.1.1.101)",
|
|
38
|
-
"embeddingSourceSha256": "
|
|
39
|
-
"mediaSourceSha256": "
|
|
38
|
+
"embeddingSourceSha256": "764fc13be205b1c8f176556200c7e82ba6b6c4c3e9ef389651fb5706bb330b0e",
|
|
39
|
+
"mediaSourceSha256": "4622e5b06c011886e4a686c582f2125c63dee7bd2ce45a98ece1306f3b3073f6",
|
|
40
40
|
"rustcVersion": "rustc 1.97.1 (8bab26f4f 2026-07-14)",
|
|
41
41
|
"swiftVersion": "Apple Swift version 6.3.3 (swiftlang-6.3.3.1.3 clang-2100.1.1.101)"
|
|
42
42
|
},
|
|
43
43
|
"minimumMacOS": "26.0",
|
|
44
|
-
"packageVersion": "0.6.
|
|
44
|
+
"packageVersion": "0.6.9",
|
|
45
45
|
"platform": "darwin",
|
|
46
46
|
"schemaVersion": 1,
|
|
47
|
-
"sourceCommit": "
|
|
47
|
+
"sourceCommit": "33fdabe6a2a48b455481ea8d1aeee3f2cb304caa"
|
|
48
48
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hraness/sponge",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.9",
|
|
4
4
|
"description": "A local library for captured articles and verified offline assets.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
15
|
"bin/",
|
|
16
|
+
"extension/",
|
|
16
17
|
"dist/capture/",
|
|
17
18
|
"dist/contracts/",
|
|
18
19
|
"dist/migrations/",
|