Skip to content

Commit

Permalink
Add Copy Selected Links to Clipboard (#92)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
smashedr authored Aug 5, 2024
1 parent 4e2a20d commit 0b3688a
Show file tree
Hide file tree
Showing 12 changed files with 155 additions and 92 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Website: https://link-extractor.cssnr.com/
* [Install](#Install)
* [Features](#Features)
- [Upcoming Features](#Upcoming-Features)
- [Known Issues](#Known-Issues)
* [Configuration](#Configuration)
* [Support](#Support)
* [Development](#Development)
Expand Down Expand Up @@ -60,6 +61,7 @@ For any issues, bugs or concerns; please [Open an Issue](https://github.com/cssn
* Extract Links from Selected Text on any Site
* Extract Links from Clipboard or Any Text
* Extract Links from All Selected Tabs
* Copy Selected Links with right-click Menu
* Display Additional Link Details and Text
* Open Multiple Links in Tabs from Text
* Download Links and Domains as a Text File
Expand All @@ -82,6 +84,11 @@ For any issues, bugs or concerns; please [Open an Issue](https://github.com/cssn
> Request one on
> the [Feature Request Discussion](https://github.com/cssnr/link-extractor/discussions/categories/feature-requests).
### Known Issues

* Attempting to extract links from multiple selected tabs without granting host permissions opens the options page and
does not display any error message. If you encounter this, grant host permissions to the extension and try again.

## Configuration

- [View Configuration Documentation on Website](https://link-extractor.cssnr.com/docs/#configure)
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Link Extractor",
"description": "Easily extract, parse, or open all links/domains from a site or text with optional filters.",
"description": "Easily extract all links/domains from tabs/text with optional filters. Allows opening, copying, sorting, downloading, and more...",
"homepage_url": "https://link-extractor.cssnr.com/",
"author": "Shane",
"version": "0.0.1",
Expand Down
106 changes: 53 additions & 53 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"bootstrap": "^5.3.3",
"clipboard": "^2.0.11",
"datatables.net": "^2.0.7",
"datatables.net-bs5": "^2.1.0",
"datatables.net-bs5": "^2.1.3",
"datatables.net-buttons": "^3.0.2",
"datatables.net-buttons-bs5": "^3.1.0",
"datatables.net-buttons-bs5": "^3.1.1",
"jquery": "^3.7.1"
},
"devDependencies": {
Expand All @@ -32,7 +32,7 @@
"gulp": "^4.0.2",
"json-merger": "^1.1.10",
"prettier": "^3.3.3",
"puppeteer": "^22.13.1",
"puppeteer": "^22.15.0",
"web-ext": "^8.2.0"
}
}
3 changes: 2 additions & 1 deletion src/js/exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export async function saveOptions(event) {
let value
if (['flags', 'reset-default'].includes(event.target.id)) {
key = 'flags'
/** @type {HTMLInputElement} */
const element = document.getElementById(key)
let flags = element.value.toLowerCase().replace(/\s+/gm, '').split('')
flags = new Set(flags)
Expand Down Expand Up @@ -175,7 +176,7 @@ export async function exportClick(event) {
if (!data[name].length) {
return showToast(`No ${display} Found!`, 'warning')
}
const json = JSON.stringify(data[name])
const json = JSON.stringify(data[name], null, 2)
textFileDownload(`${name}.txt`, json)
}

Expand Down
4 changes: 2 additions & 2 deletions src/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ async function deleteFilter(event, index = undefined) {
const { patterns } = await chrome.storage.sync.get(['patterns'])
// console.debug('patterns:', patterns)
if (!index) {
const anchor = event.target.closest('a')
const filter = anchor?.dataset?.value
// const anchor = event.target.closest('a')
const filter = event.currentTarget?.dataset?.value
console.log(`filter: ${filter}`)
if (filter && patterns.includes(filter)) {
index = patterns.indexOf(filter)
Expand Down
4 changes: 2 additions & 2 deletions src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ function createFilterLink(number, value = '') {
async function popupLinks(event) {
console.debug('popupLinks:', event)
event.preventDefault()
const anchor = event.target.closest('a')
const href = anchor.getAttribute('href').replace(/^\.+/g, '')
// const anchor = event.target.closest('a')
const href = event.currentTarget.getAttribute('href').replace(/^\.+/g, '')
console.debug('href:', href)
let url
if (href.endsWith('html/options.html')) {
Expand Down
Loading

0 comments on commit 0b3688a

Please sign in to comment.