Skip to content

Commit c3a027e

Browse files
committed
switch to using chrome.storage.local and working import tab from bookmarks and history
1 parent 11e3415 commit c3a027e

File tree

6 files changed

+377
-101
lines changed

6 files changed

+377
-101
lines changed

redesign/background.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ chrome.action.onClicked.addListener(async (tab) => {
1919
};
2020

2121
// Save the entry first
22-
const { entries = [] } = await chrome.storage.sync.get('entries');
22+
const { entries = [] } = await chrome.storage.local.get('entries');
2323
entries.push(entry);
24-
await chrome.storage.sync.set({ entries });
24+
await chrome.storage.local.set({ entries });
2525

2626
// Inject scripts - CSS now handled in popup.js
2727
await chrome.scripting.executeScript({

redesign/manifest.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"storage",
88
"scripting",
99
"tabs",
10-
"activeTab"
10+
"activeTab",
11+
"history",
12+
"bookmarks"
1113
],
1214
"host_permissions": [
1315
"<all_urls>"

redesign/options.html

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@
107107
<li class="nav-item">
108108
<a class="nav-link" id="personas-tab" data-bs-toggle="tab" href="#personas" role="tab">Personas</a>
109109
</li>
110+
<li class="nav-item">
111+
<a class="nav-link" id="import-tab" data-bs-toggle="tab" href="#import" role="tab">Import</a>
112+
</li>
110113
</ul>
111114

112115
<div class="tab-content">
@@ -229,6 +232,90 @@ <h2>All Tags</h2>
229232
</div>
230233
</div>
231234
</div>
235+
236+
<!-- Import Tab -->
237+
<div class="tab-pane fade" id="import" role="tabpanel">
238+
<div class="row mt-4">
239+
<div class="col-md-12">
240+
<ul class="nav nav-pills mb-4" role="tablist">
241+
<li class="nav-item">
242+
<a class="nav-link active" id="history-tab" data-bs-toggle="pill" href="#history" role="tab">Chrome History</a>
243+
</li>
244+
<li class="nav-item">
245+
<a class="nav-link" id="bookmarks-tab" data-bs-toggle="pill" href="#bookmarks" role="tab">Chrome Bookmarks</a>
246+
</li>
247+
</ul>
248+
249+
<div class="tab-content">
250+
<!-- History Import -->
251+
<div class="tab-pane fade show active" id="history" role="tabpanel">
252+
<div class="row mb-4">
253+
<div class="col-md-6">
254+
<div class="input-group">
255+
<span class="input-group-text">From</span>
256+
<input type="date" class="form-control" id="historyStartDate">
257+
<span class="input-group-text">To</span>
258+
<input type="date" class="form-control" id="historyEndDate">
259+
<button class="btn btn-primary" id="loadHistory">Load History</button>
260+
</div>
261+
</div>
262+
</div>
263+
</div>
264+
265+
<!-- Bookmarks Import -->
266+
<div class="tab-pane fade" id="bookmarks" role="tabpanel">
267+
<div class="row mb-4">
268+
<div class="col-md-6">
269+
<button class="btn btn-primary" id="loadBookmarks">Load Bookmarks</button>
270+
</div>
271+
</div>
272+
</div>
273+
</div>
274+
275+
<!-- Common Import UI -->
276+
<div class="card">
277+
<div class="card-body">
278+
<div class="d-flex justify-content-between align-items-center mb-3">
279+
<div class="input-group" style="max-width: 400px;">
280+
<input type="search" class="form-control" id="importFilter" placeholder="Filter URLs and titles...">
281+
<div class="input-group-text">
282+
<input class="form-check-input mt-0" type="checkbox" id="showNewOnly">
283+
<label class="form-check-label ms-2" for="showNewOnly">Show new only</label>
284+
</div>
285+
</div>
286+
<div>
287+
<span class="me-3">Selected: <span id="selectedCount">0</span></span>
288+
<button class="btn btn-outline-secondary" id="selectAll">Select All</button>
289+
<button class="btn btn-outline-secondary" id="deselectAll">Deselect All</button>
290+
</div>
291+
</div>
292+
293+
<div class="table-responsive">
294+
<table class="table" id="importTable">
295+
<thead>
296+
<tr>
297+
<th style="width: 40px;"><input type="checkbox" id="selectAllHeader"></th>
298+
<th>URL</th>
299+
<th>Title</th>
300+
<th>Timestamp</th>
301+
</tr>
302+
</thead>
303+
<tbody></tbody>
304+
</table>
305+
</div>
306+
307+
<div class="mt-3">
308+
<div class="input-group" style="max-width: 400px;">
309+
<span class="input-group-text">Tags</span>
310+
<input type="text" class="form-control" id="importTags" placeholder="Add tags (comma separated)">
311+
<button class="btn btn-primary" id="importSelected">Import Selected</button>
312+
</div>
313+
</div>
314+
</div>
315+
</div>
316+
</div>
317+
</div>
318+
</div>
232319
</div>
233320

234321
<script src="bootstrap.bundle.min.js"></script>

0 commit comments

Comments
 (0)