Open iG8R opened 10 months ago
You have not even installed SearchJumper. So what are you expecting???
Well, this is my pre-installation preparation. :)
What a beautiful design and smooth operation of the script, wow.
SearchJumper does not have the ability to extract the HTML of selected elements, which may be added in the future. I didn't have a good idea where to add it.
Is SearchJumper able to intercept what is passed to the clipboard?
If yes, then, usually, when something is copied in the browser, it is transmitted in two versions at once - text/plain
and text/html
. Maybe then it will be possible to process text/html
with SearchJumper?
PS. This feature would be way useful, as when we copy texts from web pages and paste them into applications or forms that don't support pasting texts with richtext/html formatting, we encounter a problem of missing a very important part of these texts - URLs, since usually the overwhelming majority of URLs on any web page are hidden under text descriptions and images.
No, it can't. https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/read . On firefox, only addon can do that, but not greasemonkey script.
What a pity :(
You can try %element now
c:%element{}
c:%element{}.prop(innerHTML)
c:%s
Amazing! Thank you very much! Is it possible to customize how the copied text+URL will look, for example, currently it is copied like this
[📧Mail Me](mailto:rixixi@gmail.com)
Build with React.js
UI: [Material-UI](https://mui.com/)
Icons: [FontAwesome](https://fontawesome.com/)
E.i. with [ ]
around text and ( )
around the URL.
Make it possible for it to look text (URL)
or {text | URL}
, or text [URL]
etc.
Some texts reveal bugs in their processing, but this in no way diminishes how cool it is!
Icons: [FontAwesome](https://fontawesome.com/)
[![](https://github.com/hoothin/SearchJumper/raw/main/demo1.gif)](https://github.com/hoothin/SearchJumper/blob/main/demo1.gif)
[
![demo1.gif](https://github.com/hoothin/SearchJumper/raw/main/demo1.gif)
](https://github.com/hoothin/SearchJumper/blob/main/demo1.gif)
[
](https://github.com/hoothin/SearchJumper/blob/main/demo1.gif)
[![](https://github.com/hoothin/SearchJumper/raw/main/demo3.gif)](https://github.com/hoothin/SearchJumper/blob/main/demo3.gif)
[
![demo3.gif](https://github.com/hoothin/SearchJumper/raw/main/demo3.gif)
](https://github.com/hoothin/SearchJumper/blob/main/demo3.gif)
[
](https://github.com/hoothin/SearchJumper/blob/main/demo3.gif)
[![](https://github.com/hoothin/SearchJumper/raw/main/demo2.gif)](https://github.com/hoothin/SearchJumper/blob/main/demo2.gif)
I've optimized a little, but this is just a experimenting and I think addon like Copy as Markdown will be better.
Anyway, you can try %element{}.prop(outerHTML).replace()
for more possibilities.
Thank you for advice.
Copy as Markdown - very good addon, but it only copies connected pair [link title](URL)
or [page title](URL)
, not entire selected text with URLs.
As for the Markdown format - it is used mostly among among specialists (typesetting, design, IT), for common people, like parents or friends such a text format would be incomprehensible and confusing. That’s actually why I asked for the ability to customize the text-link design type, so that it would be convenient for everyone with whom you communicate and send information.
Of course, it is possible to use wildcard substitution manually, but it would be much more convenient for any user, even Vim fans, if there was an option to set formatting options initially.
It's easy with %element.replace, like
c:%element{}.replace(/!\[.*?\]\(.*?\)/g,"").replace(/\[(.*?)\](\(.*?\))/g,"$1$2")
c:%element{}.replace(/!\[.*?\]\(.*?\)/g,"").replace(/\[(.*?)\]\((.*?)\)/g,"{ $1 | $2 }")
Thanks a lot!
Unfortunately, the new rules do not work as well as the first ones. I know that the script still needs to be optimized, so the data below is just for information on how things are at the moment.
c:%element{}
[📧Mail Me](mailto:rixixi@gmail.com)
Build with React.js
UI: [Material-UI](https://mui.com/)
Icons: [FontAwesome](https://fontawesome.com/)
[![](https://github.com/hoothin/SearchJumper/raw/main/demo1.gif)](https://github.com/hoothin/SearchJumper/blob/main/demo1.gif)
[![demo1.gif](https://github.com/hoothin/SearchJumper/raw/main/demo1.gif)](https://github.com/hoothin/SearchJumper/blob/main/demo1.gif)
[![](https://github.com/hoothin/SearchJumper/raw/main/demo3.gif)](https://github.com/hoothin/SearchJumper/blob/main/demo3.gif)
[![demo3.gif](https://github.com/hoothin/SearchJumper/raw/main/demo3.gif)](https://github.com/hoothin/SearchJumper/blob/main/demo3.gif)
[![](https://github.com/hoothin/SearchJumper/raw/main/demo2.gif)](https://github.com/hoothin/SearchJumper/blob/main/demo2.gif)
[Click on text to copy a link to the clipboard - javascript ![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACDklEQVR4Ae1VA6wcURR9tW23+95s7cZVUNuKaiOsu3dqB7UV1EFt27btjup2el6y+ObMFv+f5OwObuacqzyWilQ4CYs8tQwSJw3ilcIu/n6qJ5dJ4gNow8SdD1Q6Nws3DFVpBwO/QBvcYa9n6VwVlALItkIkE8TH+w1ITmVuAuLzIfLFUpW+QVPE0prEt/oN/EJMR1fEP08sUwoCLyJku9qmIlmD8+DjN/3PLZPKVGFuwKTShSFwMIKJKzp5vAzQyVsO9x/9Q3kf9/ndmQOqn172OsLwaRBszwBLFS1Cz/keR4bSJKWrRUpz2WsWARbx1oE19IvOthfVzGD5xLgIFZrtxK6/95f1rukTw+Qz5odGXODdhZCgcuSTTxQ3SNmMeAMm+yR36iuglIcDAn4jukVibqD3NpXOjJgVEWJewWjDjxMEZ04BgjX8Il8iCP0Cd5gqbyLbg5geuP8MPpFVYG7AmCQKoKxjIPIUtCPwluHjg3TVW8exc8EiT1NTFd2M8Ur5qNMshw1CndGOE1GMjHBw58W+CH03wWOy92APa7yoLk0ETkTErEGLnr+ZVjaHkwZ2ghpox8Kv4DkYWwwOkBvBnIYcLjnthso7IcNpENyN/3cxGZItS5bY8jXrbEmWAHwiT0ld5W2Queo/iJ5oVCFvxO+4ZCBuOGpAljUx/I8MJAP/vgEn+K8ZCD9S8Rsz4IeXsWZCowAAAABJRU5ErkJggg==) Stack Overflowhttps://stackoverflow.com › questions › click-on-text-t...](https://stackoverflow.com/questions/51625169/click-on-text-to-copy-a-link-to-the-clipboard) Stack Overflowhttps://stackoverflow.com › questions › click-on-text-t...
c:%element{}.replace(/![.?](.?)/g,"").replace(/[(.?)]((.?))/g,"$1 $2")
📧Mail Me (mailto:rixixi@gmail.com)
Build with React.js
UI: Material-UI (https://mui.com/)
Icons: FontAwesome (https://fontawesome.com/)
(https://github.com/hoothin/SearchJumper/blob/main/demo1.gif)
(https://github.com/hoothin/SearchJumper/blob/main/demo1.gif)
(https://github.com/hoothin/SearchJumper/blob/main/demo3.gif)
(https://github.com/hoothin/SearchJumper/blob/main/demo3.gif)
(https://github.com/hoothin/SearchJumper/blob/main/demo2.gif)
Click on text to copy a link to the clipboard - javascript Stack Overflowhttps://stackoverflow.com › questions › click-on-text-t... (https://stackoverflow.com/questions/51625169/click-on-text-to-copy-a-link-to-the-clipboard) Stack Overflowhttps://stackoverflow.com › questions › click-on-text-t...
So? I think it works as I expected. What's your expected behavior?
![] means image with no alt info
(https://github.com/hoothin/SearchJumper/blob/main/demo1.gif)
means this is a link but without text (which was image there).
If you don't want to save links without text, add another replace like c:%element{}.replace(/!\[.*?\]\(.*?\)/g,"").replace(/\[ *\]\(.*?\)\s*/g,"").replace(/\[(.*?)\]\((.*?)\)/g,"{ $1 | $2 }")
.
I don't know why you can't get all links but I get this result on my Chrome.
{ Click on text to copy a link to the clipboard - javascript Stack Overflowhttps://stackoverflow.com › questions › click-on-text-t... | https://stackoverflow.com/questions/51625169/click-on-text-to-copy-a-link-to-the-clipboard } Stack Overflowhttps://stackoverflow.com › questions › click-on-text-t...Aug 1, 2018 — 2 Answers 2 · Create a
I need more informations like platform os
This is me using Firefox :(
I just checked, under the same conditions in EDGE and Chrome - that's right, everything works there as you say, links are not eaten.
Thanks, firefox has multiple range. I've fixed.
On the contrary, I am very grateful that my question is being treated with such attentiveness and care.
Thanks a lot! Is it possible for the formatting of the copied text to be preserved, i.e. if the original text contains line breaks, the copied text would also have the same line breaks? For example, the example above.
Was:
Click on text to copy a link to the clipboard - javascript Stack Overflowhttps://stackoverflow.com › questions › click-on-text-t... (https://stackoverflow.com/questions/51625169/click-on-text-to-copy-a-link-to-the-clipboard) Stack Overflowhttps://stackoverflow.com › questions › click-on-text-t...Aug 1, 2018 — 2 Answers 2 · Create a <textarea> element to be appended to the document. · Set its value to the string that we want to copy to the clipboard. 2 answers (https://stackoverflow.com/a/51625261)  ·  Top answer: If you want to ensure compatibility with all major browsers, you can use the following ... Copy a text when a link or button is clicked - Stack Overflow (https://stackoverflow.com/questions/19606221/copy-a-text-when-a-link-or-button-is-clicked) Oct 26, 2013 How to copy a HyperText link into clipboard without losing the ... (https://stackoverflow.com/questions/53003980/how-to-copy-a-hypertext-link-into-clipboard-without-losing-the-link-properties) Oct 26, 2018 How to create a copy text link? - html - Stack Overflow (https://stackoverflow.com/questions/64406456/how-to-create-a-copy-text-link) Oct 17, 2020 JavaScript: copy text to clipboard and append source hyperlink (https://stackoverflow.com/questions/31968274/javascript-copy-text-to-clipboard-and-append-source-hyperlink) Aug 12, 2015 More results from stackoverflow.com (https://www.google.com/search?q=html+copying+text+with+links+site:stackoverflow.com&newwindow=1&sca_esv=578730287&sxsrf=AM9HkKkGnlxPaXxzD4fFPKm3k_apsQD63A:1698970246764&sa=X&ved=2ahUKEwj9-6qwxaaCAxUSGhAIHdBgA10QrQIoBHoECAwQBQ)
Became:
Click on text to copy a link to the clipboard - javascript
Stack Overflow
https://stackoverflow.com › questions › click-on-text-t... (https://stackoverflow.com/questions/51625169/click-on-text-to-copy-a-link-to-the-clipboard)
Aug 1, 2018 — 2 Answers 2 · Create a <textarea> element to be appended to the document. · Set its value to the string that we want to copy to the clipboard.
2 answers (https://stackoverflow.com/a/51625261)  ·  Top answer: If you want to ensure compatibility with all major browsers, you can use the following ...
Copy a text when a link or button is clicked - Stack Overflow (https://stackoverflow.com/questions/19606221/copy-a-text-when-a-link-or-button-is-clicked) Oct 26, 2013
How to copy a HyperText link into clipboard without losing the ... (https://stackoverflow.com/questions/53003980/how-to-copy-a-hypertext-link-into-clipboard-without-losing-the-link-properties) Oct 26, 2018
How to create a copy text link? - html - Stack Overflow (https://stackoverflow.com/questions/64406456/how-to-create-a-copy-text-link) Oct 17, 2020
JavaScript: copy text to clipboard and append source hyperlink (https://stackoverflow.com/questions/31968274/javascript-copy-text-to-clipboard-and-append-source-hyperlink) Aug 12, 2015
More results from stackoverflow.com (https://www.google.com/search?q=html+copying+text+with+links+site:stackoverflow.com&newwindow=1&sca_esv=578730287&sxsrf=AM9HkKkGnlxPaXxzD4fFPKm3k_apsQD63A:1698970246764&sa=X&ved=2ahUKEwj9-6qwxaaCAxUSGhAIHdBgA10QrQIoBHoECAwQBQ)
Yes, you can try 1.6.30.21 But there are two things I have no idea how to work out for now.
Stack Overflow
is over Click on text
Almost perfect!
Is it possible to make line breaks take into account <div>
tags, so that the sequence of paragraphs is not disrupted in this way?
For example.
Click on text to copy a link to the clipboard - javascript Stack Overflow https://stackoverflow.com › questions › click-on-text-t... (https://stackoverflow.com/questions/51625169/click-on-text-to-copy-a-link-to-the-clipboard)
Aug 1, 2018 — 2 Answers 2 · Create a <textarea> element to be appended to the document. · Set its value to the string that we want to copy to the clipboard.
2 answers (https://stackoverflow.com/a/51625261) Â
·
Top answer:Â
If you want to ensure compatibility with all major browsers, you can use the following ...
Copy a text when a link or button is clicked - Stack Overflow (https://stackoverflow.com/questions/19606221/copy-a-text-when-a-link-or-button-is-clicked)
Oct 26, 2013
How to copy a HyperText link into clipboard without losing the ... (https://stackoverflow.com/questions/53003980/how-to-copy-a-hypertext-link-into-clipboard-without-losing-the-link-properties)
Oct 26, 2018
How to create a copy text link? - html - Stack Overflow (https://stackoverflow.com/questions/64406456/how-to-create-a-copy-text-link)
Oct 17, 2020
JavaScript: copy text to clipboard and append source hyperlink (https://stackoverflow.com/questions/31968274/javascript-copy-text-to-clipboard-and-append-source-hyperlink)
Aug 12, 2015
More results from stackoverflow.com (https://www.google.com/search?q=html+copying+text+with+links+site:stackoverflow.com&newwindow=1&sca_esv=579018559&sxsrf=AM9HkKlEMH1ZH33OGONuKEoWlgnKiuJlmQ:1698973121166&sa=X&ved=2ahUKEwiNzfqK0KaCAxURLhAIHXfCAwcQrQIoBHoECBEQBQ)
No, as I said, it's because css style. .TbwUpd.ojE3Fb
has position: absolute
so it's over LC20lb MBeuO DKV0Md
.
I can't enumerate all the possibility of css unless I calculate every position of elements, that's unworkable.
I got it. This is not such a big problem after all.
Finally, I decided to remain line breaks inside links in 1.6.30.22. So please replace rules with below.
c:%element{}.replace(/!\[.*?\]\(.*?\)/g,"").replace(/\[ *\]\(.*?\)\s*/g,"").replace(/\[((.|\n)*?)\](\(.*?\))/g,"$1 $3")
c:%element{}.replace(/!\[.*?\]\(.*?\)/g,"").replace(/\[\s*\]\(.*?\)\s*/g,"").replace(/\[((.|\n)*?)\]\((.*?)\)/g,"{ $1 | $3 }")
Yes, it works!
Is it possible to not treat a whitespace as a line break too?
And somehow the text after Top answer:Â
turned out to be linebreaked.
2 answers (https://stackoverflow.com/a/51625261) Â
·
Top answer:Â
If you want to ensure compatibility with all major browsers, you can use the following ...
No, it's native behaviour, you can try to copy with contextmenu by browser itself and check.
After all, you can use replace to remove it like replace(/\n(.)\n/g,' $1 ')
it means remove the breaks when there is only one character in the line.
OK, thanks a lot!
I found an open source addon, just in JavaScript, which copies the text on the page in the form of Markdown - it handles the processing of the appearance of text, links and pictures very well. https://github.com/0x6b/copy-selection-as-markdown https://addons.mozilla.org/en-US/firefox/addon/copy-selection-as-markdown/
Congratulations, that must be better as a standalone addon.
I would still prefer one universal add-on - SearchJumper :) Is it possible to integrate the above-mentioned script into SearchJumper?
PS. Just remembered that I wanted to ask for a long time - is it possible to separately control the sizes of the toolbar, tiles and disc? If there is a faster way to open the SearchJumper configuration window, other than to click on the SearchJumper icon on the toolbar -> get into the window with all Search engines and click on the SearchJumper icon again there?
No, It's too heavy for SearchJumper.
But you can install the addon and expose interfaces under window. After that you can call the function with javascript:xxx
in engine of SearchJumper.
Ok, I'll split the zoom option.:)
You can visit configuration page through command menu or just open https://hoothin.github.io/SearchJumper/. Create a new engine point to the URL and bind a shortcut key is a good idea too.
You can visit configuration page through command menu Create a new engine point to the URL and bind a shortcut key is a good idea too.
Exactly, these are the two fastest ways.
And yet, before I forgot to ask :), how can I increase the number of shortcuts in one row of the panel so that not 6, but more appear in one line?
Change Show engines number
.
You can't increase the number of shortcuts in one row for now. The style is complex and I have no way to make that customizable.
I knew about the Show engines number
option. I was specifically interested in the question of the number of shortcuts in one line when the panel appeared after selecting text.
1.7.1 has been deployed, you can set the number per line now.
Thanks a lot! There are some nuances.
Sorry but no, both engine icons inside toolbar and tile are the same ones. If I separate them, it means I have to write hundreds lines of css to adjust it. Hide empty space in tile is workable. I will make it later.
Thanks a lot. And what about the font size of the labels above the tiles?
If separating the toolbar and tile icons would be tedious, could the size limit be reduced to, say, 10%?
Which font size do you mean? There are three fonts above the tiles: tips
/word when no icon
/name beside the engine icon
The one with which the phrase "Search in page" was written.
Is this it?
Yes:) Since if the tiles are small and the label is large, it will look somewhat strange.
Hi. Suppose a user selects the following text:
SearchJumper-Text-with-URLs-Video_2023-10-30_231457.webm
-
- Is there a way to give an option to save it into the clipboard in the different following formats: 1. plain text with all embedded URLs under texts' highlights and images (my main concern)
2. html text
3. ordinary plain text