• New to me copying behavior

    From sticks@wolverine01@charter.net to alt.comp.software.firefox on Mon Aug 11 09:55:44 2025
    From Newsgroup: alt.comp.software.firefox

    Though this page does have some links highlighted in blue, when you
    mouse over something else, for me it does not highlight the copied part
    and appears to not be copying at all. By accident, I saw the DeepL icon
    pop up and thought it must actually be copying it. So I tried to copy
    and paste and sure as hell it does copy without highlighting and you can search on what you want in pages like this.

    I had not noticed this behavior before, and wonder how they get the
    browser to think you can't do that by hiding the highlighting? I
    checked other pages, and now realize the copied text seems to be of a
    color that can be different, and must be defined in the page somehow.
    So to do this they define highlighted text as not having a color, or transparent? I noticed it on this page below if you haven't seen this
    before either.

    <https://www.nbcnews.com/politics/justice-department/judge-denies-doj-bid-unseal-ghislaine-maxwell-grand-jury-records-rcna224274>
    --
    Science doesn't support Darwin. Scientists do.

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Andy Burns@usenet@andyburns.uk to alt.comp.software.firefox on Mon Aug 11 16:04:18 2025
    From Newsgroup: alt.comp.software.firefox

    sticks wrote:

    Though this page does have some links highlighted in blue, when you
    mouse over something else, for me it does not highlight the copied part
    and appears to not be copying at all.
    Doesn't seem to do anything "bad" to me, but normally that sort of hack
    is done with javascript intercepting click or copy events, try with js disabled.

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From sticks@wolverine01@charter.net to alt.comp.software.firefox on Mon Aug 11 10:25:11 2025
    From Newsgroup: alt.comp.software.firefox

    On 8/11/2025 10:04 AM, Andy Burns wrote:
    sticks wrote:

    Though this page does have some links highlighted in blue, when you
    mouse over something else, for me it does not highlight the copied
    part and appears to not be copying at all.
    Doesn't seem to do anything "bad" to me, but normally that sort of hack
    is done with javascript intercepting click or copy events, try with js disabled.

    Did not change with JS disabled, but switching to reader view allowed
    the copied text to be highlighted. I've seen before where copying
    appeared not to work, just never noticed it before in this context.
    --
    Science doesn't support Darwin. Scientists do.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Jeff Layman@Jeff@invalid.invalid to alt.comp.software.firefox on Mon Aug 11 18:37:30 2025
    From Newsgroup: alt.comp.software.firefox

    On 11/08/2025 16:04, Andy Burns wrote:
    sticks wrote:

    Though this page does have some links highlighted in blue, when you
    mouse over something else, for me it does not highlight the copied part
    and appears to not be copying at all.
    Doesn't seem to do anything "bad" to me, but normally that sort of hack
    is done with javascript intercepting click or copy events, try with js disabled.

    It "highlights" for me in very pale grey, only just distinguishable from
    the background. The highlighting is a paler blue than usual in Reader mode.
    --
    Jeff
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Andy Burns@usenet@andyburns.uk to alt.comp.software.firefox on Mon Aug 11 20:04:21 2025
    From Newsgroup: alt.comp.software.firefox

    Jeff Layman wrote:

    It "highlights" for me in very pale grey, only just distinguishable from
    the background. The highlighting is a paler blue than usual in Reader mode.

    I think the subtly different blues are the difference between
    <a> tags using --article-body-list-link-color
    while <a:hover> uses --article-body-list-link-hover-color

    The pale grey background will be something like a <p::selection>
    but I can't find it
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Lawrence D'Oliveiro@ldo@nz.invalid to alt.comp.software.firefox on Mon Aug 11 21:52:03 2025
    From Newsgroup: alt.comp.software.firefox

    On Mon, 11 Aug 2025 16:04:18 +0100, Andy Burns wrote:

    ... normally that sort of hack is done with javascript intercepting
    click or copy events ...

    Scripts on Web pages can intercept left-clicks and right-clicks, but
    Firefox seems unique in not allowing interception of shift-right-click. So this should still work to bring up the context menu even if the page tries
    to block it.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From DrunkenThon@drunkenthon@gmail.com to alt.comp.software.firefox on Tue Aug 12 19:22:42 2025
    From Newsgroup: alt.comp.software.firefox

    sticks <wolverine01@charter.net> wrote:
    I had not noticed this behavior before, and wonder how they get the
    browser to think you can't do that by hiding the highlighting? I
    checked other pages, and now realize the copied text seems to be of a
    color that can be different, and must be defined in the page somehow.
    So to do this they define highlighted text as not having a color, or transparent? I noticed it on this page below if you haven't seen this before either.

    If I understand you correctly, this can be done in CSS by using ::selection pseudo-element. Many attributes can be set to a user selected text (background, foreground etc.)

    You can try it here (set the color on the left side, press "Run" button and select the text on the right side):

    https://www.w3schools.com/cssref/tryit.php?filename=trycss_sel_selection
    --
    Best regards,
    DrunkenThon.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From sticks@wolverine01@charter.net to alt.comp.software.firefox on Tue Aug 12 15:01:13 2025
    From Newsgroup: alt.comp.software.firefox

    On 8/12/2025 2:22 PM, DrunkenThon wrote:
    sticks <wolverine01@charter.net> wrote:
    I had not noticed this behavior before, and wonder how they get the
    browser to think you can't do that by hiding the highlighting? I
    checked other pages, and now realize the copied text seems to be of a
    color that can be different, and must be defined in the page somehow.
    So to do this they define highlighted text as not having a color, or
    transparent? I noticed it on this page below if you haven't seen this
    before either.

    If I understand you correctly, this can be done in CSS by using ::selection pseudo-element. Many attributes can be set to a user selected text (background,
    foreground etc.)

    You can try it here (set the color on the left side, press "Run" button and select the text on the right side):

    https://www.w3schools.com/cssref/tryit.php?filename=trycss_sel_selection

    Yep, you nailed what I'm seeing. If you remove both the color value and
    the background value, it still will copy what you select, but nothing is highlighted.

    Kind of funny on that page, they misspelled selection as selction.

    Thanks! Now I know it's CSS and not javascript.
    I'll go and see if this is in the page I referenced.
    --
    Science doesn't support Darwin. Scientists do.
    --- Synchronet 3.21a-Linux NewsLink 1.2