Coder Social home page Coder Social logo

Comments (14)

ssborbis avatar ssborbis commented on August 15, 2024

If I remember correctly, some clipboard features only work properly on https websites, per the browser's security policies. Do you have a particular website or link I can test on?

from contextsearch-web-ext.

Polisson avatar Polisson commented on August 15, 2024

I've found this issue in my corporate environment (intranet site) but before posting this bug I was playing on sites like http://w3.org/, http://gnu.org/, http://nginx.org/ and many others which still use http protocol (be aware that modern browsers prevent browsing non-secured sites, so often redirect happens, like all I've mentioned above, so you have to properly set browser to disable redirecting).
Also, one Polish site is served only without SSL: http://swiat-kamienia.pl/en/

from contextsearch-web-ext.

ssborbis avatar ssborbis commented on August 15, 2024

I believe I have a fix in the master branch. If you're in a position to test, give it a try. Otherwise, the fix will be in the next release.

from contextsearch-web-ext.

Polisson avatar Polisson commented on August 15, 2024

Hi, I've just tested on Chromium-based browser (Brave on Ubuntu) and it seems to me that my issue isn't resolved and even regression occurred.
Copy tool, still gather to clipboard only raw text (now also on insecure websites).
The autocopy feature isn't what I was looking for (but that seems You worked on last commit).
Anyway, thanks for info.

from contextsearch-web-ext.

ssborbis avatar ssborbis commented on August 15, 2024

Hmm. What I had seen was that the copy tool hanged on insecure websites ( spinner.gif, no copy). I had only been testing on Firefox. I'll see what is happening on chrome.

from contextsearch-web-ext.

ssborbis avatar ssborbis commented on August 15, 2024

So the issue you're having is the copy tool is now only copying raw text on insecure sites, and you're looking to copy formatted links, correct? For my own testing, I assume pasting the clipboard contents into a generic word processor will show whether the link formatting is kept? What app are you pasting into?

from contextsearch-web-ext.

Polisson avatar Polisson commented on August 15, 2024

Hmm. What I had seen was that the copy tool hanged on insecure websites ( spinner.gif, no copy). I had only been testing on Firefox. I'll see what is happening on chrome.

Yes, I've observed that also, but "the endless spinner" on firefox+insecured was rather difficult to trigger, the result was only an empty clipboard.

So the issue you're having is the copy tool is now only copying raw text on insecure sites, and you're looking to copy formatted links, correct?

Yes, I need to copy formatted links. But to be exact - copy tool is now only copying raw text on secure sites.

For my own testing, I assume pasting the clipboard contents into a generic word processor will show whether the link formatting is kept? What app are you pasting into?

Yeah, if clipboard content is complete, you will see it on pasting to any app which is aware of data types in clipboard.
Generally, I need to paste formatted content to word processors like MS Word on Windows and LibreOffice on Linux.

To clarify: most of the sites I work on, are secured and I can't copy formatted content with Copy tool on them.
However, I've noticed that on unsecured pages, in Chromium-based browsers, the tool works perfectly, but on Firefox it doesn't work at all.
PS: I'm just enhancing first post to better clarification ;-)

from contextsearch-web-ext.

ssborbis avatar ssborbis commented on August 15, 2024

I think this is due to the depreciated javascript document.execCommand("copy") function being used as a fallback on unsecured websites. I had no idea there was functionality being lost by using the preferred Clipboard API in web extensions. I'm toying with a setting that forces the copy commands to use the depreciated function, but I can't guarantee it will work with a particular browser. If you're able to sideload this addon, I'll get you a .zip of a test branch with the additional setting. I had some luck pasting into LibreOffice, but inconsistent results. Even the depreciated command doesn't seem to carry the full formatting in the way a Ctrl-C copy would.

from contextsearch-web-ext.

Polisson avatar Polisson commented on August 15, 2024

OK, actually my profession is software testing (admittedly, I test devices with embedded systems, but when I come across a bug I can't resist from further testing ;-)) If I would have difficulties with sideloading, I'll provide feedback. So give it to me 😄
The Selection Swift Search addon I mentioned in first post can gather the formatted text (don't know if complete, but partially for sure). But it is abandoned now and for Firefox only. I don't know such possibilities in the chromium world.

from contextsearch-web-ext.

ssborbis avatar ssborbis commented on August 15, 2024

Fortunately, sideloading in chromium-based is pretty simple.

Oh, are you highlighting the links to copy them or just right-clicking? That will make a difference in the code I'm testing.

from contextsearch-web-ext.

ssborbis avatar ssborbis commented on August 15, 2024

Using chromium, I have these results with the new setting forcing the depreciated copy function

  1. Ctrl-C
  2. setting off
  3. setting on

image

It looks like there is at least some formatting going on.

from contextsearch-web-ext.

Polisson avatar Polisson commented on August 15, 2024

Yeah! I can confirm your observations. I've just tested on Brave browser. Same as your effect: with copyUseDepreciatedExecCommand parameter turned on, links are followable, fonts have size and style preserved, but colors, font types aren't. That would be sufficient for me. But will it be future-proof (as it is deprecated in JS)?

from contextsearch-web-ext.

ssborbis avatar ssborbis commented on August 15, 2024

But will it be future-proof (as it is deprecated in JS)?

Certainly not, but the execCommand('copy') has been depreciated for years and is still included with all major browsers.

from contextsearch-web-ext.

ssborbis avatar ssborbis commented on August 15, 2024

Changes are live in 1.46.25 in AMO and chromestore

from contextsearch-web-ext.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.