Comments (16)
from smoothscroll-for-websites.
from smoothscroll-for-websites.
from smoothscroll-for-websites.
As far as I can see most (if not all) changes don’t affect our code
- there will still be a userAgent property for now
- ismobile info will still be there
- isMac will still be able to determine the Boolean
- safari major version check should still run (because it only affects old safari versions that won’t have UA changes)
- IE Win7 UA wont change either
If you can see a point where it breaks we can work on a fix
from smoothscroll-for-websites.
@gblazex I'll list the issues
1
var isMac = /^Mac/.test(navigator.platform);
becomes
var isMac = /^Mac/.test(navigator.userAgentData.platform);
Because navigator.platform
will be deprecated soon!
2
var userAgent = window.navigator.userAgent;
API to become deprecated soon! Migrate to navigator.userAgentData
API.
3
var isMobile = /mobile/i.test(userAgent);
becomes
var isMobile = navigator.userAgentData.mobile;
4
var isIEWin7 = /Windows NT 6.1/i.test(userAgent) && /rv:11/i.test(userAgent);
I'm guessing that stands for "Is Internet Explorer Windows 7".
Will not work anymore, because Phase 5 locks it to Windows 10 on Windows 7, 8 and 8.1 devices.
Internet Explorer is dead and not supported by Client hints, see here as proof:
https://learn.microsoft.com/en-us/microsoft-edge/web-platform/how-to-detect-win11#browsers-that-support-user-agent-client-hints
Browser | Supports differentiation via User-Agent Client Hints? |
---|---|
Microsoft Edge 94+ | Yes |
Chrome 95+ | Yes |
Opera | Yes |
Firefox | No |
Internet Explorer 11 | No |
Therefore this code line is dead in the water and becomes useless.
5
var isEnabledForBrowser = (isChrome || isSafari || isIEWin7) && !isMobile;
becomes
var isEnabledForBrowser = (isChrome || isSafari) && !isMobile;
Due to Phase 5.
6
var isChrome
Will loop through the navigator.userAgentData.brands
for the keyword Google Chrome
(not Chrome
).
7
var isSafari
Will loop through the navigator.userAgentData.brands
for the keyword Safari
.
8
var isEdge
Will loop through the navigator.userAgentData.brands
for the keyword Microsoft Edge
(not Edge
).
9
var isOldSafari
Will loop through the navigator.userAgentData.brands
for the keyword Safari
and check the corresponding version number.
from smoothscroll-for-websites.
10
var isEdge = /Edge/.test(userAgent); // thank you MS
You could remove this line and throw it in the bin. Because User Agent Client Hints API, will give the correct result for Google Chrome
and Safari
browsers and they won't be mixed with Microsoft Edge
browsers. So this code line is not needed now.
from smoothscroll-for-websites.
from smoothscroll-for-websites.
Want to ask you something:
I was thinking why does the repo search for Chrome
browsers to add the smooth slider too.
Would it not be better to search for Chromium
instead. Then this repo can apply the smooth scroll to browsers like: Yandex
, Samsung Internet
, Brave
, Google Chrome
etc. (as they all Chromium
based).
Yah can submit a pr.
from smoothscroll-for-websites.
from smoothscroll-for-websites.
Edge Browser
Versions: EdgeHTML 12.10240 - 18.19041 (are non-chromium based)
Link: https://en.wikipedia.org/wiki/Microsoft_Edge#EdgeHTML
Versions: Edge 79.0.309 onwards (are chromium based)
Therefore Edge 79.0.309 onwards could be grouped with Yandex
, Samsung Internet
, Brave
, Google Chrome
etc. (as they all Chromium
based).
And EdgeHTML
12-18 versions by itself as I'm guessing there was a conflict with smooth scrolling.
from smoothscroll-for-websites.
from smoothscroll-for-websites.
-
EdgeHTML stopped in mid 2020 (better to keep support up to 3 years - so end support end of 2024).
-
IE11 or lower agree to drop it.
-
Windows under version 10 should be dropped, as Microsoft ended support for Windows 7, 8 and 8.1 recently.
Link: https://www.microsoft.com/en-us/windows/end-of-support
And link: https://learn.microsoft.com/en-US/lifecycle/faq/extended-security-updates -
Was reading the issues and seems like Firefox is not supported, could try and add support for desktop and mobile iOS/Android detection.
from smoothscroll-for-websites.
Just going to dump some data here, for anyone that wants to look it up in the future.
(this data correct as of Jan 2023)
Can I Use
Firefox Position
Neutral
- therefore high chance of support in near future.
Safari Position
Conclsuion
All browser support except for IE (dead), Safari and iOS in near future. Apple sucks!
from smoothscroll-for-websites.
from smoothscroll-for-websites.
from smoothscroll-for-websites.
There are hundreds of chromium browsers that I know are active!
But I'm just going to add the most common ones found here:
https://en.wikipedia.org/wiki/Chromium_(web_browser)#Active
At least then it adds smooth scrolling to many commonly used browsers.
from smoothscroll-for-websites.
Related Issues (20)
- [OP has an opinion that doesn't quite know how to articulate well] HOT 4
- Conflict with Mailchimp code snipped
- After passing the url, the plugin does not respond HOT 3
- [Question] smoothscroll program or smoothscroll extension for Google Chrome
- Stuttering since last Chrome update HOT 9
- Publish v1.4.9 to NPM HOT 1
- Safari
- You need to remove the event.keyCode because it's Deprecated HOT 1
- Invalid to use "overflow: hidden" in the body
- Can't control an element with overflow-y: scroll smoothly HOT 2
- Is it possible to release a non-keyboard control version HOT 1
- Problem with youtube video in wordpress HOT 5
- Doesn't make any scroll HOT 6
- Is there a way to activate it even on firefox? HOT 7
- Breaks when using with CSS Scroll Snapping
- Use 'Shift key' to control horizontal scrolling, only direct children of 'body' work
- Unable to preventDefault inside passive event listener due to target being treated as passive. HOT 2
- Edge: parent.keydown is not a function
- Edge: Failed to read 'localStorage' when browser settings restrict touching the storage
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smoothscroll-for-websites.