browser-update
Advanced tools
Comparing version 2.0.0 to 2.1.0
{ | ||
"name": "browser-update", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Remind users to update their browser in an unobtrusive way.", | ||
@@ -5,0 +5,0 @@ "main": "update.npm.full.js", |
@@ -31,3 +31,3 @@ # browser-update | ||
```` | ||
````js | ||
var browserUpdate = require('browser-update/update.npm.js'); | ||
@@ -34,0 +34,0 @@ browserUpdate({ [configuration-options] }) |
@@ -12,3 +12,3 @@ //(c)2017, MIT Style License <browser-update.org/LICENSE.txt> | ||
ignore("niche browser","Dorado|Whale|SamsungBrowser|MIDP|wii|UCBrowser|Chromium|Puffin|Opera Mini|maxthon|maxton|dolfin|dolphin|seamonkey|opera mini|netfront|moblin|maemo|arora|kazehakase|epiphany|konqueror|rekonq|symbian|webos|PaleMoon|QupZilla|Otter|Midori|qutebrowser") || | ||
ignore("mobile without upgrade path or landing page","kindle|silk|blackberry|bb10|RIM|PlayBook|meego|nokia|ZuneWP7") || | ||
ignore("mobile without upgrade path or landing page","kindle|silk|blackberry|bb10|RIM|PlayBook|meego|nokia|ZuneWP7|537.85.10") || | ||
ignore("android(chrome) web view","; wv"); | ||
@@ -38,3 +38,3 @@ var mobile=(/iphone|ipod|ipad|android|mobile|phone|ios|iemobile/i.test(ua)); | ||
for (var i=0; i < pats.length; i++) { | ||
if (ua.match(new RegExp(pats[i][0].replace("VV","(\\d+\\.?\\d?)")),"i")) { | ||
if (ua.match(new RegExp(pats[i][0].replace("VV","(\\d+\\.?\\d?)"),"i"))) { | ||
n=pats[i][1]; | ||
@@ -44,3 +44,8 @@ break; | ||
} | ||
var v=parseFloat(RegExp.$1); | ||
if (n==="v"||n==="y") {//zero pad semver for easy comparing | ||
var parts = (RegExp.$1).split('.'); | ||
var v=parseFloat(parts[0] + "." + ("00".substring(0, 2 - parts[1].length) + parts[1])); | ||
} | ||
else | ||
var v=parseFloat(RegExp.$1); | ||
@@ -56,3 +61,3 @@ if (!n) | ||
if (/iphone|ipod|ipad|ios/i.test(ua)) { | ||
ua.replace("_",".").match(new RegExp("OS.(\\d+\\.?\\d?)"),"i");// | ||
ua.replace("_",".").match(new RegExp("OS.(\\d+\\.?\\d?)","i"));// | ||
n="iOS"; | ||
@@ -107,8 +112,8 @@ v=parseFloat(RegExp.$1); | ||
op.apiver=op.api||op.c||-1; | ||
var vsakt = {i:12,f:52,o:43,s:10,n:20,c:56,y:17.3,v:1.8}; | ||
var vsdefault = {i:-2,f:-4,o:-4,s:-1.7,n:12,c:-4,a:534,y:-1,v:-0.2}; | ||
var vsakt = {i:12,f:53,o:44,s:10.1,n:20,c:58,y:17.04,v:1.10}; | ||
var vsdefault = {i:-2,f:-4,o:-4,s:-1.7,n:12,c:-4,a:534,y:-0.2,v:-0.2}; | ||
if (op.apiver<4) | ||
vsmin={i:9,f:10,o:20,s:7,n:12}; | ||
vsmin={i:9,f:10,o:20,s:7}; | ||
else | ||
vsmin={i:8,f:5,o:12.5,s:6.2,n:12}; | ||
vsmin={i:8,f:5,o:12.5,s:6.2}; | ||
var myvs=op.vs||{}; | ||
@@ -138,7 +143,11 @@ var vs =op.vs||vsdefault; | ||
op.test=test||op.test||(location.hash=="#test-bu")||(location.hash=="#test-bu-beta")||false; | ||
op.test=test||op.test||(location.hash==="#test-bu")||(location.hash==="#test-bu-beta")||false; | ||
var bb=$bu_getBrowser(); | ||
if (!op.test && (!bb || !bb.n || bb.n=="x" || bb.donotnotify!==false || (document.cookie.indexOf("browserupdateorg=pause")>-1 && op.reminder>0) || bb.v>vs[bb.n] || (bb.mobile&&op.mobile===false) )) | ||
return; | ||
if (!op.test) { | ||
if (!bb || !bb.n || bb.n==="x" || bb.donotnotify!==false || (document.cookie.indexOf("browserupdateorg=pause")>-1 && op.reminder>0)) | ||
return; | ||
if (bb.v>vs[bb.n] || (bb.mobile&&op.mobile===false) ) | ||
return; | ||
} | ||
@@ -193,3 +202,3 @@ op.setCookie=function(hours) { | ||
var t={}; | ||
t.en='<b>Your web browser ({brow_name}) is out of date.</b> For more security, comfort and the best experience on this site: <a{up_but}>Update your browser</a> <a{ignore_but}>Ignore</a>'; | ||
t.en='<b>Your web browser ({brow_name}) is out of date.</b> Update your browser for more security, speed and the best experience on this site. <a{up_but}>Update your browser</a> <a{ignore_but}>Ignore</a>'; | ||
@@ -203,3 +212,3 @@ | ||
t.da='<b>Din netbrowser ({brow_name}) er forældet.</b> Opdater din browser for mere sikkerhed, komfort og den bedste oplevelse på denne side. <a{up_but}>Opdater browser</a> <a{ignore_but}>Ignorer</a>'; | ||
t.de='<b>Ihr Browser ({brow_name}) ist veraltet.</b> <span>Aktualisieren Sie Ihren Browser für mehr Sicherheit, Komfort und die einwandfreie Nutzung dieser Webseite.</span> <a{up_but}>Browser aktualisieren</a> <a{ignore_but}>Ignorieren</a>'; | ||
t.de='<p><b>Ihr Browser ({brow_name}) ist veraltet.</b> Aktualisieren Sie Ihren Browser für mehr Sicherheit, Komfort und die einwandfreie Nutzung dieser Webseite.</p> <a{up_but}>Browser aktualisieren</a> <a{ignore_but}>Ignorieren</a>'; | ||
t.el='<b>Η έκδοση του προγράμματος περιήγησής σας ({brow_name}) είναι παλιά.</b> Ενημερώστε τον περιηγητή σας για περισσότερη ασφάλεια, άνεση και την βέλτιστη εμπειρία σε αυτή την ιστοσελίδα. <a{up_but}>Αναβάθμιση περιηγητή</a> <a{ignore_but}>Παράβλεψη</a>'; | ||
@@ -254,9 +263,9 @@ t.es='<b>Tu navegador web ({brow_name}) no está actualizado.</b> Actualiza tu navegador para tener más seguridad y comodidad y tener la mejor experiencia en este sitio. <a{up_but}>Actualizar navegador</a> <a{ignore_but}>Ignorar</a>'; | ||
var style='<style>.buorg {background: #FDF2AB no-repeat 14px center url('+burl+'img/small/'+bb.n+'.png);}</style>'; | ||
var style2='<style>.buorg {background-position: 8px 17px; position:absolute;position:fixed;z-index:111111; width:100%; top:0px; left:0px; border-bottom:1px solid #A29330; text-align:left; cursor:pointer; background-color: #fff8ea; font: 17px Calibri,Helvetica,Arial,sans-serif; box-shadow: 0 0 5px rgba(0,0,0,0.2);}\ | ||
.buorg div { padding: 11px 12px 11px 30px; line-height: 1.7em; }\ | ||
.buorg div a,.buorg div a:visited{ text-indent: 0; color: #fff; text-decoration: none; box-shadow: 0 0 2px rgba(0,0,0,0.4); padding: 1px 10px; border-radius: 4px; font-weight: normal; background: #5ab400; white-space: nowrap; margin: 0 2px; display: inline-block;}\ | ||
#buorgig{ background-color: #edbc68;}\ | ||
@media only screen and (max-width: 700px){.buorg div { padding:5px 12px 5px 9px; text-indent: 22px;line-height: 1.3em;}.buorg {background-position: 9px 8px;}}\ | ||
@keyframes buorgfly {from {opacity:0;transform:translateY(-50px)} to {opacity:1;transform:translateY(0px)}} \ | ||
.buorg { animation-name: buorgfly; animation-duration: 1s; animation-timing-function: ease-out;}</style>'; | ||
var style2='<style>.buorg {background-color: #edbc68; background-position: 8px 17px; position:absolute;position:fixed;z-index:111111; width:100%; top:0px; left:0px; border-bottom:1px solid #A29330; text-align:left; cursor:pointer; background-color: #fff8ea; font: 17px Calibri,Helvetica,Arial,sans-serif; box-shadow: 0 0 5px rgba(0,0,0,0.2); animation: buorgfly 1s ease-out;}\ | ||
.buorg p { padding: 11px 12px 11px 30px; margin: 0; line-height: 1.7em; }\ | ||
.buorg-button { text-indent: 0; color: #fff; text-decoration: none; box-shadow: 0 0 2px rgba(0,0,0,0.4); padding: 1px 10px; border-radius: 4px; font-weight: normal; background: #5ab400; white-space: nowrap; margin: 0 2px; display: inline-block;}\ | ||
.buorg-update {margin-left: 5px}\ | ||
.buorg-ignore {background:#edbc68}\ | ||
@media only screen and (max-width: 700px){.buorg p { padding:5px 12px 5px 9px; text-indent: 22px;line-height: 1.3em;}.buorg {background-position: 9px 8px;}}\ | ||
@keyframes buorgfly {from {opacity:0;transform:translateY(-50px)} to {opacity:1;transform:translateY(0px)}}</style>'; | ||
@@ -280,4 +289,3 @@ if (t.indexOf("{brow_name}")===-1) {//legacy style | ||
else if (op.position === "corner") { | ||
style2 += "<style>.buorg { width:300px; top:50px; right:50px; left:auto; border:1px solid #A29330; } .buorg div b {display:block;} .buorg div span { display: block; } .buorg div a {margin: 4px 2px;}\ | ||
</style>"; | ||
style2 += "<style>.buorg { width:300px; top:50px; right:50px; left:auto; border:1px solid #A29330; } .buorg div b {display:block;} .buorg div span { display: block; } .buorg div a {margin: 4px 2px;}</style>"; | ||
} | ||
@@ -287,4 +295,4 @@ else { | ||
} | ||
t = t.replace("{brow_name}", bb.t).replace("{up_but}", ' id="buorgul" href="' + op.url + '"' + tar).replace("{ignore_but}", ' id="buorgig" href=""'); | ||
div.innerHTML = '<div>' + t + '</div>' + style+style2; | ||
t = t.replace("{brow_name}", bb.t).replace("{up_but}", ' id="buorgul" class="buorg-button buorg-update" href="' + op.url + '"' + tar).replace("{ignore_but}", ' id="buorgig" class="buorg-button buorg-ignore" href=""'); | ||
div.innerHTML = '<p>' + t + '</p>' + style+style2; | ||
} | ||
@@ -291,0 +299,0 @@ |
@@ -12,3 +12,3 @@ //(c)2017, MIT Style License <browser-update.org/LICENSE.txt> | ||
ignore("niche browser","Dorado|Whale|SamsungBrowser|MIDP|wii|UCBrowser|Chromium|Puffin|Opera Mini|maxthon|maxton|dolfin|dolphin|seamonkey|opera mini|netfront|moblin|maemo|arora|kazehakase|epiphany|konqueror|rekonq|symbian|webos|PaleMoon|QupZilla|Otter|Midori|qutebrowser") || | ||
ignore("mobile without upgrade path or landing page","kindle|silk|blackberry|bb10|RIM|PlayBook|meego|nokia|ZuneWP7") || | ||
ignore("mobile without upgrade path or landing page","kindle|silk|blackberry|bb10|RIM|PlayBook|meego|nokia|ZuneWP7|537.85.10") || | ||
ignore("android(chrome) web view","; wv"); | ||
@@ -38,3 +38,3 @@ var mobile=(/iphone|ipod|ipad|android|mobile|phone|ios|iemobile/i.test(ua)); | ||
for (var i=0; i < pats.length; i++) { | ||
if (ua.match(new RegExp(pats[i][0].replace("VV","(\\d+\\.?\\d?)")),"i")) { | ||
if (ua.match(new RegExp(pats[i][0].replace("VV","(\\d+\\.?\\d?)"),"i"))) { | ||
n=pats[i][1]; | ||
@@ -44,3 +44,8 @@ break; | ||
} | ||
var v=parseFloat(RegExp.$1); | ||
if (n==="v"||n==="y") {//zero pad semver for easy comparing | ||
var parts = (RegExp.$1).split('.'); | ||
var v=parseFloat(parts[0] + "." + ("00".substring(0, 2 - parts[1].length) + parts[1])); | ||
} | ||
else | ||
var v=parseFloat(RegExp.$1); | ||
@@ -56,3 +61,3 @@ if (!n) | ||
if (/iphone|ipod|ipad|ios/i.test(ua)) { | ||
ua.replace("_",".").match(new RegExp("OS.(\\d+\\.?\\d?)"),"i");// | ||
ua.replace("_",".").match(new RegExp("OS.(\\d+\\.?\\d?)","i"));// | ||
n="iOS"; | ||
@@ -107,8 +112,8 @@ v=parseFloat(RegExp.$1); | ||
op.apiver=op.api||op.c||-1; | ||
var vsakt = {i:12,f:52,o:43,s:10,n:20,c:56,y:17.3,v:1.8}; | ||
var vsdefault = {i:-2,f:-4,o:-4,s:-1.7,n:12,c:-4,a:534,y:-1,v:-0.2}; | ||
var vsakt = {i:12,f:53,o:44,s:10.1,n:20,c:58,y:17.04,v:1.10}; | ||
var vsdefault = {i:-2,f:-4,o:-4,s:-1.7,n:12,c:-4,a:534,y:-0.2,v:-0.2}; | ||
if (op.apiver<4) | ||
vsmin={i:9,f:10,o:20,s:7,n:12}; | ||
vsmin={i:9,f:10,o:20,s:7}; | ||
else | ||
vsmin={i:8,f:5,o:12.5,s:6.2,n:12}; | ||
vsmin={i:8,f:5,o:12.5,s:6.2}; | ||
var myvs=op.vs||{}; | ||
@@ -138,7 +143,11 @@ var vs =op.vs||vsdefault; | ||
op.test=test||op.test||(location.hash=="#test-bu")||(location.hash=="#test-bu-beta")||false; | ||
op.test=test||op.test||(location.hash==="#test-bu")||(location.hash==="#test-bu-beta")||false; | ||
var bb=$bu_getBrowser(); | ||
if (!op.test && (!bb || !bb.n || bb.n=="x" || bb.donotnotify!==false || (document.cookie.indexOf("browserupdateorg=pause")>-1 && op.reminder>0) || bb.v>vs[bb.n] || (bb.mobile&&op.mobile===false) )) | ||
return; | ||
if (!op.test) { | ||
if (!bb || !bb.n || bb.n==="x" || bb.donotnotify!==false || (document.cookie.indexOf("browserupdateorg=pause")>-1 && op.reminder>0)) | ||
return; | ||
if (bb.v>vs[bb.n] || (bb.mobile&&op.mobile===false) ) | ||
return; | ||
} | ||
@@ -145,0 +154,0 @@ op.setCookie=function(hours) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
34619
479
0