Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Chromium Cookie issue #443

Open
bagintz opened this issue Jun 6, 2019 · 6 comments
Open

Android Chromium Cookie issue #443

bagintz opened this issue Jun 6, 2019 · 6 comments

Comments

@bagintz
Copy link

bagintz commented Jun 6, 2019

I am getting:

I/chromium: [INFO:CONSOLE(1)] "Uncaught SecurityError: Failed to read the 'cookie' property from 'Document': Access is denied for this document.", source: about:blank (1)

sometimes when getting the cookie. Any suggestions?

@charafau
Copy link
Collaborator

Might be related ? #351

@neigaard
Copy link

I am getting this error also when I try to get the cookies. I am not getting this error when I make a pure Android app, and also I am not getting this error when I am using the webview_flutter plugin, but the webview_flutter plugin has another bug where the keyboard stop working after return from background, and that is as dealbreaker for me also.

If anybody have the time to look into this it would save my project, really :)

@shinriyo
Copy link

@charafau Did you fix?

I/chromium(12350): [INFO:CONSOLE(1)] "Uncaught SecurityError: Failed to read the 'cookie' property from 'Document': Access is denied for this document.", source: chrome-error://chromewebdata/ (1)
E/flutter (12350): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: RangeError (index): Invalid value: Only valid value is 0: 1
E/flutter (12350): #0      List.[] (dart:core-patch/growable_array.dart:146:60)
E/flutter (12350): #1      FlutterWebviewPlugin.getCookies.<anonymous closure> (package:flutter_webview_plugin/src/base.dart:305:34)
E/flutter (12350): #2      List.forEach (dart:core-patch/growable_array.dart:282:8)
E/flutter (12350): #3      FlutterWebviewPlugin.getCookies (package:flutter_webview_plugin/src/base.dart:303:32)
E/flutter (12350): <asynchronous suspension>
E/flutter (12350): #4      _WebViewPageState._saveUserId (package:my_app/web_view_page.dart:306:37)
E/flutter (12350): #5      _WebViewPageState._checkURL (package:imy_app/web_view_page.dart:298:9)
E/flutter (12350): #6      _WebViewPageState.initState.<anonymous closure>.<anonymous closure> (package:my_app/web_view_page.dart:120:11)
E/flutter (12350): #7      State.setState (package:flutter/src/widgets/framework.dart:1233:30)
E/flutter (12350): #8      _WebViewPageState.initState.<anonymous closure> (package:my_app/web_view_page.dart:118:9)
E/flutter (12350): #9      _rootRunUnary (dart:async/zone.dart:1192:38)
E/flutter (12350): #10     _CustomZone.runUnary (dart:async/zone.dart:1085:19)
E/flutter (12350): #11     _CustomZone.runUnaryGuarded (dart:async/zone.dart:987:7)
E/flutter (12350): #12     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
E/flutter (12350): #13     _DelayedData.perform (dart:async/stream_impl.dart:594:14)
E/flutter (12350): #14     _StreamImplEvents.handleNext (dart:async/stream_impl.dart:710:11)
E/flutter (12350): #15     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:670:7)
E/flutter (12350): #16     _rootRun (dart:async/zone.dart:1180:38)
E/flutter (12350): #17     _CustomZone.run (dart:async/zone.dart:1077:19)
E/flutter (12350): #18     _CustomZone.runGuarded (dart:async/zone.dart:979:7)
E/flutter (12350): #19     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1019:23)
E/flutter (12350): #20     _rootRun (dart:async/zone.dart:1184:13)
E/flutter (12350): #21     _CustomZone.run (dart:async/zone.dart:1077:19)
E/flutter (12350): #22     _CustomZone.runGuarded (dart:async/zone.dart:979:7)
E/flutter (12350): #23     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1019:23)
E/flutter (12350): #24     _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
E/flutter (12350): #25     _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)

If I met it, I should reinstall app.

@charafau
Copy link
Collaborator

Haven't touched it but I thought it was fixed. Will try to take a look

@shinriyo
Copy link

I hope to release new one

@shinriyo
Copy link

shinriyo commented Aug 26, 2020

haha. I finally resolve like this.

    try {
      cookies = await _flutterWebViewPlugin.getCookies();
    } catch (e) {
      _flutterWebViewPlugin.cleanCookies();
      _flutterWebViewPlugin.reloadUrl('login-url');
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants