Skip to content

Commit 05fb8d5

Browse files
committed
fix icons
1 parent 02f3565 commit 05fb8d5

25 files changed

+55
-6
lines changed

.gitignore

100644100755
File mode changed.

128.png

-896 Bytes
Loading

16.png

-2.54 KB
Loading

32.png

-2.14 KB
Loading

48.png

-2.3 KB
Loading

LICENSE

100644100755
File mode changed.

README.md

100644100755
File mode changed.

background.js

100644100755
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,35 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
3838
}
3939
return true;
4040
});
41+
42+
43+
chrome.contextMenus.onClicked.addListener(onClickContextMenuSave);
44+
45+
// A generic onclick callback function.
46+
async function onClickContextMenuSave(item, tab) {
47+
const entry = {
48+
id: crypto.randomUUID(),
49+
url: tab.url,
50+
timestamp: new Date().toISOString(),
51+
tags: [],
52+
title: tab.title,
53+
favicon: tab.favIconUrl
54+
};
55+
56+
// Save the entry first
57+
const { entries = [] } = await chrome.storage.local.get('entries');
58+
entries.push(entry);
59+
await chrome.storage.local.set({ entries });
60+
61+
// Inject scripts - CSS now handled in popup.js
62+
await chrome.scripting.executeScript({
63+
target: { tabId: tab.id },
64+
files: ['popup.js']
65+
});
66+
}
67+
chrome.runtime.onInstalled.addListener(function () {
68+
chrome.contextMenus.create({
69+
id: 'save_to_archivebox_ctxmenu',
70+
title: 'Save to ArchiveBox',
71+
});
72+
});

bootstrap-icons.css

100644100755
File mode changed.

bootstrap.bundle.min.js

100644100755
File mode changed.

bootstrap.min.css

100644100755
File mode changed.

config-tab.js

100644100755
File mode changed.

cookies-tab.js

100644100755
File mode changed.

entries-tab.js

100644100755
File mode changed.

fonts/bootstrap-icons.woff

100644100755
File mode changed.

fonts/bootstrap-icons.woff2

100644100755
File mode changed.

import-tab.js

100644100755
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ export async function initializeImport() {
2727
}
2828

2929
async function loadHistory() {
30+
// request permission to access history
31+
const permission = await chrome.permissions.request({permissions: ['history']});
32+
if (!permission) {
33+
alert('Permission denied.');
34+
return;
35+
}
36+
3037
const startDate = new Date(document.getElementById('historyStartDate').value);
3138
const endDate = new Date(document.getElementById('historyEndDate').value);
3239
endDate.setHours(23, 59, 59, 999);
@@ -56,6 +63,13 @@ async function loadHistory() {
5663
}
5764

5865
async function loadBookmarks() {
66+
// request permission to access bookmarks
67+
const permission = await chrome.permissions.request({permissions: ['bookmarks']});
68+
if (!permission) {
69+
alert('Permission denied.');
70+
return;
71+
}
72+
5973
function processBookmarkTree(nodes) {
6074
let items = [];
6175
for (const node of nodes) {

manifest.json

100644100755
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
"description": "Collect URLs and preserve them using a remote ArchiveBox server",
66
"permissions": [
77
"storage",
8-
"unlimitedStorage",
98
"scripting",
109
"activeTab",
11-
"history",
12-
"bookmarks",
13-
"cookies",
1410
"contextMenus"
1511
],
12+
"optional_permissions": [
13+
"unlimitedStorage",
14+
"cookies",
15+
"history",
16+
"bookmarks"
17+
],
1618
"optional_host_permissions": [
1719
"*://*\/*"
1820
],

options.html

100644100755
File mode changed.

options.js

100644100755
File mode changed.

package-lock.json

100644100755
File mode changed.

package.json

100644100755
File mode changed.

personas-tab.js

100644100755
File mode changed.

popup.js

100644100755
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ window.updateCurrentTags = async function() {
137137
}
138138
});
139139
});
140-
140+
141141
sendToArchiveBox(current_entry.url, current_entry.tags);
142142
}
143143

@@ -165,7 +165,8 @@ window.createPopup = async function() {
165165
boxSizing: 'border-box',
166166
width: '550px', // Initial width
167167
height: '200px', // Initial height
168-
transition: 'height 0.2s ease-out' // Smooth height transitions
168+
transition: 'height 0.2s ease-out', // Smooth height transitions
169+
display: 'block',
169170
});
170171

171172
document.body.appendChild(iframe);

utils.js

100644100755
File mode changed.

0 commit comments

Comments
 (0)