-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
puppeteer.launch error #235
Comments
@zsbox Can you share a full project that I can run and see the error by myself? |
@xvrh sorry,I think I get it, this plugin only supports dart running, and does not support chrome in-app operation, right, for example, I click a button? |
Getting the same error |
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:puppeteer/puppeteer.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(),
home: const HomeView(),
);
}
}
class HomeView extends StatelessWidget {
const HomeView({super.key});
@override
Widget build(BuildContext context) {
Future run() async {
try {
// Download the Chrome binaries, launch it and connect to the "DevTools"
var browser = await puppeteer.launch();
// Open a new tab
var myPage = await browser.newPage();
// Go to a page and wait to be fully loaded
await myPage.goto('https://dart.dev', wait: Until.networkIdle);
// Do something... See other examples
await myPage.screenshot();
await myPage.pdf();
await myPage.evaluate<String>('() => document.title');
// Gracefully close the browser's process
await browser.close();
} catch (e) {
log(e.toString());
}
}
return Scaffold(
body: Center(
child: ElevatedButton(
child: const Text("Run"),
onPressed: () => run(),
),
),
);
}
}
|
@Shiba-Kar where do you run the app? MacOS? iOS? Android? |
|
@Shiba-Kar did you disable sandbox? Additionally you can use already installed chrome path:
|
ProcessException (ProcessException: Operation not permitted
Command: .local-chrome/113.0.5672.63/chrome-mac-x64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing --allow-pre-commit-input --disable-background-networking --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=Translate,BackForwardCache,AcceptCHFrame,MediaRouter,OptimizationHints,DIPS --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --enable-automation --enable-blink-features=IdleDetection --enable-features=NetworkServiceInProcess2 --export-tagged-pdf --force-color-profile=srgb --metrics-recording-only --no-first-run --password-store=basic --use-mock-keychain --headless --hide-scrollbars --mute-audio about:blank --remote-debugging-port=0 --user-data-dir=/var/folders/dy/q8b1npfn7d978xwc68vh4tp00000gn/T/com.example.yudi/puppeteer_dev_profile-FJ3WIl)
----- flutter version 3.10.0 ------
I modified this code, there was another error "Websocket url not found", help me?
"< key >com.apple.security.app-sandbox< /key >< false />"
The text was updated successfully, but these errors were encountered: