Skip to content

Commit

Permalink
Fixed safari detection bug
Browse files Browse the repository at this point in the history
Fixed safari detection bug
  • Loading branch information
ijason committed Apr 19, 2014
1 parent 4c9b613 commit a08f46c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions js/smart-app-banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ $(function() {
var iPad = navigator.userAgent.match(/iPad/i) != null; // Check if using an iPad
var iPhone = navigator.userAgent.match(/iPhone/i) != null; // Check if using an iPhone
var safari = navigator.userAgent.match(/Safari/i) != null; // Check if using Safari

var standalone = navigator.standalone;

var appBannerID = $('meta[name=apple-itunes-app]').attr("content"); //Check if using smart app banners
if (!standalone && safari) { safari = false}; //Chrome is just a re-skinning of iOS WebKit UIWebView
if (navigator.userAgent.match('CriOS') && safari) { safari = false}; //Chrome is just a re-skinning of iOS WebKit UIWebView
if (appBannerID != null) {
appBannerID = /app-id=([0-9]+)/.exec(appBannerID)[1]; // maybe developers add some parameter like that app-argument=http://domain.com/path/to/page
if ((iPad || iPhone) && (!safari)) {
Expand Down
2 changes: 1 addition & 1 deletion js/smart-app-banner.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a08f46c

Please sign in to comment.