Page MenuHomePhabricator

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

Authored by epriestley on Jun 19 2019, 5:24 PM.



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 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

rP Phabricator
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Jun 19 2019, 5:24 PM
epriestley requested review of this revision.Jun 19 2019, 5:25 PM
amckinley accepted this revision.Jun 19 2019, 5:42 PM


This revision is now accepted and ready to land.Jun 19 2019, 5:42 PM