Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add detect/tests for prefetch #2610

Merged
merged 3 commits into from Oct 26, 2020

Conversation

HeroProtagonist
Copy link
Contributor

Closes #2536

@robin-drexler
Copy link

Hey, just stumbled upon this. This check may exclude IE11 which appears to support prefetch, but not relList :(

This isn’t an issue for preload because IE supports neither.

@HeroProtagonist
Copy link
Contributor Author

Do any of the detects do browser detection for a case like this?
I see a User Agent parser here, but not in source code

var ua = new UAParser(navigator.userAgent).getResult();

@@ -0,0 +1,27 @@
/*!
Copy link
Member

@rejas rejas Oct 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

creating a "rel" directory for this test only seems overkill. isnt there a better place for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can move it, just was thinking a follow up pr would be for rel=preload

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I propose putting it in a "link" subdirectory, since it is a test on the link element ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@rejas
Copy link
Member

rejas commented Oct 21, 2020

yeah, that UAparser is onyl used during testing of Modernizr to check against the caniuse database. It is generally not advised to use it in normal feature tests.

@HeroProtagonist
Copy link
Contributor Author

yeah, that UAparser is onyl used during testing of Modernizr to check against the caniuse database. It is generally not advised to use it in normal feature tests.

Looks like navigator.userAgent is used in some detections. Maybe that is a better option

https://github.com/Modernizr/Modernizr/search?q=navigator.userAgent

@rejas
Copy link
Member

rejas commented Oct 23, 2020

Yes, that sounds reasonable :-)

@HeroProtagonist
Copy link
Contributor Author

@rejas Added ie11 check using document.documentMode which is used in other parts of the code for similar IE specific detection

@rejas rejas merged commit 67eb032 into Modernizr:master Oct 26, 2020
@rejas
Copy link
Member

rejas commented Oct 26, 2020

Thanks for the PR and your persistence :-) Merged!

rejas pushed a commit that referenced this pull request Oct 12, 2021
* Add detect/tests for prefetch

* Move to link directory

* Add in check for ie11 edge case
rejas pushed a commit that referenced this pull request Oct 14, 2021
* Add detect/tests for prefetch

* Move to link directory

* Add in check for ie11 edge case
rejas pushed a commit that referenced this pull request Jan 30, 2022
* Add detect/tests for prefetch

* Move to link directory

* Add in check for ie11 edge case
rejas added a commit that referenced this pull request Jan 30, 2022
* Add avif detection (#2539)

* Add avif detection

* Add tests

Both the integration test and the caniuse test

* Add polyfill

* Add support for ResizeObserver (#2582)

* Add Clipboard API (#2573)

* Add Clipboard API testing

* Implement sub-modules (but badly)

* Solve ESLint errors 🙄

* Improve the sub-properties detection

* Move feature detect location

* Add detection for support of scrollToOptions mode of window.scrollTo() (#2575)

* Add detect/tests for prefetch (#2610)

* Add detect/tests for prefetch

* Move to link directory

* Add in check for ie11 edge case

* Add feature detection for IndexedDB 2.0 (#2607)

* Add a|area[ping] detection (#2671)

* Add a|area[ping] detect

* add aping|areaping to integration tests

* Add author tag

* Add Mediastream feature detect (#2669)

* Create mediastream.js

* added mediarecorder as test

* Update config-all.json

* Added metadata to mediastream.js

* Update mediastream.js

* Removed extra line, added a new tag 'media'

* moved mediastream.js to /webrtc dir

* Update config-all.json

* Add test for :focus-visible and fix wrong references in :focus-within (#2665)

* Create focusvisible.js

* Fix wrong reference to CSS focus-within feature

* Fix wrong reference for CSS focus-within feature

* Add css-focus-visible to caniuse integration tests

* Include focusvisible in config-all.json

* Add authors tag to focusvisible.js

Co-authored-by: Markel F <github@markel.dev>
Co-authored-by: Christian Andersson <chris.chris.90@hotmail.com>
Co-authored-by: Chris Smith <chris13524@users.noreply.github.com>
Co-authored-by: Jordan Tepper <jstepper91@gmail.com>
Co-authored-by: Tan Zhen Yong <Xenonym@users.noreply.github.com>
Co-authored-by: Hélio Correia <dev@heliocorreia.org>
Co-authored-by: Onkar Dahale <dahaleonkar@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rel Prefetch Support?
3 participants