Page MenuHomePhabricator

Prevent copying Harbormaster build log line numbers with CSS psuedocontent instead of ZWS
ClosedPublic

Authored by epriestley on Mar 1 2018, 4:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jul 1, 7:33 AM
Unknown Object (File)
Tue, Jun 24, 1:06 AM
Unknown Object (File)
Tue, Jun 3, 7:29 PM
Unknown Object (File)
Jun 2 2025, 1:49 AM
Unknown Object (File)
May 31 2025, 12:12 PM
Unknown Object (File)
Apr 25 2025, 1:59 AM
Unknown Object (File)
Apr 24 2025, 6:39 AM
Unknown Object (File)
Apr 20 2025, 2:21 PM
Subscribers
Restricted Owners Package

Details

Summary

Depends on D19165. Ref T13088. Currently, in other applications, we use Zero Width Spaces and Javascript "copy" listeners to prevent line numbers from being copied. This isn't terribly elegant.

Modern browsers support a second approach: using psuedo-elements with content. Try this in Harbormaster since it's conceptually cleaner, at least. One immediate drawback is that Command-F can't find this text either.

Test Plan

In Safari, Chrome and Firefox, highlighted ranges of lines and copy/pasted text. Got just text (no line numbers) in all cases.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable