Copy on Select 2

Tests

Overview and Test Preparation

Process the following tests on Firefox Nightly (during add-on development only), on the minimum supported Firefox, on Debian stable's Firefox, and on an up-to-date ungoogled chromium flatpak. Unless otherwise stated, install the XPI or CRX package with C-o and remove it again when done testing.

The last note above is rather crucial: If you have previously forgotten to do so and notice the presence of some old version of this add-on when you start one of the test browsers below, better remove that version and restart the browser before installing the new version. Otherwise you may end up chasing all sorts of funny phantom symptoms.

Monitor Clipboard vs. Primary Selection

Execute the following command in a terminal to monitor and compare clipboard and primary selection:

watch -t -n1 -x bash -c \
      'c=$( xclip -o -se c ) p=$( xclip -o -se p )
       printf "c:%3d %-74.74s\n" "${#c}" "${c@Q}"
       printf "p:%3d %-74.74s\n" "${#p}" "${p@Q}"
       test "$c" = "$p" && echo PASS || echo FAIL'

Prepare a Local Test File and HTTP Server

It is hard to otherwise find HTTP(non-S) servers and at some time (?) copying from HTTP-served pages has behaved differently than from HTTPS-served pages.

cp ~/work/copy-on-select-2/content/simple.html /tmp/simple.html
while :; do
  { echo $'HTTP/1.1 200 OK\r\n\r\n'; cat /tmp/simple.html; } |
  nc -l 8080
done

Basic Functionality

Reset all options before performing the following tests.

Regular Text (PASS)

When shall we three meet again
In thunder, lightning, or in rain?

Disabled Text Area Text (FAIL)

Text Area Text (FAIL)

Text Area Text with Input Element Option (PASS)

Switch on the input element option and repeat the previous test. (GitHub issue 6)

Text Box Text (FAIL)

Text Box Text with Input Element Option (PASS)

Switch on the input element option and repeat the previous test.

Iframe Text (PASS)

(This test results in a FAIL on Firefox 78. And I am not going to document that otherwise or even work around it!)

Non-Text (FAIL)

Select the following image. Without native copy that should clear the primary selection, but not the clipboard. With native copy it should clear both.

Rich Text (PASS)

When shall we three meet again
In thunder, lightning, or in rain?

Rich Text Paste (with Native Copy Only)

Copy-on-select the rich text from the previous test; paste it into the following content-editable text box and ensure that the markup is preserved.

Tests Requiring Separate Pages

Tests Requiring External Pages

After the first test pass reset all options again; switch on the use of the native copy command; then perform a second pass on above tests.

Option Page

Save and Reset

Error Handling

Dependency Handling

Dark Mode (FF only)

Extended Functionality

Non-Main Button Clicks (PASS)

Main Button Clicks into Existing Selection (PASS)

Triple-Click Whitespace Trimming (FF only, FAIL)

When shall we three meet again
In thunder, lightning, or in rain?

Multi-Range Selection Separation (FF only, FAIL)

When shall we three meet again

In thunder,lightning,or in rain?

Control-Clicks with Existing Selection (FF only, PASS)

Ensure that the multi-range selection separator is on default %0a; select word "hurlyburly" with a double-click; copy some different text from a non-browser source; control-click outside of the existing selection and ensure that this copies the word "hurlyburly" to the clipboard again, but without any leading or trailing newline.