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.
155
questions
1
vote
2answers
53 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 ...
0
votes
1answer
51 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 ...
-1
votes
1answer
35 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 ...
1
vote
0answers
22 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).
...
0
votes
1answer
25 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 ...
1
vote
1answer
174 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 ...
0
votes
0answers
25 views
Browser Operating System Detection
It seems like most detection algorithms can detect the base OS, but don't go into much details. For example if your OS is linux-based you'll just get Linux as the operating system. I'd like to get ...
0
votes
1answer
169 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 ...
1
vote
1answer
52 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 ...
0
votes
1answer
60 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 ...
0
votes
1answer
94 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 ...
0
votes
1answer
132 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) {
/*...
1
vote
0answers
100 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 ...
2
votes
1answer
1k 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 ...
1
vote
1answer
565 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....
3
votes
1answer
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?
3
votes
1answer
555 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 ...
0
votes
1answer
41 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 ...
0
votes
1answer
46 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 ...
4
votes
2answers
10k 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:...
3
votes
2answers
5k 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 && ...
1
vote
0answers
23 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 ...
5
votes
1answer
137 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 ...
2
votes
1answer
821 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 ...
0
votes
0answers
119 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; ...
2
votes
1answer
1k 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 ...
0
votes
1answer
27 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:
...
3
votes
0answers
198 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 ...
1
vote
1answer
444 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 ...
1
vote
1answer
62 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 ...
1
vote
1answer
102 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 ...
2
votes
1answer
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....
0
votes
0answers
121 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 ...
26
votes
4answers
9k 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 ...
2
votes
3answers
982 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 ...
2
votes
0answers
116 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 ...
0
votes
1answer
90 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 ...
0
votes
0answers
503 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 ...
2
votes
2answers
372 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, ...
5
votes
2answers
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 ...
2
votes
1answer
70 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 ...
0
votes
1answer
65 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 ...
3
votes
1answer
6k 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 ...
0
votes
1answer
74 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 ...
3
votes
1answer
609 views
How do I detect if a browser can open Network Folder inside iframe?
I need to alert users browsing with Chrome that they need to open a page using IE, as it allow open a Network Folder inside iframe.
But I don't want to detect browser, is there a way to detect this ...
2
votes
0answers
765 views
IE9-11 detecting transform-style: preserve-3d
I made a 3d sort of menu for a project and naturally IE is causing problems, because IE10+, even though 3d-transforms work, does not support transform-style: preserve-3d. I tried the workaround ...
3
votes
2answers
4k views
Detect viewport units (with modernizr or normal js) and serve appropriate stylesheet
I actually have an issue im trying to solve since 3 weeks. Im trying to test support for vw units and serve a seperate stylesheet when the browser doesnt support the unit
I read the modernizr ...
10
votes
2answers
4k views
Detect different kind of scrollbars (eg. normal / hidden osx)
Using responsive Layout and a lot of CSS to create a Webpage, I am having a problem with scrollbars being hidden or shown and changing the layout by 17px.
The main problem is that on OSX the ...
0
votes
1answer
176 views
Check if Firefox/Firefox OS/Firefox for Android
I'm working on a snippet for check if the browser is Firefox/Firefox OS/Firefox for Android.
The method for check is the user agent with a little feature detection.
I haven't found a better way with ...
11
votes
3answers
2k views
Newest method to detect small screen
While waiting for responsive design to find the way into a legacy web site, I would like to redirect a browser to a mobile version if the screen is smaller than 480px
Hunting around I came up with
...