Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .idea/copilot.data.migration.ask2agent.xml

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

6 changes: 6 additions & 0 deletions .idea/git_toolbox_blame.xml

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

10 changes: 10 additions & 0 deletions .idea/material_theme_project_new.xml

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

4 changes: 4 additions & 0 deletions docs/History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v3.1.15 / 2025-12-27
====================
* Fixes link opening behavior to open serially when from multiple actions (@DanKaplanSES)

v3.1.13 / 2024-09-27
====================

Expand Down
1 change: 1 addition & 0 deletions eslint/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module.exports = {
'BACKGROUND_TEST': 'readonly',
'RELOAD_EXTENSION': 'readonly',
'OPEN_URLS_IN_TABS': 'readonly',
'COPY_TO_CLIPBOARD': 'readonly',
'OPEN_LINKS': 'readonly',
'COPY_LINKS': 'readonly',
'isChrome': 'readonly',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "snaplinks3",
"FullName" : "Snap Links",
"version" : "3.1.15",
"version" : "3.1.16",
"description" : "Select multiple links, checkboxes and other elements and act on them such as open them in new tabs or check/un-check them.",
"author" : "Clint Priest <snaplinks-git@rxv.me>",
"license" : "MIT",
Expand Down
17 changes: 16 additions & 1 deletion src/background-scripts/background.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

let openUrlsPromiseChain = Promise.resolve();
let TabStacks = new Map();

/**
Expand Down Expand Up @@ -30,11 +31,25 @@ function onMessage(msg, sender, respond) {
browser.runtime.reload();
break;
case OPEN_URLS_IN_TABS:
OpenUrlsInTabs(msg.tUrls);
openUrlsPromiseChain = openUrlsPromiseChain.then(() => {
return OpenUrlsInTabs(msg.tUrls);
});
break;
case COPY_TO_CLIPBOARD:
CopyToClipboard(msg.tUrls);
break;
}
}

/**
* @param {string[]} urls
* @return {Promise<void>}
*/
async function CopyToClipboard(urls) {
let platformInfo = await browser.runtime.getPlatformInfo();
navigator.clipboard.writeText(urls.join(platformInfo.os === chrome.runtime.PlatformOs.WIN ? '\r\n' : '\n'));
}

/**
* @param {string[]} urls
* @return {Promise<void>}
Expand Down
5 changes: 4 additions & 1 deletion src/content-scripts/ActionMgr.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ class ActionMgr {
if(Prefs.DevMode && Prefs.Dev_Skip_AllActions)
return console.log('Skipped Copying Links: %o', links);

navigator.clipboard.writeText(links.join('\r\n'));
browser.runtime.sendMessage({
Action: COPY_TO_CLIPBOARD,
tUrls: links,
});
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const OPEN_LINKS = 1, // Open links
// Actions
const BACKGROUND_TEST = 'BackgroundTest',
RELOAD_EXTENSION = 'ReloadExtension',
OPEN_URLS_IN_TABS = 'OpenUrlsInTabs';
OPEN_URLS_IN_TABS = 'OpenUrlsInTabs',
COPY_TO_CLIPBOARD = 'CopyToClipboard';

const TABS_OPEN_END = 'OpenTabsAtEnd',
TABS_OPEN_RIGHT = 'OpenTabsToRight',
Expand Down
Loading