How to access localstorage property in flutter windows app. #2666
Unanswered
rudraraj3004
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I received the error when data try to save on html side. Error = SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
Here is my code
InAppWebView(
initialData: InAppWebViewInitialData(
data: widget.html,
encoding: 'utf-8',
mimeType: 'text/html',
baseUrl: WebUri("http://localhost:8080"),
),
initialSettings: _settings,
onWebViewCreated: (controller) async {
_appWebViewController = controller;
},
onLoadStop: (controller, url) async {
try {
await _loadAssets();
''';
} else {
jsCode = '''
localStorage.removeItem('pumpermanifest_signature_config');
localStorage.removeItem('PumperName');
localStorage.removeItem('UniqueID');
''';
}
);
Beta Was this translation helpful? Give feedback.
All reactions