{"id":32307457,"url":"https://github.com/jakky1/webview_win_floating","last_synced_at":"2026-02-22T03:42:20.091Z","repository":{"id":63709263,"uuid":"570055888","full_name":"jakky1/webview_win_floating","owner":"jakky1","description":"Flutter webView for Windows. It's also a plugin that implements the interface of webview_flutter.","archived":false,"fork":false,"pushed_at":"2025-11-20T08:27:25.000Z","size":285,"stargazers_count":21,"open_issues_count":5,"forks_count":14,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-20T10:18:20.848Z","etag":null,"topics":["flutter","flutter-plugin","webview","webview2","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jakky1.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-11-24T08:34:20.000Z","updated_at":"2025-11-20T08:27:29.000Z","dependencies_parsed_at":"2024-05-05T17:30:58.789Z","dependency_job_id":"38236748-a982-4d9e-bc4b-f75c6d357181","html_url":"https://github.com/jakky1/webview_win_floating","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jakky1/webview_win_floating","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakky1%2Fwebview_win_floating","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakky1%2Fwebview_win_floating/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakky1%2Fwebview_win_floating/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakky1%2Fwebview_win_floating/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakky1","download_url":"https://codeload.github.com/jakky1/webview_win_floating/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakky1%2Fwebview_win_floating/sbom","scorecard":{"id":502806,"data":{"date":"2025-08-11","repo":{"name":"github.com/jakky1/webview_win_floating","commit":"3f1f867c13765d35ad589e219fa85b57e1543a07"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":3,"reason":"2 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 2/22 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T22:24:45.787Z","repository_id":63709263,"created_at":"2025-08-19T22:24:45.787Z","updated_at":"2025-08-19T22:24:45.787Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29704419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T03:17:42.375Z","status":"ssl_error","status_checked_at":"2026-02-22T03:17:31.622Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flutter","flutter-plugin","webview","webview2","windows"],"created_at":"2025-10-23T07:18:13.558Z","updated_at":"2026-02-22T03:42:20.085Z","avatar_url":"https://github.com/jakky1.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webview_win_floating\n\nFlutter webView for Windows / Linux.\nIt's also a plugin that implements the interface of [webview_flutter][1].\n\n#### BREAKING CHANGES\nFor developers upgrading from version 2.x to 3.x, please refer to [API BREAKING CHANGES](https://github.com/jakky1/webview_win_floating/blob/master/BREAKING_CHANGES.md)\n\n![](https://raw.githubusercontent.com/jakky1/webview_win_floating/master/screenshot.jpg)\n\n## Platform Support\n\n| Platform | Support | Use Library\n| :-----: | :-----: | :-----: |\n| Windows | \u0026#x2705; | [WebView2](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.3537.50) |\n|    Linux  |    \u0026#x2705;   | [webkit2gtk-4.1](https://webkitgtk.org/reference/webkit2gtk/2.38.4/) |\n\nYou can call API of [webview_flutter](https://pub.dev/packages/webview_flutter) to use this package.\n\nMeaning your app can run seamlessly across `ALL platforms`.\n\n\n## Features \u0026 Limitations\n\nThis package place a native webview component on top of the window, no texture involved. That's why it called \"floating\", so:\n```\nOn Windows / Linux, \nall Flutter widgets cannot be displayed above the webview.\n```\n\nHowever, since it is a native WebView component, without texture involved, so:\n```\nthe webview runs smoothly at a high fps, \njust the same with a native WebView,\nespecially during playing video or scrolling.\n```\n\nFeatures:\n- runs smooth at a high fps\n- support fullscreen\n- support all platforms (with package `webview_flutter`)\n\nLimitations: (only in Windows / Linux)\n- all the Flutter widgets cannot be displayed on top of the webview\n- cannot push a new route on top of the webview\n- There are some limitation switching focus  between webview and flutter widgets via Tab key.\n- The webview can be put in a scrollable widget, but you may need to assign a ScrollController to the scrollable widget (to enable reposition the webview when scrolling).\n- The webview cannot be clipped by Flutter. So if the webview is put in a scrollable, and the webview is outside of the scrollable, the webview is still visible. (However, if the scrollable is filled with the window size, then this issue can be ignored)\n\nHmm... there are so many limitations.\n\nSo, only use this package when:\n- need to play videos smoothly \n- need a fluid scrolling experience\n- if you don't mind the issue of widgets not being able to display above the webview\n\n## For Linux platform\n\nRefer to [this link](https://github.com/jakky1/webview_win_floating/blob/master/README_Linux.md) to learn about the important considerations when building app.\n\n## Installation\n\nAdd this to your package's `pubspec.yaml` file:\n\n```yaml\ndependencies:\n  webview_win_floating: ^3.0.0\n  webview_flutter: ^4.13.0\n```\n\n# Problem shootting for building fail\n\nIf you build fail with this package, and the error message has the keyword \"**MSB3073**\":\n\n- run \"**flutter build .**\" in command line in [**Administrator**] mode\n\n# Usage\n\n## Use webview now\n\nNOTE: all the interface are supplied by [webview_flutter][1]\n\n```dart\nfinal controller = WebViewController();\n\n@override\nvoid initState() {\n  super.initState();\n  controller.setJavaScriptMode(JavaScriptMode.unrestricted);\n  controller.loadRequest(Uri.parse(\"https://www.google.com/\"));\n}\n\n@override\nWidget build(BuildContext context) {\n  return WebViewWidget(controller: controller);\n}\n```\n\n#### enable javascript\ndon't forgot to add this line if you want to enable javascript:\n```dart\ncontroller.setJavaScriptMode(JavaScriptMode.unrestricted);\n```\n\n#### restricted user navigation\nFor example, to disable the facebook / twitter links in youtube website:\n```dart\ncontroller.setNavigationDelegate(NavigationDelegate(\n  onNavigationRequest: (request) {\n    return request.url.contains(\"youtube\")\n      ? NavigationDecision.navigate\n      : NavigationDecision.prevent;\n  },\n));\n```\n\n#### Communication with javascript\n\nHint: you can rename the name 'myChannelName' in the following code\n```dart\ncontroller.addJavaScriptChannel(\"myChannelName\",\n  onMessageReceived: (JavaScriptMessage jmsg) {\n    String message = jmsg.message;\n    print(message);  // print \"This message is from javascript\"\n  }\n);\n\ncontroller.loadHtmlString(htmlContent);\ncontroller.runJavascript(\"callByDart(100)\");\n\n\nvar htmlContent = '''\n\u003chtml\u003e\n\u003cbody\u003e\n\u003cscript\u003e\nfunction callByDart(int value) {\n    console.log(\"callByDart: \" + value);\n}\nmyChannelName.postMessage(\"This message is from javascript\");\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n''';\n```\n\n#### Listen to events\n\n- onPageStarted\n- onPageFinished\n- onUrlChange\n- onHttpError (e.g. 404 Not Found)\n- onSslAuthError (e.g. SSL certification expired, revoked, untrust)\n- onWebResourceError (for non-ssl error and non-http error. e.g. connect timeout, hostname not found)\n\n```dart\ncontroller.setNavigationDelegate(NavigationDelegate(\n  onPageStarted: (url) {\n    print(\"onPageStarted: $url\");\n  },\n  onPageFinished: (url) {\n    print(\"onPageFinished: $url\");\n  },\n  onUrlChange: (change) {\n    String url = change.url ?? \"\";\n    print(\"onUrlChange: $url\"),\n  },\n  onHttpError: (error) {\n    int httpCode = error.response!.statusCode; // e.g. 403 (Not Found)\n    String url = error.response!.uri.toString();\n    print(\"onHttpError: code=$httpCode, url : $url\");\n  },\n  onSslAuthError: (error) {\n    if (error is WinSslAuthError) {\n      print(\"onSslAuthError: ${(error as WinSslAuthError).url}\");\n    } else {\n      print(\"onSslAuthError: unknown url}\");\n    }\n    error.cancel();\n  },\n  onWebResourceError: (error) {\n    print(\"onWebResourceError: ${error.url} =\u003e ${error.description}\");\n  },\n));\n```\n\n## controller operations\n\n- controller.loadRequest(uri)\n- controller.runJavascript( jsStr )\n- controller.runJavaScriptReturningResult( jsStr )  // return javascript function's return value\n- controller.reload()\n- controller.canGoBack()\n- controller.goBack()\n- controller.goForward()\n- controller.canGoForward()\n- controller.currentUrl()\n- controller.clearCache()\n- controller.enableZoom()\n\n## dispose controller (cleanup webview instance)\n\n```dart\ncontroller = null;\n// and make sure no any WebViewWidget keep that controller object.\n```\n\nAfter official API interface ``webview_flutter: 4.0.0``, controller is disposed after the WebViewController object is garbage collected.\n\nSo the controller object may not be disposed immediately when no any pointer keep the controller object.\n\n## Permission request (e.g., Notification, Camera)\n\nSome websites use javascript to ask webview to provide certain access permissions. For example, javascript ask \"Notification\" permission to show notifications, ask \"Camera\" to access camera device.\n\nYou can decide whether to authorize these permission requests.\n\nFor example, you can test `Notification` permission with the following code, in [this site](https://www.bennish.net/web-notifications.html)\n\n```dart\nfinal controller = WebViewController(onPermissionRequest: (request) {\n  if (Platform.isWindows) {\n    var req = request.platform as WinWebViewPermissionRequest;\n    print(\"permission: ${req.kind} , ${req.url}\");\n    \n    // only allow \"notification\", deny all others\n    if (req.kind == WinWebViewPermissionResourceType.notification) {\n      req.grant();\n    } else {\n      req.deny();\n    }\n  }\n});\n```\n\nIf `onPermissionRequest` is not provided, all the permission requests will be denied automatically:\n```dart\nfinal controller = WebViewController();\n```\n\nDiffrent platforms have different implementations. Windows WebView2 allow you to grant/deny the following permission types:\n```dart\nenum WinWebViewPermissionResourceType {\n  unknown,\n  microphone,\n  camera,\n  geoLocation,\n  notification,\n  otherSensors,\n  clipboardRead\n}\n```\n\n## set user data folder\n\n```dart\nString cacheDir = \"c:\\\\test\";\nvar params = WindowsWebViewControllerCreationParams(userDataFolder: cacheDir);\nvar controller = WebViewController.fromPlatformCreationParams(params);\n```\n\n## Build with InnoSetup\n## Or if application installed in \"C:/Program Files/\" or other read-only dir\n\nIf your application build with InnoSetup, or can be installed in \"C:/Program Files/\" or other read-only system directory, the webview cannot create data folder in read-only directory, so it won't work.\n\nIn this case, you should specify user data folder as mentioned above.\n\n\n# standalone mode\n\nIf your app only runs on Windows, and you want to remove library dependencies as many as possible, you can modify `pubspec.yaml` file:\n\n```yaml\ndependencies:\n  webview_win_floating: ^3.0.0\n  # webview_flutter: ^4.13.0  # mark this line for Windows only app\n```\n\nand modify all the following class name in your code:\n```dart\nWebViewWidget -\u003e WinWebViewWidget  // add \"Win\" prefix\nWebViewController -\u003e WinWebViewController  // add \"Win\" prefix\nNavigationDelegate  -\u003e WinNavigationDelegate  // add \"Win\" prefix\n```\n\njust only modify class names. All the properties / method are the same with [webview_flutter][1]\n\nFor permission grant/deny:\n```dart\nfinal controller = WinWebViewController(onPermissionRequest: (req) {\n  print(\"permission: ${req.kind} , ${req.url}\");\n    \n  // only allow \"notification\", deny all others\n  if (req.kind == WinWebViewPermissionResourceType.notification) {\n    req.grant();\n  } else {\n    req.deny();\n  }\n});\n```\n\nThere are some Windows-only API:\n* onPageTitleChanged` callback in WinNavigationDelegate\n* onHistoryChanged` callback in WinNavigationDelegate\n* controller.openDevTools()\n* controller.dispose()\n* controller.setStatusBar(bool isEnable): show/hide [status bar](https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2settings.isstatusbarenabled)\n\n\n# TroubleShooting\n\n## javascript 'history.back()' issue\n\nIf javascript `history.back()` is used in your project, please remove `NavigationDelegate.onNavigationRequest()` implementation in your code, which causes the `history.back()` work incorrectly.\n\n\n# Example\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:webview_win_floating/webview_win_floating.dart';\nimport 'package:webview_flutter/webview_flutter.dart';\n\nvoid main() {\n  runApp(const MyApp());\n}\n\nclass MyApp extends StatefulWidget {\n  const MyApp({Key? key}) : super(key: key);\n\n  @override\n  State\u003cMyApp\u003e createState() =\u003e _MyAppState();\n}\n\nclass _MyAppState extends State\u003cMyApp\u003e {\n  final controller = WebViewController();\n\n  @override\n  void initState() {\n    super.initState();\n  \n    controller.setJavaScriptMode(JavaScriptMode.unrestricted);\n    controller.loadRequest(Uri.parse(\"https://www.google.com/\"));\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      home: Scaffold(\n        appBar: AppBar(\n          title: const Text('Windows Webview example app'),\n        ),\n        body: WebViewWidget(controller: controller),\n      ),\n    );\n  }\n}\n```\n[1]: https://pub.dev/packages/webview_flutter \"webview_flutter\"","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakky1%2Fwebview_win_floating","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakky1%2Fwebview_win_floating","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakky1%2Fwebview_win_floating/lists"}