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
F19051662: D19166.id.diff
Fri, Nov 28, 1:27 AM
F18851900: D19166.id.diff
Oct 31 2025, 5:04 AM
F18814215: D19166.diff
Oct 20 2025, 10:23 PM
F18804275: D19166.diff
Oct 18 2025, 7:09 AM
F18791669: D19166.id45912.diff
Oct 16 2025, 4:40 PM
F18762371: D19166.diff
Oct 6 2025, 6:42 PM
F18662976: D19166.diff
Sep 23 2025, 10:00 PM
F18642201: D19166.diff
Sep 18 2025, 10:57 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