Skip to content

Instantly share code, notes, and snippets.

View godrix's full-sized avatar
💻
trying to take over the world

Godri.dev godrix

💻
trying to take over the world
View GitHub Profile
window.onload = function() {
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
console.log('Dispositivo Movel');
}
}
var ls = window.localStorage;
var array_ls = [];
for(x in ls){
array_ls.push(x);
console.log(x);
}
for(i=0;i<6;i++){
array_ls.pop();
//Forçando navagador a usar o https
console.log(window.location.href);
var protocol = window.location.href;
if (protocol.match(/http:/)){
var newUrl = protocol.replace("http://","https://");
window.location = newUrl;
}else{
console.log('Protocolo seguro');
}