GoogleChromeLabs / text-fragments-polyfill

Apache License 2.0
116 stars 27 forks source link

Feature detection is not working properly #107

Closed nomagick closed 2 years ago

nomagick commented 2 years ago

document.fragmentDirective should be present after polyfill ever loded. Regardless of document.location.hash.

https://github.com/GoogleChromeLabs/text-fragments-polyfill/blob/f4b176f8361bf3f6c5861932d8b8c6c469343335/src/text-fragments.js#L20-L29

My use case:

  1. Detect text-fragments functionality
  2. If text-fragments avaliable, create text-fragments enabled links on the same page.