piroor / copy-selected-tabs-to-clipboard Goto Github PK
View Code? Open in Web Editor NEWProvides ability to copy title and URL of selected tabs to the clipboard for Firefox 63 and later.
License: Other
Provides ability to copy title and URL of selected tabs to the clipboard for Firefox 63 and later.
License: Other
Mozilla announced that the background page is deprecated and we need to migrate to service workers on manifest v3.
https://blog.mozilla.org/addons/2021/05/27/manifest-v3-update/
There are some information to migrate background page to service workers:
I noticed the v1.6.0 release notes state "Determine color of SVG icons for the platform color mode (dark or bright), based on the CSS prefers-color-scheme feature."
I use a dark theme, and so for years I've used 1 line of code in userContent.css
to modify the colour of CSTTC's icon in about:addons
(I make it green-blue (colour #0c4), which works well for my eyes).
Given the above referenced line in the v1.6.0 release notes, I thought I would let you know that this line of code is still needed for v1.6.0. It's no problem for me, but I thought I would let you know.
If you do choose to fix this issue, please don't use a bright white (colour #fff) icon for dark themes. That generates much too much contrast. #b4b4b4
works well if you go with white, although I prefer a little colour in my world. :)
about:config
.layout.css.prefers-color-scheme.content-override
to 0
.about:addons
.Lighter icon for dark themes.
Dark icon.
Desired use case: Stick to a set of formats that you use frequently. Occasionally, enable some extra formats when needed. Disable these formats when not needed to keep the menu small.
Currently, this requires:
I would prefer:
Was failing with error codes now have a mixture of returning nothing or error codes
Test1 %URL%
https://mail.aol.com/webmail-std/en-us/suite
https://github.com/piroor/copy-selected-tabs-to-clipboard/labels
view-source:https://github.com/piroor/copy-selected-tabs-to-clipboard/labels
about:addons
Test2 %description%123%DESCRIPTION%345%TITLE%678%EOF%
123345AOL Mail (5333)678%EOF%
123345Issues · piroor/copy-selected-tabs-to-clipboard · GitHub678%EOF%
123345https://github.com/piroor/copy-selected-tabs-to-clipboard/labels678%EOF%
123345Add-ons Manager678%EOF%\
HTML Link with Description
%TITLE_HTML%
and added another tab and retested
http://dmcritchie.mvps.org/dolphin/lesson_from_newtab.htm
params.tab is undefined
fillPlaceHoldersInternal@moz-extension://c8319d8c-7857-437d-aa04-f6621a670f5b/common/commands.js:221:1
fillPlaceHolders@moz-extension://c8319d8c-7857-437d-aa04-f6621a670f5b/common/commands.js:188:44
Issues · piroor/copy-selected-tabs-to-clipboard · GitHub
https://github.com/piroor/copy-selected-tabs-to-clipboard/labels
Add-ons Manager
params.tab is undefined
fillPlaceHoldersInternal@moz-extension://c8319d8c-7857-437d-aa04-f6621a670f5b/common/commands.js:221:1
fillPlaceHolders@moz-extension://c8319d8c-7857-437d-aa04-f6621a670f5b/common/commands.js:188:44
A good link to go into an HTML file or to paste into an RTF document
Bookmarklets, history, exported bookmarks, extensions for Chrome (2020-07-25)
Results shown above
Results still the same)
params.tab is undefined
fillPlaceHoldersInternal@moz-extension://c8319d8c-7857-437d-aa04-f6621a670f5b/common/commands.js:221:1
fillPlaceHolders@moz-extension://c8319d8c-7857-437d-aa04-f6621a670f5b/common/commands.js:188:44
params.tab is undefined
fillPlaceHoldersInternal@moz-extension://c8319d8c-7857-437d-aa04-f6621a670f5b/common/commands.js:221:1
fillPlaceHolders@moz-extension://c8319d8c-7857-437d-aa04-f6621a670f5b/common/commands.js:188:44
https://github.com/piroor/copy-selected-tabs-to-clipboard/labels
Add-ons Manager
params.tab is undefined
fillPlaceHoldersInternal@moz-extension://c8319d8c-7857-437d-aa04-f6621a670f5b/common/commands.js:221:1
fillPlaceHolders@moz-extension://c8319d8c-7857-437d-aa04-f6621a670f5b/common/commands.js:188:44
I would like an option to not show context menu items when a webpage is right clicked. I only want to use the context menu items by right clicking on a tab.
The context menu shouldn't have a Copy to Clipboard
item.
The context menu has a Copy to Clipboard
item.
Firefox Addon pages are not included in output, if there is output, when %DESCRIPTION% is in pattern.
Descriptions are in the addon pages, easier to view source (Ctrl+U) in Chrome, as view in Firefox is almost all in a single line.
Can see descriptions with a bookmarklet as well.
The plain vanilla HTML link works, it has no %DESCRIPTION% in pattern
Some URLs to test with
https://addons.mozilla.org/en-US/firefox/addon/remove-google-redirections/
https://addons.mozilla.org/en-US/firefox/addon/search_by_image/
https://addons.mozilla.org/en-US/firefox/addon/search-by-image-on-google/
view-source:https://addons.mozilla.org/en-US/firefox/addon/search-by-image-on-google/
https://addons.mozilla.org/en-US/firefox/addon/tineye-reverse-image-search/
about:newtab
http://dmcritchie.mvps.org/dolphin/lesson_from_newtab.htm
https://addons.mozilla.org/en-US/firefox/addon/view-page-archive/
Pattern: (sorry, still don't know how to enter code, ^ is substituted for < )
^a href="%URL_HTML%" title="%DESCRIPTION_HTML%">%TITLE_HTML%^/a>%RT%
same as plain vanilla link with title="%DESCRIPTION_HTML%" added
All tabs processed
No output for addons when %DESCRIPTION% is included
May process all others or be likely to fail to process all urls when addons are included in selection
No problem if all that are selected are not Firefox addons
Either or both of the following would be helpful, but especially the first:
(e.g., given https://www.nytimes.com/interactive/2020/05/19/burst/compost-box-indoors-coronavirus.html?action=click&module=Top%20Stories&pgtype=Homepage&contentCollection=AtHome&package_index=0 copies https://www.nytimes.com/interactive/2020/05/19/burst/compost-box-indoors-coronavirus.html )
To comment on priority, I would find 1 most helpful (and certainly most worthwhile versus the effort!) I would also find 1. helpful even if 2. is provided: Sometimes I'd want to strip arguments no matter the domain; and having 1. allows the user to decide how it will be copied when they choose a format from the menu.
Using this extension's latest version on Firefox 94.0 and Ubuntu 21.10.
This issue has been affecting me since last may (I've actually reported it here) and is identical to the issue of the same name for your Tree style tab extension.
I'm bypassing this problem by browsing the preferences page url (moz-extension://c97f5b5b-5bf8-4e41-9744-f35a5b184b71/options/options.html) on a dedicated tab within Firefox.
Together with #19, it makes every restarting of my browser cumbersome. It's not a huge deal, but still... having both issues solved would be greatly appreciated !
Cheers
Children of a collapsed tree are not copied
Start Firefox with clean profile.
Install MTH. Copy Selected Tabs to Clipboard
Install Tree Style Tabs as well
Select the root of a tree which is collapsed, ie all though the root is selected, the children are collapsed under it and can't be seen, but expanding the tree shows that all the childern are selected.
Copy the selection via the Copy To Clipboard
menu.
Paste the the result into a file
All the children which were also highlighted as selected should have been copied
Only the root of the tree is copied. The items beneath it were not copied
v1.0.2 on Nightly 65.0a1 (2018-11-12)
Steps:
x
on a row in the format table.Copy to Clipboard >
. Row that you removed in the previous step is still visible. Browser Console says TypeError: row.parentNode is null; can't access its "childNodes" property init.js:237:3
How can I paste the URL of the selected tabs and having them separated by a space instead of a return to line?
Feature request: It's not urgent, but I'd like to be able to turn off the notifications when tabs are copied (in preferences, I presume.)
Piro, I LOVE TST so much! thank you for making it.!
As for Copy Tabs, I'm seeing so much potential for using it to make my dream of using Mindmaps for Bookrmark organization a thing.
I'm wondering if it's possible to do any of the following while using Markdown(list) format.
or
Ergo, I guess both of these would be having the addon do the whole URL Text vrs URL address stuff.
Thanks! :-)
Also, is there any way we can donate to you? I can't find any way on any of your websites or on Firefox addons pages. (And now that I'm thinking about it, Firefox REALLY needs a donate button on the addons pages. You devs are friggen amazing!)
This is not so much an issue report than a question and a feature request.
It made sense to me to ask it there, because I'm using this very extension to copy a list of urls as a markdown list and paste then inside my personal notes before commenting or reorganizing them.
This workflow, although promising, is hindered by the seemingly lack of solutions for reopening such a list of (possibly annotated/commented) markdown urls in Firefox. For now, I'm forced to click on the links one by one, which is cumbersome, and the original indentation is lost.
Do you know of a better way of doing it ?
Could you allow one of your extensions -- possibly TST -- to
Thanks in advance,
cheers
Hello @piroor
The following expressions worked correctly until version 1.5.0:
++%TST_INDENT(+)% [[%URL%{%DESCRIPTION%} %REPLACE("%TITLE%", "( - )?(http|ftp|https):\/([\w_-]+(?:(?:\, @?^=%&:\/~+#-]*[\w@?^=%&&\/~+#-])", "", " - ", " \w ", " - ", " \w ", " - ", " \w " )% ]]]
--%TST_INDENT(-)% [[%URL%{%DESCRIPTION%} %REPLACE("%TITLE%", "( - )?(http|ftp|https):\/([\w_-]+(?:(?:\, @?^=%&:\/~+#-]*[\w@?^=%&&\/~+#-])", "", " - ", " \w ", " - ", " \w ", " - ", " \w " )% ]]]
**%TST_INDENT(*)% [[%URL%{%DESCRIPTION%} %REPLACE("%TITLE%", "( - )?(http|ftp|https):\/(([\w_-]+(?:(?:\, [\w@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])", "", " - ", " "- ", " "- ", " "- ", " ", " " " )% \n]]]
Since version 1.5.0 the following error occurs:
Unhandled error: Unhandled error: Unknown placeholder: &:/~+#-]*[w@?^=
processPlaceHolder@moz-extension://859c1e96-a3d9-43f2-9a75-106c6da36a5a/common/commands.js:468:9
fillPlaceHoldersInternal/<@moz-extension://859c1e96-a3d9-43f2-9a75-106c6da36a5a/common/commands.js:356:12
process@moz-extension://859c1e96-a3d9-43f2-9a75-106c6da36a5a/common/placeholder-parser.js:108:21
process@moz-extension://859c1e96-a3d9-43f2-9a75-106c6da36a5a/common/placeholder-parser.js:193:21
fillPlaceHoldersInternal@moz-extension://859c1e96-a3d9-43f2-9a75-106c6da36a5a/common/commands.js:355:28
fillPlaceHolders@moz-extension://859c1e96-a3d9-43f2-9a75-106c6da36a5a/common/commands.js:321:44
Do I need to make any changes to make them work correctly with version 1.5.0?
Thank you for making this useful extension available to the community.
Best regards,
Claudio Salvio
Extension is very slow to paste formatted URL
This is my custom format meant to be used at https://pubmed.ncbi.nlm.nih.gov/
[\(AUTHOR YEAR\)][%REPLACE("%URL%", ".*pubmed.ncbi.nlm.nih.gov/(\d+)/", "$1")%]%EOL%[%REPLACE("%URL%", ".*pubmed.ncbi.nlm.nih.gov/(\d+)/", "$1")%]: %URL% (%MD_LINK_TITLE_SAFE(%TITLE%)%)
Text is pasted nearly instantly.
It requires 10 to 13 seconds before the clipboard contents are pasted (and my desktop environment becomes unresponsive). BTW, I'm working on a fast desktop computer with lots of RAM, etc.
I use the extension's menu to copy the URL. Then I use CTRL-v to paste it. After entering CTRL-v, there is a delay of 10+ seconds where nothing happens and my system appears non-responsive. After that delay, I get a desktop popup notification (in KDE) and the item is pasted from the clipboard.
I do not have any slowness or non-responsive at any other time from any other applications.
Here's an example:
[\(AUTHOR YEAR\)][28728020]
[28728020]: https://pubmed.ncbi.nlm.nih.gov/28728020/ (Neuroscience-Inspired Artificial Intelligence - PubMed)
The first time I tested this extension, I installed it to a clean FF profile and copy/pasted the markdown format. No problems. Then I defined my custom format and it was slow (as I had seen on my regular Firefox profile).
However, when I went back and tested the standard markdown format, it was very slow now too. I reverted my changes and it remained slow.
BTW, side question, does anyone know if I can automatically capture the citation authors and publication date? This info is in the meta data:
<meta name="citation_authors" content="Hassabis D;Kumaran D;Summerfield C;Botvinick M;">
href attribute tags are being generated in alphabetcal ordet rather than order specified
Using ^ instead of < so page does not get messed up.
HTML Link with Desc ^LI>
^li>^a target="_blank" href="%URL_HTML%" title="%DESCRIPTION_HTML%">%TITLE_HTML%^/a>^/li>%RT%
.
attribute tags came out in alphabetical order within Anchor element
href= target= title=
instead of the order presented
target= href= title=
expected them in the order I presented
I enter a lot of links manually and type the href="h... immediately after the A.
I want to change links later to insert target="_blank" immediately after the A.
change all '^a href="h' to '^a target="_blank" href="h'
##Other
Thanks for fixing Description #12 it is active
Hi, and happy new year.
This defect has been bothering me for long, it's only now that I take the time to report it.
Using latest version of this extension on Firefox 84.0.2 running on Ubuntu 20.04.
After every navigator restart, the values for the formats (e.g. &Markdown
) are replaced with the default values.
Cheers, and thanks for your work !
Commands:
Context:
The openerTabId
property on tabs seem to be updated by both Tree Style Tab and Sidebery. So it should be possible to read tree structure from it instead of how its currently implemented (by using TST's API). If using TST's API is better in some ways then there could be a fallback that uses openerTabId
if TST isn't installed/enabled.
One issue with openerTabId
seems to be that if multiple addons want to control it then the tree structure could be a bit unexpected. This seems quite unlikely though since that would also mean the user would have different tree structures in the different addons. One way this could happen is if a user had both TST and Sidebery installed but only used on of them. In that case I am unused which addon would set the openerTabId
when the browser session is restored and that could lead to some issues. (In which case using TST's API could be better since it would at least get a consistent picture of the tree structure.)
Markdown (List)
.The copied tab titles and URLs should be indented based on their tree level.
The copied list is flat with no indentation.
When the user has selected multiple tabs, the extension, by default, will copy all tabs (not just the selected ones).
Only copy the selected tabs, by default.
All tabs are copied.
Perhaps have an option in which the user can toggle this behaviour.
It would be great if the submenu could be avoided if only one format is enabled in the Options page, so that the actionable menuitem can be present in the root menu itself.
There is only one format enabled, hence it shouldn't be behind a submenu.
It is behind a submenu.
Hello, thank you very much for this great magnificent extension which which makes our lifes more comfortable ! 💯 🥇
Please i have request: I sometimes use chromium and chromium-based web browsers, it will be great to add the wonderful awesome Copy-selected-tabs-to-clipboard in the chrome store or add a crx extension in the github page of the extension to manually add this exceptional extension to the ungoogled chromium browser for example, in addition it will be great to add the ability to automatically copy the selected text inside the press articles into the clipboard as plain text because I do academic research and I I often copy extracts and paragraphs from different websites and online books and I need to do these copy and paste operations quickly, thank you very much !
I tried adding a new format, called "URL|Title".
Then, thinking that the "|" character might be triggering some kind of special behavior, I edited that to "URI and Title (for YTDL)". When that didn't help, I switched back to "URI|Title"
As you can see in the image below, each character entered seems to have created a new format entry in the context menu!
Also, my desired order of context menu items isn't respected: The custom ones are all at the bottom.
I'd note that clicking the "URI|Title" option does indeed work correctly, so this bug is just related to (many!) extra items and incorrect ordering in the context menu.
I'm using v1.0.7 (2019.8.8) on Firefox 69.0 x64, Windows 10 x64 v1809 (Build 17763.737)
Screenshot:
add an entry to the context menu when right-clicking on a link
to enable the use of favourite formats for links too.
If appropriate, add an option in the settings
to enable or disable this feature.
You created a very good add-on with Copy Selected Tabs to Clipboard
and I have several copy formats in use with it 👍
Vingolf
Right now you can set a per-link template, and it is joined with newlines. It would be very useful to be able to add a prefix and suffix. For example I am trying to create an html list and would like to prefix with <ul>
and suffix with </ul>
.
I want to change the newline code.
Newline code is lf.
Newline code is cr+lf.
Regression: v1.6.0 breaks "Show context menu item in the context menu on the content area" option
Separator of copied items
section.No CSTTC context menu in content area.
CSTTC context menu in content area.
Currently, you have to select what happens on click and on middle click when copying tabs. But sometimes, I want to copy a full tree, sometimes just descendants (which is a great feature, especially with the proper indentation!) and sometimes just the single tab.
Couldn't it be possible to make each of these an entry in the context menu? So that I could just straight up select the context menu for "copy this tab" or "copy descendants" without having to remember which was right-click, middle-click etc.
Browser | Firefox Nightly 123.0a1 (2023-12-28) (64-bit) |
CSTTC version | 1.6.2 |
CSTTC config | [email protected](1).json |
I have been using CSTTC without issue until recently, where I found that using %RT%
format throws an exception:
14:34:07.506 clipboard<BG>: failed to write text/data to clipboard: TypeError: Clipboard.write: Argument 1 can't be converted to a sequence.
copyToClipboard moz-extension://6ebf3598-f26a-4036-8a43-851309901bab/common/commands.js:92
onClick moz-extension://6ebf3598-f26a-4036-8a43-851309901bab/background/context-menu.js:473
common.js:77:11
Affected code: commands.js:92
and context-menu.js:473
.
I've been investigating and debugging myself and made a few discoveries:
I tried using CSTTC %RT%
in a different Firefox installation: Firefox 116
, which works. However, after updating to 122.0b3
, the issue is present. This leads me to believe there were changes made after 116
which either broke or removed API features CSTTC used.
The tab generated by CSTTC for copying the %RT%
content no longer opens as it used to, which seems to be causing the problem.
116+
%RT%
formatThe following change to commands.js
appears to resolve the issue, and the %RT%
format works as expected.
...
/* const dt = new DataTransfer();
dt.items.add(plainText, 'text/plain');
dt.items.add(richText, 'text/html'); */
const ci1 = new ClipboardItem({
["text/plain"]: plainText,
["text/html"]: richText,
});
/* navigator.clipboard
.write([ci1])
.then(() => {
notifyCopied(tabs.length, plainText);
})
.catch((error) => {
notifyFailed(error);
}); */
await navigator.clipboard.write([ci1]).then(() => {
notifyCopied(tabs.length, plainText);
});
console.log("Text has been copied to clipboard");
...
Copying the rich text linked title does not work for fully loaded Google Docs tabs, but does work for unloaded ones, and other websites. Other formats (such as separate title & link) work as well.
Tab title is copied as linked, rich text.
Clipboard was not updated, previous clipboard content is inserted.
%RT%<a title="%TITLE_HTML%" href="%URL_HTML%">%TITLE_HTML%</a>
Sometimes it works, sometimes it doesn't and I get a tiny empty floating Firefox window (and when that happens, you know the copy didn't work). Here is a video that demonstrates the issue.
When it happens, the wanted information is not actually copied to the clipboard (or at least, my email client cannot paste it, nor can LibreOffice Writer).
Strangely enough, the other types of copies (ex: "HTML Link", "Markdown Link List") seem to work fine "every time". Just not the rich-text HTML one.
First, thank you for this addon! I've been using it for about a year and it has streamlined my workflow a lot. ❤️
About 2 weeks ago, possibly when i updated to FF nightly 74.0a1, the keyboard shortcuts stopped working. I had mapped Ctrl+Shift+L to copy. Troubleshooting steps taken:
Curious if anyone can repro (with latest nightly).
I'd like to be able to specify keyboard shortcuts to copy the selected tabs. (Including for custom formats.)
Please consider making Containers support #24 optional.
This would need two things:
How could we treat existing users and their expectations? Is there any way to make this new option disabled by default for new installation, BUT enabled by default for existing installations (that is, for installations where we are updating a version)?
If too complicated, we could enable Container support by default. If the users wants, she/he can uncheck the option and remove the optional permission.
There is a serious regression in CSTTC v1.6.0 and v1.6.1 in which CSTTC no longer always copies the information for the correct tabs.
I have yet had time to be able to isolate this issue with exact STR.
What I can state for sure is that:
Copy individual tab
set for CSTTC's middle-click operation.Copy all tabs
set for CSTTC's regular operation.Copy all tabs
operation, sometimes CSTTC copies the correct tabs, but sometimes it only copies the current tab or the current tab and the tab immediately to its right.Always copy the information for the correct tabs, as with CSTTC pre-v1.6.0.
For the Copy all tabs
operation, sometimes CSTTC copies the correct tabs, but sometimes it only copies the current tab or the current tab and the tab immediately to its right.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.