You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by kn...@apache.org on 2019/03/07 04:46:04 UTC
[cordova-plugin-file] branch travis_tests updated: isSafari is added
This is an automated email from the ASF dual-hosted git repository.
knaito pushed a commit to branch travis_tests
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-file.git
The following commit(s) were added to refs/heads/travis_tests by this push:
new 669e5ac isSafari is added
669e5ac is described below
commit 669e5ac97864849666d50e7d95bae89bb3d19875
Author: knaito <kn...@asial.co.jp>
AuthorDate: Thu Mar 7 13:45:42 2019 +0900
isSafari is added
---
plugin.xml | 4 ++++
www/browser/Preparing.js | 2 +-
www/browser/isSafari.js | 25 +++++++++++++++++++++++++
3 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/plugin.xml b/plugin.xml
index 90ff927..817fdd4 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -112,6 +112,10 @@ xmlns:android="http://schemas.android.com/apk/res/android"
<runs />
</js-module>
+ <js-module src="www/browser/isSafari.js" name="isSafari">
+ <runs />
+ </js-module>
+
<!-- android -->
<platform name="android">
<info>
diff --git a/www/browser/Preparing.js b/www/browser/Preparing.js
index b826a65..9b209a0 100644
--- a/www/browser/Preparing.js
+++ b/www/browser/Preparing.js
@@ -23,7 +23,7 @@
/* global require */
// Only Chrome uses this file.
- if (!require('./isChrome')()) {
+ if (!require('./isChrome')() && !require('./isSafari')()) {
return;
}
diff --git a/www/browser/isSafari.js b/www/browser/isSafari.js
new file mode 100644
index 0000000..cf7efd1
--- /dev/null
+++ b/www/browser/isSafari.js
@@ -0,0 +1,25 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+module.exports = function () {
+ var ua = window.navigator.userAgent.toLowerCase();
+ return ua.indexOf('safari') !== -1 && ua.indexOf('chrome') === -1 && ua.indexOf('edge') === -1;
+};
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org