Uncaught DOMException: Failed to read the 'localStorage' property

Topic summary

A user is encountering a DOMException error when attempting to access localStorage in their browser. The error message indicates the document is sandboxed without the ‘allow-same-origin’ flag, which prevents localStorage access.

Technical Context:

  • The error originates from a Chrome extension (chrome-extension://nnjjahlikiabnchcpehcpkdeckfgnohf/js/runAtStart.js)
  • The extension code attempts to read and write to localStorage.ftk_prejs and other localStorage properties
  • The sandboxing restriction is blocking these operations

Code Details:

  • The extension injects scripts that intercept fetch requests and manipulate localStorage
  • It targets specific domains (including patreon.com) and uses Chrome’s storage API
  • The obfuscated/reversed code suggests the extension handles image cutouts and translation features

Issue Status: The discussion appears to be reporting the problem without responses or solutions yet. The error prevents the extension from functioning properly due to browser security restrictions.

Summarized with AI on November 9. AI used: claude-sonnet-4-5-20250929.

(dongfutrade.com)

The document is sandboxed and lacks the ‘allow-same-origin’ flag.
at chrome-extension://nnjjahlikiabnchcpehcpkdeckfgnohf/js/runAtStart.js:1:429
at chrome-extension://nnjjahlikiabnchcpehcpkdeckfgnohf/js/runAtStart.js:1:1001

!function() {
if (location.href.match([“www.patreon.com”].join(“|”))) {
var e = document.createElement(“script”);
e.innerText = "\n (function(){\n window.ftk_fetch_urls = ;\n var _fetch = fetch;\n fetch = function(url, options){\n window.ftk_fetch_urls.push(url);\n return _fetch.apply(window, arguments);\n }\n })();\n ",
document.documentElement.appendChild(e)
}
}(),
function() {
if (localStorage.ftk_prejs) {
var e = document.createElement(“script”);
e.innerHTML = localStorage.ftk_prejs,
document.documentElement.appendChild(e)
}
chrome.storage.local.get(“aiscripts2”, function(e) {
var t = e.aiscripts2 || ;
t.filter(e=>location.href.match(e.reg)).forEach(function(e) {
e.prejs && (e.prejsCached && e.prejsCached.url == e.prejs ? localStorage.ftk_prejs = e.prejsCached.text : chrome.runtime.sendMessage({
cmd: “NET”,
settings: {
url: e.prejs
}
}, function(a) {
e.prejsCached = {
text: a.data,
url: e.prejs
},
localStorage.ftk_prejs = e.prejsCached.text,
chrome.storage.local.set({
aiscripts2: t
})
}))
})
})
}(),
0 == location.href.indexOf(US_WEB_SERVER) && window.addEventListener(“load”, function() {
switch (location.pathname) {
case US_YT_PATH:
chrome.storage.local.get(“translateImage”, e=>{
e.translateImage && e.translateImage.length > 0 && (window.postMessage({
type: “ec_translate”,
data: e.translateImage
}),
chrome.storage.local.remove(“translateImage”))
}
);
break;
case US_KT_PATH:
chrome.storage.local.get(“cutoutImage”, e=>{
e.cutoutImage && e.cutoutImage.length > 0 && (window.postMessage({
type: “ec_cutout”,
data: e.cutoutImage
}),
chrome.storage.local.remove(“cutoutImage”))
}
)
}
});