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

[BUG] Permissions-Policy header #20

Open
soufianebenyaala opened this issue Feb 6, 2025 · 2 comments
Open

[BUG] Permissions-Policy header #20

soufianebenyaala opened this issue Feb 6, 2025 · 2 comments

Comments

@soufianebenyaala
Copy link

Describe the bug
When running the application, several errors appear in the log. Notably, there is a warning for an unsupported mime type for HEIC images, and multiple console errors related to unrecognized features in the Permissions-Policy header, along with subsequent errors from Cloudflare challenge scripts. Additionally, a renderer process crash is detected.

To Reproduce
Steps to reproduce the behavior:

  1. Run the application on an Android device or emulator.
  2. Navigate to the functionality where HEIC images might be processed or viewed.
  3. Observe the logs where warnings and errors are output, including:
    • W/VideoCapabilities(20447): Unsupported mime image/vnd.android.heic
    • Several I/chromium console errors related to unrecognized features: 'hid', 'payment', 'serial', 'usb'.
    • Errors from Cloudflare challenge endpoints.
    • Finally, an error log indicating a renderer process crash:
      E/chromium(20447): [ERROR:aw_browser_terminator.cc(165)] Renderer process (20833) crash detected (code -1).
      

Expected behavior
The application should not log warnings or errors for unsupported MIME types or unrecognized header features unless they directly affect functionality. The renderer process should remain stable without crashing.

Screenshots

Image

Environment (please complete the following information):

  • Flutter Version: [e.g. 3.27.3]
  • Dart Version: [e.g. 3.1.2]
  • Device: [e.g., device, Pixel 5]
  • OS Version: [e.g., Android 35

Additional context

W/VideoCapabilities(20447): Unsupported mime image/vnd.android.heic
I/chromium(20447): [INFO:CONSOLE(0)] "Error with Permissions-Policy header: Unrecognized feature: 'hid'.", source:  (0)
I/chromium(20447): [INFO:CONSOLE(0)] "Error with Permissions-Policy header: Unrecognized feature: 'payment'.", source:  (0)
I/chromium(20447): [INFO:CONSOLE(0)] "Error with Permissions-Policy header: Unrecognized feature: 'serial'.", source:  (0)
I/chromium(20447): [INFO:CONSOLE(0)] "Error with Permissions-Policy header: Unrecognized feature: 'usb'.", source:  (0)
I/chromium(20447): [INFO:CONSOLE(1)] "Error", source: https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/orchestrate/chl_api/v1?ray=90d9e1eb2a9d5bd1&lang=fr (1)
2
I/chromium(20447): [INFO:CONSOLE(1)] "Grac", source: https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/orchestrate/chl_api/v1?ray=90d9e1eb2a9d5bd1&lang=fr (1)
2
I/chromium(20447): [INFO:CONSOLE(1)] "SbPx", source: https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/orchestrate/chl_api/v1?ray=90d9e1eb2a9d5bd1&lang=fr (1)
2
I/chromium(20447): [INFO:CONSOLE(1)] "[object HTMLAnchorElement]", source: https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/orchestrate/chl_api/v1?ray=90d9e1eb2a9d5bd1&lang=fr (1)
2
I/chromium(20447): [INFO:CONSOLE(1)] "
2
I/chromium(20447): [INFO:CONSOLE(1)] "%c%d font-size:0;color:transparent NaN", source: https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/orchestrate/chl_api/v1?ray=90d9e1eb2a9d5bd1&lang=fr (1)
2
I/chromium(20447): [INFO:CONSOLE(1)] " oQgH: ZINA", source: https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/orchestrate/chl_api/v1?ray=90d9e1eb2a9d5bd1&lang=fr (1)
2
I/chromium(20447): [INFO:CONSOLE(1)] "%c%d font-size:0;color:transparent oQgH: ZINA", source: https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/orchestrate/chl_api/v1?ray=90d9e1eb2a9d5bd1&lang=fr (1)
6
I/chromium(20447): [INFO:CONSOLE(1)] "%c%d font-size:0;color:transparent NaN", source: https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/orchestrate/chl_api/v1?ray=90d9e1eb2a9d5bd1&lang=fr (1)
2
I/chromium(20447): [INFO:CONSOLE(1)] "%c%d font-size:0;color:transparent oQgH: ZINA", source: https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/orchestrate/chl_api/v1?ray=90d9e1eb2a9d5bd1&lang=fr (1)
4
I/chromium(20447): [INFO:CONSOLE(1)] "%c%d font-size:0;color:transparent NaN", source: https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/orchestrate/chl_api/v1?ray=90d9e1eb2a9d5bd1&lang=fr (1)
I/chromium(20447): [INFO:CONSOLE(1)] "console.groupEnd", source: https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/orchestrate/chl_api/v1?ray=90d9e1eb2a9d5bd1&lang=fr (1)
I/chromium(20447): [INFO:CONSOLE(1)] "Request for the Private Access Token challenge.", source: https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/orchestrate/chl_api/v1?ray=90d9e1eb2a9d5bd1&lang=fr (1)
I/chromium(20447): [INFO:CONSOLE(1)] "The next request for the Private Access Token challenge may return a 401 and show a warning in console.", source: https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/orchestrate/chl_api/v1?ray=90d9e1eb2a9d5bd1&lang=fr (1)
I/chromium(20447): [INFO:CONSOLE(1)] "console.groupEnd", source: https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/orchestrate/chl_api/v1?ray=90d9e1eb2a9d5bd1&lang=fr (1)
E/chromium(20447): [ERROR:aw_browser_terminator.cc(165)] Renderer process (20833) crash detected (code -1).
@soufianebenyaala
Copy link
Author

here my code :

import 'package:cloudflare_turnstile/cloudflare_turnstile.dart';
import 'package:flutter/foundation.dart';

class TurnstileService {
  /// Retrives the CloudFlare Turnstile token using invisible mode.
  static Future<String?> get token async {
    // Initialize an instance of invisible Cloudflare Turnstile with your site key
    final turnstile = CloudflareTurnstile.invisible(
      siteKey: '*****************', // Replace with your actual site key
      action: 'login',
      options: TurnstileOptions(
        size: TurnstileSize.normal,
        theme: TurnstileTheme.light,
        refreshExpired: TurnstileRefreshExpired.auto,
        language: 'fr',
        retryAutomatically: false,
        
      ),
    );

    try {
      // Get the Turnstile token
      final token = await turnstile.getToken();
      return token; // Return the token upon success
    } on TurnstileException catch (e) {
      // Handle Turnstile failure
      if (kDebugMode) {
        print('Challenge failed: ${e.message}');
      }
    } finally {
      // Ensure the Turnstile instance is properly disposed of
      turnstile.dispose();
    }

    // Return null if the token couldn't be generated
    return null;
  }
}

@Nika0000
Copy link
Owner

Hi @soufianebenyaala

The Permissions-Policy warnings can be ignored since WebView doesn’t support hid, usb, or serial.

For the renderer crash (aw_browser_terminator.cc(165)), try running the app on a real device to see if the issue persists. Also, note that cloudflare_turnstile uses hardware acceleration by default in WebView, which could be a potential cause.

I’ll also look into disabling these unnecessary Chromium logs

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

2 participants