Editor: token from ?key= URL param (survives per-origin/per-browser storage)
This commit is contained in:
+6
-1
@@ -69,7 +69,12 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
const KEY = "fbEditorToken";
|
const KEY = "fbEditorToken";
|
||||||
let token = localStorage.getItem(KEY) || "";
|
// Accept the token from the URL (?key=…): a bookmarked link survives storage
|
||||||
|
// limits — localStorage is per-origin AND per-browser (Telegram's in-app
|
||||||
|
// browser doesn't share Safari's storage; private mode doesn't persist at all).
|
||||||
|
const urlKey = new URLSearchParams(location.search).get("key");
|
||||||
|
let token = urlKey || localStorage.getItem(KEY) || "";
|
||||||
|
if (urlKey) localStorage.setItem(KEY, urlKey);
|
||||||
let pollTimer = null;
|
let pollTimer = null;
|
||||||
|
|
||||||
async function api(path, opts = {}) {
|
async function api(path, opts = {}) {
|
||||||
|
|||||||
Reference in New Issue
Block a user