Page MenuHomePhabricator

Use "link.getAttribute('href')", not "link.href", to bypass dark browser magic
ClosedPublic

Authored by epriestley on Jun 19 2019, 5:24 PM.
Tags
None
Referenced Files
F19544840: D20590.diff
Fri, Jan 23, 5:44 PM
F19533888: D20590.diff
Tue, Jan 20, 9:03 PM
F19518816: D20590.diff
Thu, Jan 15, 11:43 PM
F19518799: D20590.diff
Thu, Jan 15, 11:36 PM
F19516643: D20590.id49120.diff
Thu, Jan 15, 2:23 AM
F19516079: D20590.diff
Wed, Jan 14, 7:35 PM
F19507363: D20590.id49122.diff
Fri, Jan 9, 7:41 PM
F19507235: D20590.id49122.diff
Fri, Jan 9, 6:44 PM
Subscribers
None

Details

Summary

Ref T13302. In at least some browsers (including Safari and Chrome), when you write this:

<a href="#">...</a>

...and then access <that node>.href, you get http://local-domain-whatever.com/path/to/current/page# back.

This is wonderful, but not what we want. Access the raw attribute value instead, which is # in all browsers.

Test Plan
  • In Safari, Chrome, and Firefox:
  • Clicked "Edit Subtasks" from a task.
  • Clicked "Select" buttons to select several tasks.
  • Before: Clicking these button incorrectly closed the dialog (because of D20573).
  • After: Clicking these buttons now selects tasks without closing the dialog.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable