Skip to content

Commit 0b3688a

Browse files
authored
Add Copy Selected Links to Clipboard (#92)
* Update Context Menu * Add Copy Selected Links to Clipboard * Update Dependencies * Update Event Targets * Update README.md * Update Manifest Description * Fix Test for archive.org JS Errors
1 parent 4e2a20d commit 0b3688a

12 files changed

Lines changed: 155 additions & 92 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Website: https://link-extractor.cssnr.com/
2424
* [Install](#Install)
2525
* [Features](#Features)
2626
- [Upcoming Features](#Upcoming-Features)
27+
- [Known Issues](#Known-Issues)
2728
* [Configuration](#Configuration)
2829
* [Support](#Support)
2930
* [Development](#Development)
@@ -60,6 +61,7 @@ For any issues, bugs or concerns; please [Open an Issue](https://github.com/cssn
6061
* Extract Links from Selected Text on any Site
6162
* Extract Links from Clipboard or Any Text
6263
* Extract Links from All Selected Tabs
64+
* Copy Selected Links with right-click Menu
6365
* Display Additional Link Details and Text
6466
* Open Multiple Links in Tabs from Text
6567
* Download Links and Domains as a Text File
@@ -82,6 +84,11 @@ For any issues, bugs or concerns; please [Open an Issue](https://github.com/cssn
8284
> Request one on
8385
> the [Feature Request Discussion](https://github.com/cssnr/link-extractor/discussions/categories/feature-requests).
8486
87+
### Known Issues
88+
89+
* Attempting to extract links from multiple selected tabs without granting host permissions opens the options page and
90+
does not display any error message. If you encounter this, grant host permissions to the extension and try again.
91+
8592
## Configuration
8693

8794
- [View Configuration Documentation on Website](https://link-extractor.cssnr.com/docs/#configure)

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Link Extractor",
3-
"description": "Easily extract, parse, or open all links/domains from a site or text with optional filters.",
3+
"description": "Easily extract all links/domains from tabs/text with optional filters. Allows opening, copying, sorting, downloading, and more...",
44
"homepage_url": "https://link-extractor.cssnr.com/",
55
"author": "Shane",
66
"version": "0.0.1",

package-lock.json

Lines changed: 53 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
"bootstrap": "^5.3.3",
2222
"clipboard": "^2.0.11",
2323
"datatables.net": "^2.0.7",
24-
"datatables.net-bs5": "^2.1.0",
24+
"datatables.net-bs5": "^2.1.3",
2525
"datatables.net-buttons": "^3.0.2",
26-
"datatables.net-buttons-bs5": "^3.1.0",
26+
"datatables.net-buttons-bs5": "^3.1.1",
2727
"jquery": "^3.7.1"
2828
},
2929
"devDependencies": {
@@ -32,7 +32,7 @@
3232
"gulp": "^4.0.2",
3333
"json-merger": "^1.1.10",
3434
"prettier": "^3.3.3",
35-
"puppeteer": "^22.13.1",
35+
"puppeteer": "^22.15.0",
3636
"web-ext": "^8.2.0"
3737
}
3838
}

src/js/exports.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export async function saveOptions(event) {
101101
let value
102102
if (['flags', 'reset-default'].includes(event.target.id)) {
103103
key = 'flags'
104+
/** @type {HTMLInputElement} */
104105
const element = document.getElementById(key)
105106
let flags = element.value.toLowerCase().replace(/\s+/gm, '').split('')
106107
flags = new Set(flags)
@@ -175,7 +176,7 @@ export async function exportClick(event) {
175176
if (!data[name].length) {
176177
return showToast(`No ${display} Found!`, 'warning')
177178
}
178-
const json = JSON.stringify(data[name])
179+
const json = JSON.stringify(data[name], null, 2)
179180
textFileDownload(`${name}.txt`, json)
180181
}
181182

src/js/options.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ async function deleteFilter(event, index = undefined) {
159159
const { patterns } = await chrome.storage.sync.get(['patterns'])
160160
// console.debug('patterns:', patterns)
161161
if (!index) {
162-
const anchor = event.target.closest('a')
163-
const filter = anchor?.dataset?.value
162+
// const anchor = event.target.closest('a')
163+
const filter = event.currentTarget?.dataset?.value
164164
console.log(`filter: ${filter}`)
165165
if (filter && patterns.includes(filter)) {
166166
index = patterns.indexOf(filter)

src/js/popup.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ function createFilterLink(number, value = '') {
8989
async function popupLinks(event) {
9090
console.debug('popupLinks:', event)
9191
event.preventDefault()
92-
const anchor = event.target.closest('a')
93-
const href = anchor.getAttribute('href').replace(/^\.+/g, '')
92+
// const anchor = event.target.closest('a')
93+
const href = event.currentTarget.getAttribute('href').replace(/^\.+/g, '')
9494
console.debug('href:', href)
9595
let url
9696
if (href.endsWith('html/options.html')) {

0 commit comments

Comments
 (0)