Questions tagged [browser-feature-detection]

Feature detection is the practice in web development of determining whether a browser or device supports a certain feature, so as to provide fallbacks for older browsers or allow enhanced functionality in more capable modern browsers.

Filter by
Sorted by
Tagged with
3 votes
2 answers
422 views

How to detect if import.meta is supported by a browser?

In JavaScript running in a browser, to get the current script URI, one can write like in https://stackoverflow.com/a/57364525/3102264: let currentPath = import.meta.url.substring( 0, import.meta.url....
mpromonet's user avatar
  • 11.4k
0 votes
0 answers
29 views

Is there a feature detection equivalent for ARIA attributes, like aria-owns?

Best practice web development would use browser feature detection to determine if a feature is present and properly supported by a browser, instead of say version detection. For example by using CSS....
pzrq's user avatar
  • 1,698
0 votes
1 answer
61 views

Hiding actual window size

I have a problem that requires me to hide/change the actual window size of my browser from the web server. I mean the web server should learn wrong information about my actual agent window size. For ...
MKSOI's user avatar
  • 49
1 vote
0 answers
295 views

Detect "Request Mobile Website” and "Request Desktop Website" in the iphone IOS

I have a problem detecting "Request Mobile Website” and "Request Desktop Website" modes in the iPhone IOS using ReactJs. Because I have a problem (option bar doesn't have values) in the ...
Fatt Sky's user avatar
  • 650
3 votes
1 answer
853 views

How to detect if a browser supports SharedArrayBuffer?

I'm using ffmpeg.wasm in my site but it only works if the browser supports SharedArrayBuffer. Is there a simple way to test using javascript (browser js or nodejs) if the browser has support to it? ...
Fnr's user avatar
  • 2,128
1 vote
0 answers
233 views

Detection of features used on a website or codebase

Feature detection and browser detection are almost standard practice in good web development now, but is it possible to do the opposite? Detect the features used on a website and/or codebase? The ...
Kodzvn's user avatar
  • 55
0 votes
1 answer
85 views

What is the idiomatic way for javascript code to tell if it will run in the Google app script environment?

I'm working with Google Appscript, and after finally understanding the difference between the V8 runtime, the equivalent of standard library and the Web APIs, I think I developing an ok mental model ...
Chris Adams's user avatar
  • 2,741
3 votes
2 answers
275 views

Testing for a feature of regex compilation in IE11

I would like to test for Unicode Regex Property Escapes to avoid compiling a broken regular expression in browsers that do not support it (for example IE11). Ideally, I'd like to write something along ...
James Paterson's user avatar
0 votes
1 answer
219 views

Is there a way in JavaScript to detect if files can be dropped on the used device?

