question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.

See original GitHub issue

Describe the bug Everything works just fine in development mode but I’m getting this error in the devtools console after building my app when i use the tinymce4.7.5 and cookie

tinymce.min.js:2 Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document. at app://./static/tinymce4.7.5/tinymce.min.js:2:334766 at app://./static/tinymce4.7.5/tinymce.min.js:2:337378

Uncaught DOMException: Failed to read the 'cookie' property from 'Document': Access is denied for this document. at Function.i [as set] (app://./js/chunk-vendors.8d12f151.js:70:1078) at Function.i.get (app://./js/chunk-vendors.8d12f151.js:70:1494) at v (app://./js/app.58b4478d.js:1:68573) at Object.9923 (app://./js/app.58b4478d.js:1:68773) at r (app://./js/app.58b4478d.js:1:2352) at Module.d9cd (app://./js/app.58b4478d.js:1:122194) at r (app://./js/app.58b4478d.js:1:2352) at i (app://./js/app.58b4478d.js:1:120363) at app://./js/app.58b4478d.js:1:29578 at Array.reduce (<anonymous>)

To Reproduce yarn electron:build and then open the the app

Expected behavior Get access to LocalStorage and Cookie

Screenshots 123

Environment (please complete the following information): OS and version: windows vs code node version: 12.1.0 npm version: 6.9 yarn version: 1.10.1 vue-cli-plugin-electron-builder version : 1.3.1 electron version: 5.0.1

vue.config.js: `‘use strict’ const path = require(‘path’)

function resolve(dir) { return path.join(__dirname, dir) }

module.exports = { pluginOptions: { electronBuilder: { outputDir: ‘build’, externals: [‘localStorage’, ‘cookie’], chainWebpackRendererProcess: config => { // set svg-sprite-loader config.module .rule(‘svg’) .exclude.add(resolve(‘src/icons’)) .end() config.module .rule(‘icons’) .test(/.svg$/) .include.add(resolve(‘src/icons’)) .end() .use(‘svg-sprite-loader’) .loader(‘svg-sprite-loader’) .options({ symbolId: ‘icon-[name]’ }) .end() } } } }`

Additional context I tried to introduce tinymce in the basic framework, and the same error will occur.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
nklaymancommented, May 9, 2019

These was caused by the app:// scheme not being registered as standard. This is fixed as of version 1.3.2. If you were previously using an older version, you must manually update your background.js:

// Replace
protocol.registerSchemesAsPrivileged([{scheme: 'app', privileges: { secure: true } }])
// With
protocol.registerSchemesAsPrivileged([{scheme: 'app', privileges: { secure: true, standard: true } }])
1reaction
dortonwaycommented, Aug 17, 2022

How to fix the error in usual electron.js?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to read the 'localStorage' property from 'Window'
Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document. ... This exception is thrown when the...
Read more >
Iframe in Chrome error: Failed to read 'localStorage' from ...
This exception is thrown when the "Block third-party cookies and site data" checkbox is set in Content Settings. To find the setting, open...
Read more >
I see Failed to read the 'localStorage' property from 'Window ...
To fix this, you need to change the cookies' settings in your browser. To do this go to Settings > Privacy and security...
Read more >
DOMException: Failed to read the 'localStorage' property from ...
DOMException : Failed to read the 'localStorage' property from 'Window': Access is denied for this document. This is caused by ...
Read more >
Failed to read the 'localStorage' property from 'Window'
Failed to read the 'localStorage ' property from 'Window': Access is denied for this document. I have implemented Chat in my Web site...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found