Browser detection with Leaflet library - javascript

How to detect the browser using the Leaflet library for JavaScript?

You can use the boolean method L.Browser for browser detection.
For example:
if ( L.Browser.ie ) {
alert( "Using Internet Explorer" );
// ...
}
This method supports the properties:
ie - true for all Internet Explorer versions;
ie6 - true for Internet Explorer 6;
ie7 - true for Internet Explorer 7;
ielt9 - true for Internet Explorer versions less than 9;
edge - true for Microsoft Edge;
webkit - true for webkit-based browsers like Chrome and Safari (including mobile versions);
webkit3d - true for webkit-based browsers that support CSS 3D transformations;
android - true for Android mobile browser;
android23 - true for old Android stock browsers (2 and 3);
mobile - true for modern mobile browsers (including iOS Safari and different Android browsers);
mobileWebkit - true for mobile webkit-based browsers;
mobileOpera - true for mobile Opera;
opera - true for Opera;
touch - true for all browsers on touch devices;
msTouch - true for browsers with Microsoft touch model (e.g. IE10);
retina - true for devices with Retina screens;
chrome - true for Chrome.
Reference: http://leafletjs.com/reference.html#browser.

Related

addEventListener useCapture support on mobile

It seems that the useCapture flag has a pretty good support on desktop browsers.
In this page: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener, at the bottom there is a compatibility table, but it's incomplete for mobile.
So my question is: can i use the useCapture flag on those devices: Android, IE Mobile, Opera Mobile, Safari Mobile?
After a little research, I concluded that it should work the same on those mobiles.
Chrome works the same on android: What are differences between Chrome on Android and Desktop Chrome?
Opera browser on android might works the same than the desktop version: http://www.opera.com/blogs/india/2015/05/which-is-the-best-opera-browser-for-android-phones/
For the main part, safari mobile might work the same as safari desktop: Desktop Safari ( Mac & Windows ) VS Mobile Safari (iPhone) - HTML, CSS, JS support
Ie mobile should work like ie11 desktop: https://en.wikipedia.org/wiki/Internet_Explorer_Mobile

Cannot Play Audios on IE11 and Edge. Javascript Audio Object Not Implemented?

var elAudio = new Audio(audioUrl);
This code works fine on my desktop's (Win10) Chrome, FireFox, Edge and IE11.
The weird thing is, the exact code does not work on Windows 10 laptops and throws an error. Cannot play audios & videos basically on those laptops' IE11 or Edge. Firefox and Chrome are OK.
Tested on 3 Desktops Win10 - OK
Tested on 2 Laptops Win10 - Failed
Is there some sort of configuration somewhere?
I already tried those Internet Options on IE, but no luck.

How can I inspect element in a UC Browser in Android Phone on my machine?

When I use UC Browser for desktop my mobile view working fine.
But when I use UC Browser Mobile App and open my site .. It breaks and take more them for loading.
I just want to inspect remotely UC Browser Mobile app FORCSS/HTML javascript Example we did in Chrome :
As we did in Chrome https://developer.chrome.com/devtools/docs/remote-debugging
Recently we release uc-devtools,a standalone tools to debug the latest developer version of UC Browser.
Check this out:
https://plus.ucweb.com/docs/pwa/docs-zh/xy3whu?locale=en-US
https://plus.ucweb.com is the all in one international supporting site for developer.
As of now you wont be able to connect and debug UC mobile browser on UC browser Desktop directly as like of chrome.
If you are working on any UI issue related UC browser in mobile. You can replicate it on IE emulator[Desktop].
Setting required:
Document Mode: IE10
width 320 or 360.
Orientation : portrait
It will replicate more or less same bugs like UC browser mobile.

Desktop Safari ( Mac & Windows ) VS Mobile Safari (iPhone) - HTML, CSS, JS support

Is support of HTML, CSS and Javascript same in Desktop Safari ( Mac & Windows ) and Mobile Safari (iPhone)?
If I'm making some thing for iPhone Safari and use Desktop version Safari on my Windows 7 PC to test and debugging, after fininsh will it look same on both? Are there any difference between Safari ( Desktop ) and Safari (iphone) in terms of support of HTML, CSS and Javascript?
They are based on the same html render engine - WebKit. Pure HTML, CSS and Javascript are supported in mobile safari and desktop version. But if you are doing sth in Flash or Applet, mobile safari does not support that. Some HTML5 tags are not fully supported, like File/FileSystem interface. You still need to test the pages in mobile safari, although developing them in desktop version safari in first place is a good way.

Which browsers support document.activeElement?

Which web browsers / versions have support for document.activeElement?
This property lets you see which element is active / has focus.
Are there any main gotchas/difference between implementations?
document.activeElement is supported by IE6+, FF3+, Safari 4+, Opera 9+, Chrome 9+. (FF2, Saf3 don't support this property)
It still doesn't work on WebKit based browsers in xhtml page
see https://bugs.webkit.org/show_bug.cgi?id=63922

Categories

Resources