实例介绍
SpiderEye是一个允许开发者编写运行在.Net Core上的跨平台应用程序的框架,与Electron不同,SpiderEye使用操作系统原生的webview,而不是捆绑Chromium。这意味着它可以为Windows、Linux和macOS提供更加轻量级和高效的应用程序。
支持的操作系统包括Windows 7/8.x/10/11、任何64位的Linux发行版以及macOS x64 10.13或更新版本。为了在Linux上使用SpiderEye,你需要安装libgtk-3、libwebkit2gtk-4.0等依赖。此外,如果你想在Windows上使用Edge Chromium/WebView2,你需要安装WebView2运行时。
SpiderEye提供了多个项目模板,可以通过NuGet或npm安装。这些模板可以帮助你快速开始跨平台应用程序的开发。无论你是使用Visual Studio、Visual Studio Code还是直接在控制台中,都可以轻松地运行和调试你的SpiderEye应用程序。
开发过程中,你可以根据不同的平台使用不同的方法来调试WebView。例如,在Windows上,你可以通过设置Window.EnableDevTools为true来自动打开开发者工具;在Linux和macOS上,则可以通过运行应用程序后右键选择“Inspect Element”来进行调试。
发布你的应用程序就像发布任何其他.Net Core应用一样简单,你可以使用dotnet publish命令或IDE提供的机制。对于macOS应用,你还需要准备Info.plist文件和适当的文件夹结构。
SpiderEye框架的窗口处理通过调用Linux和macOS上的原生APIs以及Windows上的.NET APIs来完成。它还设置了WebView以拦截请求并提供嵌入在程序集中的文件。
【实例截图】
【核心代码】
文件清单
└── SpiderEye-32e18e882bb0272cea3074634ccc9789158c0395
├── Examples
│ ├── Simple
│ │ ├── App.Core
│ │ │ ├── App
│ │ │ │ ├── index.html
│ │ │ │ ├── site.js
│ │ │ │ └── styles.css
│ │ │ ├── ProgramBase.cs
│ │ │ └── SpiderEye.Example.Simple.Core.csproj
│ │ ├── App.Linux
│ │ │ ├── Program.cs
│ │ │ └── SpiderEye.Example.Simple.Linux.csproj
│ │ ├── App.Mac
│ │ │ ├── Program.cs
│ │ │ └── SpiderEye.Example.Simple.Mac.csproj
│ │ ├── App.Windows
│ │ │ ├── Program.cs
│ │ │ └── SpiderEye.Example.Simple.Windows.csproj
│ │ └── Shared
│ │ ├── publish.bat
│ │ ├── publish.sh
│ │ └── SpiderEye.Example.Simple.Shared.proj
│ ├── Spa
│ │ ├── App.Core
│ │ │ ├── Angular
│ │ │ │ ├── app
│ │ │ │ │ ├── app.component.html
│ │ │ │ │ ├── app.component.scss
│ │ │ │ │ ├── app.component.ts
│ │ │ │ │ └── app.module.ts
│ │ │ │ ├── environments
│ │ │ │ │ ├── environment.prod.ts
│ │ │ │ │ └── environment.ts
│ │ │ │ ├── index.html
│ │ │ │ ├── main.ts
│ │ │ │ ├── polyfills.ts
│ │ │ │ └── styles.scss
│ │ │ ├── AngularDevUriWatcher.cs
│ │ │ ├── angular.json
│ │ │ ├── package.json
│ │ │ ├── package-lock.json
│ │ │ ├── ProgramBase.cs
│ │ │ ├── SpiderEye.Example.Spa.Core.csproj
│ │ │ ├── tsconfig.app.json
│ │ │ └── tsconfig.json
│ │ ├── App.Linux
│ │ │ ├── icon.png
│ │ │ ├── Program.cs
│ │ │ └── SpiderEye.Example.Spa.Linux.csproj
│ │ ├── App.Mac
│ │ │ ├── icon.icns
│ │ │ ├── Program.cs
│ │ │ └── SpiderEye.Example.Spa.Mac.csproj
│ │ ├── App.Windows
│ │ │ ├── icon.ico
│ │ │ ├── Program.cs
│ │ │ └── SpiderEye.Example.Spa.Windows.csproj
│ │ └── Shared
│ │ ├── publish.bat
│ │ ├── publish.sh
│ │ └── SpiderEye.Example.Spa.Shared.proj
│ └── SpiderEye.Examples.sln
├── LICENSE
├── logo.png
├── logo.svg
├── Playground
│ ├── Shared
│ │ ├── publish.bat
│ │ ├── publish.sh
│ │ └── SpiderEye.Playground.Shared.proj
│ ├── SpiderEye.Playground.Core
│ │ ├── Angular
│ │ │ ├── app
│ │ │ │ ├── app.component.html
│ │ │ │ ├── app.component.scss
│ │ │ │ ├── app.component.ts
│ │ │ │ ├── app.module.ts
│ │ │ │ ├── app-routing.module.ts
│ │ │ │ ├── components
│ │ │ │ │ ├── api
│ │ │ │ │ │ ├── api.component.html
│ │ │ │ │ │ ├── api.component.scss
│ │ │ │ │ │ └── api.component.ts
│ │ │ │ │ ├── bridge
│ │ │ │ │ │ ├── bridge.component.html
│ │ │ │ │ │ ├── bridge.component.scss
│ │ │ │ │ │ └── bridge.component.ts
│ │ │ │ │ └── home
│ │ │ │ │ ├── home.component.html
│ │ │ │ │ ├── home.component.scss
│ │ │ │ │ └── home.component.ts
│ │ │ │ ├── models
│ │ │ │ │ ├── power-model.ts
│ │ │ │ │ └── some-data-model.ts
│ │ │ │ └── services
│ │ │ │ └── spidereye.service.ts
│ │ │ ├── environments
│ │ │ │ ├── environment.prod.ts
│ │ │ │ └── environment.ts
│ │ │ ├── index.html
│ │ │ ├── main.ts
│ │ │ ├── polyfills.ts
│ │ │ └── styles
│ │ │ ├── loading.scss
│ │ │ ├── site.scss
│ │ │ ├── theme.scss
│ │ │ └── variables.scss
│ │ ├── AngularDevUriWatcher.cs
│ │ ├── angular.json
│ │ ├── Bridge
│ │ │ ├── Models
│ │ │ │ ├── PowerModel.cs
│ │ │ │ └── SomeDataModel.cs
│ │ │ └── UiBridge.cs
│ │ ├── package.json
│ │ ├── package-lock.json
│ │ ├── ProgramBase.cs
│ │ ├── SpiderEye.Playground.Core.csproj
│ │ ├── tsconfig.app.json
│ │ └── tsconfig.json
│ ├── SpiderEye.Playground.Linux
│ │ ├── icon.png
│ │ ├── Program.cs
│ │ └── SpiderEye.Playground.Linux.csproj
│ ├── SpiderEye.Playground.Mac
│ │ ├── icon.icns
│ │ ├── Program.cs
│ │ └── SpiderEye.Playground.Mac.csproj
│ └── SpiderEye.Playground.Windows
│ ├── icon.ico
│ ├── Program.cs
│ └── SpiderEye.Playground.Windows.csproj
├── publish-NuGet.bat
├── publish-templates.bat
├── README.md
├── Shared
│ ├── SpiderEye.Shared.CodeStyle.proj
│ ├── SpiderEye.Shared.NuGet.proj
│ └── stylecop.json
├── Source
│ ├── Shared
│ │ ├── SpiderEye.Shared.Platform.proj
│ │ └── SpiderEye.Shared.proj
│ ├── SpiderEye.Client
│ │ ├── gulpfile.js
│ │ ├── package.json
│ │ ├── package-lock.json
│ │ ├── README.md
│ │ ├── src
│ │ │ ├── api
│ │ │ │ ├── browser-window
│ │ │ │ │ ├── browser-window-config.ts
│ │ │ │ │ ├── browser-window.ts
│ │ │ │ │ └── index.ts
│ │ │ │ ├── dialogs
│ │ │ │ │ ├── dialog-result.ts
│ │ │ │ │ ├── file-filter.ts
│ │ │ │ │ ├── file-result.ts
│ │ │ │ │ ├── folder-select-dialog-config.ts
│ │ │ │ │ ├── folder-select-dialog.ts
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── message-box-buttons.ts
│ │ │ │ │ ├── message-box-config.ts
│ │ │ │ │ ├── message-box.ts
│ │ │ │ │ ├── open-file-dialog-config.ts
│ │ │ │ │ ├── open-file-dialog.ts
│ │ │ │ │ ├── save-file-dialog-config.ts
│ │ │ │ │ └── save-file-dialog.ts
│ │ │ │ └── index.ts
│ │ │ ├── callbacks.ts
│ │ │ ├── index.ts
│ │ │ ├── spidereye-bridge.ts
│ │ │ └── spidereye.ts
│ │ ├── tsconfig.json
│ │ └── tslint.json
│ ├── SpiderEye.Core
│ │ ├── Application.cs
│ │ ├── Bridge
│ │ │ ├── Api
│ │ │ │ ├── DialogApiBridge.cs
│ │ │ │ └── WindowApiBridge.cs
│ │ │ ├── ApiMethod.cs
│ │ │ ├── BridgeObjectAttribute.cs
│ │ │ ├── IJsonConverter.cs
│ │ │ ├── IWebviewBridge.cs
│ │ │ ├── JsonNetJsonConverter.cs
│ │ │ ├── Models
│ │ │ │ ├── ApiResultModel.cs
│ │ │ │ ├── BrowserWindowConfigModel.cs
│ │ │ │ ├── EventResultModel.cs
│ │ │ │ ├── FileFilterModel.cs
│ │ │ │ ├── FileResultModel.cs
│ │ │ │ ├── InvokeInfoModel.cs
│ │ │ │ ├── JsErrorModel.cs
│ │ │ │ ├── MessageBoxConfigModel.cs
│ │ │ │ ├── OpenFileDialogConfigModel.cs
│ │ │ │ ├── SaveFileDialogConfigModel.cs
│ │ │ │ └── SelectFolderDialogConfigModel.cs
│ │ │ ├── ScriptException.cs
│ │ │ └── WebviewBridge.cs
│ │ ├── Content
│ │ │ ├── EmbeddedContentProvider.cs
│ │ │ ├── IContentProvider.cs
│ │ │ ├── IUriWatcher.cs
│ │ │ ├── NoopContentProvider.cs
│ │ │ └── NoopUriWatcher.cs
│ │ ├── IApplication.cs
│ │ ├── OperatingSystem.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Scripts
│ │ │ ├── ReadyEvent.js
│ │ │ └── SpiderEyeBridge.js
│ │ ├── SpiderEye.Core.csproj
│ │ ├── Tools
│ │ │ ├── ColorTools.cs
│ │ │ ├── EnumTools.cs
│ │ │ ├── JsTools.cs
│ │ │ ├── MimeTypes.cs
│ │ │ ├── NativeCast.cs
│ │ │ ├── Resources.cs
│ │ │ └── UriTools.cs
│ │ └── UI
│ │ ├── AppIcon.cs
│ │ ├── Dialogs
│ │ │ ├── Dialog.cs
│ │ │ ├── DialogResult.cs
│ │ │ ├── FileDialog.cs
│ │ │ ├── FileFilter.cs
│ │ │ ├── FolderSelectDialog.cs
│ │ │ ├── IDialog.cs
│ │ │ ├── IFileDialog.cs
│ │ │ ├── IFolderSelectDialog.cs
│ │ │ ├── IMessageBox.cs
│ │ │ ├── IOpenFileDialog.cs
│ │ │ ├── ISaveFileDialog.cs
│ │ │ ├── MessageBoxButtons.cs
│ │ │ ├── MessageBox.cs
│ │ │ ├── OpenFileDialog.cs
│ │ │ └── SaveFileDialog.cs
│ │ ├── Events
│ │ │ ├── CancelableEventArgs.cs
│ │ │ ├── NavigatingEventArgs.cs
│ │ │ └── PageLoadEventArgs.cs
│ │ ├── IUiFactory.cs
│ │ ├── IWebview.cs
│ │ ├── Key.cs
│ │ ├── KeyMask.cs
│ │ ├── Menu
│ │ │ ├── ILabelMenuItem.cs
│ │ │ ├── IMenu.cs
│ │ │ ├── IMenuItem.cs
│ │ │ ├── LabelMenuItem.cs
│ │ │ ├── Menu.cs
│ │ │ ├── MenuItemCollection.cs
│ │ │ ├── MenuItem.cs
│ │ │ └── SeparatorMenuItem.cs
│ │ ├── ModifierKey.cs
│ │ ├── Size.cs
│ │ ├── StatusIcon
│ │ │ ├── IStatusIcon.cs
│ │ │ └── StatusIcon.cs
│ │ ├── Window
│ │ │ ├── IWindow.cs
│ │ │ ├── WindowBorderStyle.cs
│ │ │ ├── WindowConfiguration.cs
│ │ │ └── Window.cs
│ │ └── WindowCollection.cs
│ ├── SpiderEye.Linux
│ │ ├── Dialogs
│ │ │ ├── GtkDialog.cs
│ │ │ ├── GtkFileDialog.cs
│ │ │ ├── GtkMessageBox.cs
│ │ │ ├── GtkOpenFileDialog.cs
│ │ │ ├── GtkSaveFileDialog.cs
│ │ │ └── GtkSelectFolderDialog.cs
│ │ ├── GtkApplication.cs
│ │ ├── GtkStatusIcon.cs
│ │ ├── GtkSynchronizationContext.cs
│ │ ├── GtkUiFactory.cs
│ │ ├── GtkWebview.cs
│ │ ├── GtkWindow.cs
│ │ ├── Interop
│ │ │ ├── AppIndicatorCategory.cs
│ │ │ ├── AppIndicatorStatus.cs
│ │ │ ├── Delegates.cs
│ │ │ ├── GdkColor.cs
│ │ │ ├── GdkGeometry.cs
│ │ │ ├── GdkGravity.cs
│ │ │ ├── GdkWindowHints.cs
│ │ │ ├── GError.cs
│ │ │ ├── GLibString.cs
│ │ │ ├── GSList.cs
│ │ │ ├── GtkButtonsType.cs
│ │ │ ├── GtkDialogFlags.cs
│ │ │ ├── GtkFileChooserAction.cs
│ │ │ ├── GtkMessageType.cs
│ │ │ ├── GtkResponseType.cs
│ │ │ ├── GtkStyleProviderPriority.cs
│ │ │ ├── GtkWindowPosition.cs
│ │ │ ├── GtkWindowType.cs
│ │ │ ├── GtkWindowTypeHint.cs
│ │ │ ├── KeyMapper.cs
│ │ │ ├── WebKitInjectedFrames.cs
│ │ │ ├── WebKitInjectionTime.cs
│ │ │ └── WebKitLoadEvent.cs
│ │ ├── LinuxApplication.cs
│ │ ├── Menu
│ │ │ ├── GtkLabelMenuItem.cs
│ │ │ ├── GtkMenu.cs
│ │ │ ├── GtkMenuItem.cs
│ │ │ └── GtkSeparatorMenuItem.cs
│ │ ├── Native
│ │ │ ├── AppIndicator.cs
│ │ │ ├── Gdk.cs
│ │ │ ├── GLib.cs
│ │ │ ├── Gtk.cs
│ │ │ ├── LibNotify.cs
│ │ │ └── WebKit.cs
│ │ ├── Scripts
│ │ │ └── InitLinux.js
│ │ └── SpiderEye.Linux.csproj
│ ├── SpiderEye.Mac
│ │ ├── CocoaApplication.cs
│ │ ├── CocoaStatusIcon.cs
│ │ ├── CocoaSynchronizationContext.cs
│ │ ├── CocoaUiFactory.cs
│ │ ├── CocoaWebview.cs
│ │ ├── CocoaWindow.cs
│ │ ├── Dialogs
│ │ │ ├── CocoaDialog.cs
│ │ │ ├── CocoaFileDialog.cs
│ │ │ ├── CocoaFolderSelectDialog.cs
│ │ │ ├── CocoaMessageBox.cs
│ │ │ ├── CocoaOpenFileDialog.cs
│ │ │ └── CocoaSaveFileDialog.cs
│ │ ├── Interop
│ │ │ ├── CGPoint.cs
│ │ │ ├── CGRect.cs
│ │ │ ├── CGSize.cs
│ │ │ ├── Delegates.cs
│ │ │ ├── KeyMapper.cs
│ │ │ ├── NativeClassDefinition.cs
│ │ │ ├── NativeClassInstance.cs
│ │ │ ├── NSAlertStyle.cs
│ │ │ ├── NSBlock.cs
│ │ │ ├── NSColor.cs
│ │ │ ├── NSDialog.cs
│ │ │ ├── NSEventModifierFlags.cs
│ │ │ ├── NSImageScaling.cs
│ │ │ ├── NSKey.cs
│ │ │ ├── NSRunLoop.cs
│ │ │ ├── NSString.cs
│ │ │ ├── NSWindowStyleMask.cs
│ │ │ └── URL.cs
│ │ ├── MacApplication.cs
│ │ ├── Menu
│ │ │ ├── CocoaLabelMenuItem.cs
│ │ │ ├── CocoaMenu.cs
│ │ │ ├── CocoaMenuItem.cs
│ │ │ ├── CocoaSeparatorMenuItem.cs
│ │ │ ├── MenuExtensions.App.cs
│ │ │ ├── MenuExtensions.cs
│ │ │ ├── MenuExtensions.Edit.cs
│ │ │ ├── MenuExtensions.File.cs
│ │ │ ├── MenuExtensions.Help.cs
│ │ │ ├── MenuExtensions.View.cs
│ │ │ └── MenuExtensions.Window.cs
│ │ ├── Native
│ │ │ ├── AppKit.cs
│ │ │ ├── Dispatch.cs
│ │ │ ├── Foundation.cs
│ │ │ ├── ObjC.cs
│ │ │ └── Webkit.cs
│ │ ├── Scripts
│ │ │ └── InitMac.js
│ │ └── SpiderEye.Mac.csproj
│ └── SpiderEye.Windows
│ ├── ContentServer.cs
│ ├── Dialogs
│ │ ├── WinFormsDialog.cs
│ │ ├── WinFormsFileDialog.cs
│ │ ├── WinFormsFolderSelectDialog.cs
│ │ ├── WinFormsMessageBox.cs
│ │ ├── WinFormsOpenFileDialog.cs
│ │ └── WinFormsSaveFileDialog.cs
│ ├── EdgiumWebview.cs
│ ├── IeLegacyWebview.cs
│ ├── Interop
│ │ ├── GWL.cs
│ │ ├── KeyMapper.cs
│ │ ├── Monitor.cs
│ │ ├── MonitorInfo.cs
│ │ ├── Native.cs
│ │ ├── OsVersionInfo.cs
│ │ ├── Point.cs
│ │ ├── ProductType.cs
│ │ ├── Rect.cs
│ │ ├── SW.cs
│ │ ├── SWP.cs
│ │ ├── WindowPlacement.cs
│ │ ├── WinFormsMapper.cs
│ │ └── WS.cs
│ ├── IWinFormsWebview.cs
│ ├── Menu
│ │ ├── WinFormsLabelMenuItem.cs
│ │ ├── WinFormsMenu.cs
│ │ ├── WinFormsMenuItem.cs
│ │ └── WinFormsSeparatorMenuItem.cs
│ ├── ScriptInterface.cs
│ ├── Scripts
│ │ ├── InitEdgium.js
│ │ └── InitWindows.js
│ ├── SpiderEye.Windows.csproj
│ ├── WebviewType.cs
│ ├── WindowsApplication.cs
│ ├── WinFormsApplication.cs
│ ├── WinFormsStatusIcon.cs
│ ├── WinFormsTaskExtensions.cs
│ ├── WinFormsUiFactory.cs
│ └── WinFormsWindow.cs
├── SpiderEye.sln
├── Templates
│ └── SpiderEye.Templates
│ ├── Common
│ │ ├── MyApp.Core
│ │ │ └── App
│ │ │ ├── index.html
│ │ │ └── styles.css
│ │ ├── MyApp.Linux
│ │ │ └── icon.png
│ │ ├── MyApp.Mac
│ │ │ └── icon.icns
│ │ ├── MyApp.sln
│ │ ├── MyApp.Windows
│ │ │ └── icon.ico
│ │ └── Shared
│ │ └── MyApp.Shared.proj
│ ├── SpiderEye.Templates.csproj
│ └── templates
│ ├── MyApp.CSharp
│ │ ├── MyApp.Core
│ │ │ ├── MyApp.Core.csproj
│ │ │ └── ProgramBase.cs
│ │ ├── MyApp.Linux
│ │ │ ├── MyApp.Linux.csproj
│ │ │ └── Program.cs
│ │ ├── MyApp.Mac
│ │ │ ├── MyApp.Mac.csproj
│ │ │ └── Program.cs
│ │ └── MyApp.Windows
│ │ ├── MyApp.Windows.csproj
│ │ └── Program.cs
│ ├── MyApp.FSharp
│ │ ├── MyApp.Core
│ │ │ ├── MyApp.Core.fsproj
│ │ │ └── ProgramBase.fs
│ │ ├── MyApp.Linux
│ │ │ ├── MyApp.Linux.fsproj
│ │ │ └── Program.fs
│ │ ├── MyApp.Mac
│ │ │ ├── MyApp.Mac.fsproj
│ │ │ └── Program.fs
│ │ └── MyApp.Windows
│ │ ├── MyApp.Windows.fsproj
│ │ └── Program.fs
│ └── MyApp.VBNet
│ ├── MyApp.Core
│ │ ├── MyApp.Core.vbproj
│ │ └── ProgramBase.vb
│ ├── MyApp.Linux
│ │ ├── MyApp.Linux.vbproj
│ │ └── Program.vb
│ ├── MyApp.Mac
│ │ ├── MyApp.Mac.vbproj
│ │ └── Program.vb
│ └── MyApp.Windows
│ ├── MyApp.Windows.vbproj
│ └── Program.vb
└── Tests
└── SpiderEye.Core.UnitTests
├── Content
│ ├── EmbeddedFileProviderTests.cs
│ └── Resources
│ ├── Nested
│ │ └── SomeOtherFile.txt
│ └── SomeFile.txt
├── SpiderEye.Core.UnitTests.csproj
└── Tools
├── ColorToolsTests.cs
├── JsToolsTests.cs
├── MimeTypesTests.cs
└── UriToolsTests.cs
106 directories, 388 files
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论