I created a form on a website that allows users to upload files. Users can also drag and drop files onto this form. However, on some devices, it is simply not possible to drag and drop files (e.g. on ...
user1030151's user avatar
-1 votes
1 answer
76 views

Usage of experimental feature of CSS --> element.pseudo(); [closed]

Has anyone tried to use a new feature of CSS, in others words this feature https://developer.mozilla.org/en-US/docs/Web/API/CSSPseudoElement const element = document.querySelector('q'); const ...
Clopsi's user avatar
  • 9
1 vote
0 answers
97 views

How to feature detect if iframe accepts created blob urls as src of iframe

When it comes to support a relatively wider range of web browsers we sometimes need some kind of defensive coding where we check if some feature is supported in a specific browser/version (e.g. IE11). ...
sçuçu's user avatar
  • 2,980
0 votes
1 answer
86 views

How to use browser feature detection to control video attribute muted?

I'm new to web-development. After researching I found that using user agent styles is unreliable for the website to last long term. I've never used feature detection before but was advised that it was ...
Laiqa Mohid's user avatar
3 votes
1 answer
1k views

Javascript feature detect module support for Web Workers

As of Chrome 80, you can create module type workers with new Worker("worker.js", { type: "module" }), and then use module features like import in the worker script. However other ...
AshleysBrain's user avatar
2 votes
1 answer
570 views

How to detect whether browser supports chrome extensions

I need to test whether a web page is loaded in a browser which supports Chrome extensions installed from the Chrome Web Store. * Google Chrome and MS Edge should return a positive result. * Chrome ...
burtyish's user avatar
  • 1,033
1 vote
1 answer
661 views

The question of whether speechSynthesis is allowed to run without user interaction

It seems that speechSynthesis is not allowed to run without user interaction, on some devices, some of the time. My PC browser used to warn about it, but now it works (I don't know if I managed to ...
Digital Ninja's user avatar
0 votes
1 answer
220 views

Feature detection of <a ping> (Hyperlink Auditing)

The ping attribute of the a element is used for hyperlink auditing - basically when a link is followed each url listed in the attribute is 'pinged' with a HTTP POST. According to to Can I Use it's ...
Fowl's user avatar
  • 4,988
0 votes
1 answer
735 views

Using Notification.image or Notification.icon

I'm working on deploying web push for notifications. Everything is working great, but I've come to understand that some browsers do not support Notification.image, or at least do not display said ...
Chris Pratt's user avatar
1 vote
1 answer
458 views

What exactly happens when a browser doesn't support feature queries?

Feature queries are useful for loading CSS conditionally. They let you provide a section of CSS code only to browsers that support a specified feature. @supports (feature-name: feature-value) { /*...
jkdev's user avatar
  • 11.4k
1 vote
0 answers
118 views

Feature detection for Firefox 57+ shared worker bug

As discussed in this question and this bug, shared workers have been badly broken in Firefox since version 57. Basically, the "shared" part is missing. The way it's supposed to work is that creating a ...
dumbmatter's user avatar
  • 9,401
2 votes
1 answer
2k views

Targeting browsers that don't support CSS grid with feature queries

How can I reliable create a fallback for CSS grid styling for browsers that don't support the current spec, with a feature query or media query? According to articles like this one, browsers ignore ...
kslstn's user avatar
  • 1,476
1 vote
1 answer
759 views

Run VBScript in WebBrowser control feature emulation set to IE 11

We have a web browser application that needs to run in emulation mode of IE 11. IE 11 no longer supports VB Script, hence few legacy pages have broken. Any ideas to get it working without much change....
clrsky's user avatar
  • 61
3 votes
1 answer
2k views

Angularjs - client browser fingerprint

Are there any js plugins for angular based frontend that has a standard way of collecting data for analytics on users based on the browser fingerprinting libraries like fingerprint2.js or clientjs?
55597's user avatar
  • 2,033
3 votes
1 answer
648 views

Fallback to manifest file if support for serviceworkers is not supported

I am making an app which will support the "Add to Homescreen" features in Android Chrome and iOS Safari. Since I would like universal offline support for both of these features, but I only want to use ...
bren's user avatar
  • 4,185
0 votes
1 answer
58 views

How does Firefox website able to highlight items on the navigation bar?

I am curious to know as when you install mozilla firefox and they open a website to let you tour the features of the browsers and from the click to call actions they are able to highlight options like ...
Jatin Marwah's user avatar
0 votes
1 answer
55 views

browser feature detection error using (navigator.geoloction)

I have written a script to check if my browser has features. The following script is producing an error: <!DOCTYPE HTML> <html> <head> <title id="title"> code ...
Elias Rub's user avatar
4 votes
2 answers
14k views

CSS hack only for apple iphone

I want to change some CSS property only in the apple iphone devices. Is there any way to find the apply iphone alone. For all deives .menu{ -webkit-transition:all 100ms ease; -moz-transition:...
Kavitha Velayutham's user avatar
3 votes
2 answers
8k views

How to detect if IndexedDB is enabled

I'm wondering how to detect in JavaScript, whether or not IndexedDB is available and enabled. I'm currently doing a test along these lines: if (window.indexedDB) { if ((using_chrome && ...
Marc's user avatar
  • 57
1 vote
0 answers
48 views

Feature detection for pausing of Javascript on inactive tabs

My webapp opens a popup window and then, after an AJAX request in the main window, it updates the URL of the popup window. As I found out, on iOS devices, Javascript doesn't run in the main window ...
AndreKR's user avatar
  • 32.9k
5 votes
1 answer
171 views

How to determine if the browser supports data URIs for hyperlinks

Is there a way to determine whether a browser supports using data URIs for hyperlinks, besides browser sniffing? Here's the context: I'm creating a link that either downloads a CSV file of ...
Thriggle's user avatar
  • 7,019
3 votes
1 answer
1k views

Detect WOFF support with JavaScript?

I have a situation where I’m using Data-URIs to load fonts and only want to use one file type, WOFF. It’s also critical that a fallback font is not used so I’m looking for a way to detect if WOFF is ...
James's user avatar
  • 399
0 votes
0 answers
133 views

Detect support for pointer-events:none on SVG

I have found an issue where trying to use pointer-events:none on SVG's in Safari 5.1.7 for Windows does not work, but works perfectly on div's. How would I go about detecting support for this using; ...
jaredrethman's user avatar
4 votes
1 answer
2k views

CSS @supports vs Checking Support via JS

While searching for a way to check CSS support in browsers I came across two different approaches: CSS and JavaScript. I have used JS before for checking feature support in browsers, but not for CSS ...
NightOwlPrgmr's user avatar
0 votes
1 answer
28 views

Create multiple builds of the same require.js module

Using require.js and r.js, lets say I have a module, "myModule.js". The r.js docs state that they support integration with has.js such that has: { feature: true } transforms something like: ...
gxc's user avatar
  • 5,016
3 votes
0 answers
210 views

Inline svg with png fallback server-side

I'd like to use inline svg code on my site (i.e. <svg> tags instead of <img src="example.svg" />), with a png fallback for browsers < IE9 and < Android 3. Following the concept of ...
nkanderson's user avatar
1 vote
1 answer
504 views

@supports (-webkit-flex-wrap: wrap) doesn't return true when Safari does support it

I am using Safari 7.x. I have the following feature query which always returns false. @supports (-webkit-flex-wrap: wrap) { } What syntax do I need to use for this to return true when safari does ...
rix's user avatar
  • 10.2k
1 vote
1 answer
71 views

Using feature detection to check support for reserved words via dot notation

I am working on a site where we still need to support IE8, and we are trying to include the Twitter share button widget. In IE8 we are seeing the 'Expected Identifier' error. This seems a common ...
Nathan Russell's user avatar
1 vote
1 answer
137 views

How to Unit Test a Feature Testing Function

I am curious if there is a best practice (if any at all) with trying to unit test a feature test. For example, if I have a function called isStyleSupported that detects if a CSS property is supported ...
user141350's user avatar
2 votes
1 answer
4k views

msSaveBlob issues on IE10 version 10.0.9200.16844

I am facing issues in using the msSaveBlob and msSaveOrOpenBlob methods on IE 10. These methods seem to be working on IE 11 and IE 10 version 10.0.9200.17183 but the API fails on IE 10 version 10.0....
Sarvesh's user avatar
  • 637
0 votes
0 answers
125 views

Is there a way to test if a browser fires scroll events in real time?

iOS 8+ now supports "real" scroll events in Safari, firing off events continuously rather than after the scroll event is complete. This means that previously used hacks to make scroll-based ...
Yaron's user avatar
  • 1,895
27 votes
4 answers
12k views

How can I detect CSS Variable support with JavaScript?

The latest version of Firefox has support for CSS Variables, but Chrome, IE and loads of other browsers do not. It should be possible to access a DOM Node or write a little method which returns ...
Andre Mohren's user avatar
2 votes
3 answers
1k views

Why do user agents / browsers lie

I have read several articles on feature detection and that it is more reliable than browser detection because browsers lie. I couldn't find any information on why they lie. Does anyone know the ...
Hobby99's user avatar
  • 703
2 votes
0 answers
128 views

Detect if device has scroll events enabled

With iOS8 out and now supporting live scroll events (hurray!), there is now a lot more reason to include scroll events on the mobile websites. I'm looking for a clean and simple way to detect if the ...
alsweet's user avatar
  • 633
0 votes
1 answer
143 views

How to detect whether browser supports :invalid pseudoclass? [duplicate]

I tried to use Modernizr, but it seems not to support this feature detection. I also read that it is difficult or even inmpossible to access pseudoclasses from javascript, because they are not part ...
user3695711's user avatar
0 votes
0 answers
545 views

Detect ability to place phone calls with javascript from browser [duplicate]

Does anyone know if there is a way to detect the ability to make phone calls from a browser/webpage? I don't necessarily want to know if I'm dealing with a touchscreen or smaller viewport, but rather ...
Thierry Blais's user avatar
2 votes
2 answers
381 views

detect whether the browser supports famo.us

I want to detect whether a visitors browser is capable of running famo.us - if not redirect them. My first thought was Modernizr and detect whether the browser is capable of CSS 3D transformations, ...
amcc's user avatar
  • 523
5 votes
2 answers
3k views

Detect if browser supports data uri scheme with iframes

Internet Explorer does not support the data uri scheme for iframe urls (see http://msdn.microsoft.com/en-us/library/cc848897%28v=vs.85%29.aspx). Other browsers do. As browser detection is loaded with ...
Paul Taylor's user avatar
  • 5,661
2 votes
1 answer
79 views

How to feature-detect event.which in mousemove listeners?

Chrome seems to have event.which === 1 in a mousemove listener if the left mouse button is currently depressed at the time of the move event. But Firefox doesn't; it only sets event.which in ...
callum's user avatar
  • 35k
0 votes
1 answer
76 views

Selecting external CSS file using JS

I want to select a CSS file using a variable from a piece of JS. I'm working on feature detecting to select a specific CSS. Here is the code I'm using to determine the resolution of a screen. I would ...
user3743202's user avatar
3 votes
1 answer
8k views

New Webkits convert decimal comma to ~ dot and vice versa in number-type inputs. Javascript name of that browser feature?

I found a most peculiar browser feature in the latest Chrome (35; Win/Android/iOS) and Safari (7; iOS) versions. If you have a math form with input type="number" and enter a number with a decimal ...
Frank Conijn - Support Ukraine's user avatar
0 votes
1 answer
82 views

Is it possible to check what feature detections my codebase are using from Modernizr?

I recently inherited a huge codebase where the entire Modernizr plugin is included. I'm trying to find out what feature detections that's actually used in the code base so that I can remove all unused ...
moodh's user avatar
  • 2,661