10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-07-23 03:07:44 +02:00

Add warning message to console if navigator.clipboard.writeText() not present

This commit is contained in:
Mickaël Véril 2019-09-10 14:10:57 +02:00
parent 6630ac3b28
commit 0e324735c5

View File

@ -14,7 +14,16 @@
if(typeof(navigator.clipboard) == 'undefined' || typeof(navigator.clipboard.writeText) === 'undefined'){
btn_clip=document.getElementById("btn_clip");
btn_clip.disabled = true;
btn_clip.title="This feature is not supported in this bowser\n we recomend to use Firefox or a Chromium based browser like Google Chrome"
var browsers= {};
browsers["Chromium"]="https://www.mozilla.org/fr/firefox";
browsers["Firefox"]="https://chromium.woolyss.com/download";
var recomsting="We recomend to use Firefox or a Chromium based browser like Google Chrome";
btn_clip.title='This feature is not supported in this bowser\n'+recomsting;
var mystr='navigator.clipboard.writeText() not supported in this browser\n'+recomsting;
for(var key in browsers) {
mystr+="\n"+String.raw`Download ${key} : ${browsers[key]}`;
}
console.warn(mystr);
}
if(location.hash.length>1){
var filename=location.hash.substr(1);
@ -32,8 +41,6 @@
else {
document.getElementById('error_P').hidden=false;
errNode;
}
}
</script>