Możliwość dodania API do przeglądarki

This commit is contained in:
Christopher
2024-02-01 03:04:27 +01:00
committed by GitHub
parent b75cc4ebef
commit 3648dd880b
2 changed files with 16 additions and 2 deletions
+15 -1
View File
@@ -1,4 +1,7 @@
let api = "{ADD_YOUR_API_KEY}";
if(getCookie("api") == "")
addApi();
let api = getCookie("api") != "" ? getCookie("api") : "";
let city = getCookie("city") != "" ? getCookie("city") : "3093133";
let type = getCookie("type") != "" ? getCookie("type") : "id";
@@ -66,4 +69,15 @@ function getCookie(cname) {
}
}
return "";
}
function addApi(){
let temp_api = prompt("Podaj swoje API, które zapiszesz w ciasteczkach swojej przeglądarki:");
if(temp_api != null && temp_api != "")
api = temp_api;
setCookie("api", api);
call();
}