From cdafece8d31c9ef6538dfcc546b59eec6ecaeb39 Mon Sep 17 00:00:00 2001 From: Ming Yau Lee Date: Thu, 26 Aug 2021 14:22:53 +0800 Subject: [PATCH] Minor: Use JsBind.Net for all JavaScript bindings and disable integration tests temporarily --- WebExtensions.Net.sln | 11 +- .../ServiceCollectionExtensions.cs | 39 ++ ....Net.Extensions.DependencyInjection.csproj | 39 ++ .../ClassEntityTranslator.cs | 2 +- .../FunctionDefinitionTranslator.cs | 1 - .../TypeCodeConverterFactory.cs | 3 + .../ApiClassApiPropertyCodeConverter.cs | 2 +- .../ApiConstructorCodeConverter.cs | 7 +- .../ApiPropertyCodeConverter.cs | 5 +- .../ApiRootConstructorCodeConverter.cs | 7 +- .../TypePropertyCodeConverter.cs | 22 +- .../ApiRootClassEntityRegistrar.cs | 6 +- src/WebExtensions.Net/ArgumentsHandler.cs | 76 ---- src/WebExtensions.Net/BaseApi.cs | 17 +- src/WebExtensions.Net/BaseMultiTypeObject.cs | 22 +- src/WebExtensions.Net/BaseObject.cs | 107 +---- .../DelegateReferenceHandler.cs | 87 ----- .../DotNetDelegateReference.cs | 32 -- .../Extensions/Search/Disposition.cs | 1 - .../Extensions/Search/QueryInfo.cs | 53 +-- .../Extensions/Search/SearchApi.cs | 1 + .../Generated/Alarms/Alarm.cs | 45 +-- .../Generated/Alarms/AlarmInfo.cs | 45 +-- .../Generated/Alarms/AlarmsApi.cs | 8 +- .../Generated/Alarms/OnAlarmEvent.cs | 2 + .../AddListenerCallbackChangeInfo.cs | 31 +- .../Bookmarks/AddListenerCallbackMoveInfo.cs | 59 +-- .../AddListenerCallbackRemoveInfo.cs | 45 +-- .../Generated/Bookmarks/BookmarkTreeNode.cs | 143 +------ .../Generated/Bookmarks/BookmarksApi.cs | 14 +- .../Generated/Bookmarks/Changes.cs | 31 +- .../Generated/Bookmarks/CreateDetails.cs | 73 +--- .../Generated/Bookmarks/Destination.cs | 31 +- .../HasListenerCallbackChangeInfo.cs | 31 +- .../Bookmarks/HasListenerCallbackMoveInfo.cs | 59 +-- .../HasListenerCallbackRemoveInfo.cs | 45 +-- .../Generated/Bookmarks/OnChangedEvent.cs | 2 + .../Generated/Bookmarks/OnCreatedEvent.cs | 2 + .../Generated/Bookmarks/OnMovedEvent.cs | 2 + .../Generated/Bookmarks/OnRemovedEvent.cs | 2 + .../RemoveListenerCallbackChangeInfo.cs | 31 +- .../RemoveListenerCallbackMoveInfo.cs | 59 +-- .../RemoveListenerCallbackRemoveInfo.cs | 45 +-- .../BrowserAction/BrowserActionApi.cs | 8 +- .../Generated/BrowserAction/Details.cs | 31 +- .../Generated/BrowserAction/ImageDataType.cs | 3 + .../Generated/BrowserAction/OnClickData.cs | 31 +- .../Generated/BrowserAction/OnClickedEvent.cs | 2 + .../SetBadgeBackgroundColorDetails.cs | 17 +- .../BrowserAction/SetBadgeTextColorDetails.cs | 17 +- .../BrowserAction/SetBadgeTextDetails.cs | 17 +- .../Generated/BrowserAction/SetIconDetails.cs | 31 +- .../BrowserAction/SetPopupDetails.cs | 17 +- .../BrowserAction/SetTitleDetails.cs | 17 +- .../BrowserSettings/BrowserSettingsApi.cs | 6 +- .../Generated/BrowsingData/BrowsingDataApi.cs | 6 +- .../Generated/BrowsingData/DataTypeSet.cs | 157 +------- .../Generated/BrowsingData/OriginTypes.cs | 45 +-- .../Generated/BrowsingData/RemovalOptions.cs | 59 +-- .../Generated/BrowsingData/Result.cs | 45 +-- .../Generated/Clipboard/ClipboardApi.cs | 6 +- .../Generated/Commands/Command.cs | 45 +-- .../Generated/Commands/CommandsApi.cs | 8 +- .../Generated/Commands/Detail.cs | 45 +-- .../Generated/Commands/OnCommandEvent.cs | 2 + .../ContentScripts/ContentScriptsApi.cs | 6 +- .../RegisteredContentScriptOptions.cs | 129 +----- .../Cookies/AddListenerCallbackChangeInfo.cs | 45 +-- .../Generated/Cookies/CallbackDetails.cs | 59 +-- .../Generated/Cookies/Cookie.cs | 171 +------- .../Generated/Cookies/CookieStore.cs | 45 +-- .../Generated/Cookies/CookiesApi.cs | 8 +- .../Generated/Cookies/GetAllDetails.cs | 115 +----- .../Generated/Cookies/GetDetails.cs | 59 +-- .../Cookies/HasListenerCallbackChangeInfo.cs | 45 +-- .../Generated/Cookies/OnChangedEvent.cs | 2 + .../Generated/Cookies/RemoveDetails.cs | 59 +-- .../RemoveListenerCallbackChangeInfo.cs | 45 +-- .../Generated/Cookies/SetDetails.cs | 157 +------- .../Generated/Devtools/DevtoolsApi.cs | 12 +- .../Devtools/InspectedWindow/EvalResult.cs | 28 +- .../Devtools/InspectedWindow/ExceptionInfo.cs | 87 +---- .../InspectedWindow/InspectedWindowApi.cs | 6 +- .../Devtools/InspectedWindow/ReloadOptions.cs | 45 +-- .../Generated/Devtools/Network/NetworkApi.cs | 10 +- .../Devtools/Network/OnNavigatedEvent.cs | 2 + .../Network/OnRequestFinishedEvent.cs | 2 + .../Generated/Devtools/Network/Request.cs | 2 + .../Devtools/Panels/ElementsPanel.cs | 2 + .../Devtools/Panels/ExtensionPanel.cs | 3 + .../Devtools/Panels/ExtensionSidebarPane.cs | 2 + .../Devtools/Panels/OnThemeChangedEvent.cs | 2 + .../Generated/Devtools/Panels/PanelsApi.cs | 8 +- .../Generated/Devtools/Panels/SourcesPanel.cs | 3 + .../AddListenerCallbackDownloadDelta.cs | 199 +--------- .../Generated/Downloads/BooleanDelta.cs | 31 +- .../Generated/Downloads/DoubleDelta.cs | 31 +- .../Generated/Downloads/DownloadItem.cs | 283 ++------------ .../Generated/Downloads/DownloadOptions.cs | 129 +----- .../Generated/Downloads/DownloadQuery.cs | 353 ++--------------- .../Generated/Downloads/DownloadsApi.cs | 12 +- .../Generated/Downloads/GetFileIconOptions.cs | 17 +- .../HasListenerCallbackDownloadDelta.cs | 199 +--------- .../Generated/Downloads/HeadersArrayItem.cs | 31 +- .../Generated/Downloads/OnChangedEvent.cs | 2 + .../Generated/Downloads/OnCreatedEvent.cs | 2 + .../Generated/Downloads/OnErasedEvent.cs | 2 + .../RemoveListenerCallbackDownloadDelta.cs | 199 +--------- .../Generated/Downloads/StringDelta.cs | 31 +- .../Generated/Events/Event.cs | 2 + .../Generated/Events/UrlFilter.cs | 283 ++------------ .../Generated/Extension/ExtensionApi.cs | 6 +- .../Generated/Extension/FetchProperties.cs | 45 +-- .../Generated/Extension/LastError.cs | 17 +- .../Generated/ExtensionTypes/ExtensionCode.cs | 17 +- .../Generated/ExtensionTypes/ExtensionFile.cs | 17 +- .../Generated/ExtensionTypes/ImageDetails.cs | 59 +-- .../Generated/ExtensionTypes/InjectDetails.cs | 101 +---- .../Generated/ExtensionTypes/Rect.cs | 63 +-- .../History/AddListenerCallbackChanged.cs | 31 +- .../History/AddListenerCallbackRemoved.cs | 31 +- .../Generated/History/AddUrlDetails.cs | 59 +-- .../Generated/History/DeleteUrlDetails.cs | 17 +- .../Generated/History/GetVisitsDetails.cs | 17 +- .../History/HasListenerCallbackChanged.cs | 31 +- .../History/HasListenerCallbackRemoved.cs | 31 +- .../Generated/History/HistoryApi.cs | 12 +- .../Generated/History/HistoryItem.cs | 87 +---- .../Generated/History/OnTitleChangedEvent.cs | 2 + .../Generated/History/OnVisitRemovedEvent.cs | 2 + .../Generated/History/OnVisitedEvent.cs | 2 + .../Generated/History/Query.cs | 59 +-- .../Generated/History/Range.cs | 31 +- .../History/RemoveListenerCallbackChanged.cs | 31 +- .../History/RemoveListenerCallbackRemoved.cs | 31 +- .../Generated/History/VisitItem.cs | 73 +--- .../Generated/I18n/I18nApi.cs | 6 +- .../Generated/I18n/LanguagesArrayItem.cs | 31 +- .../Generated/I18n/Result.cs | 31 +- .../Generated/Identity/IdentityApi.cs | 6 +- .../Identity/LaunchWebAuthFlowDetails.cs | 31 +- .../Generated/Idle/IdleApi.cs | 8 +- .../Generated/Idle/OnStateChangedEvent.cs | 2 + .../Generated/Management/ExtensionInfo.cs | 241 +----------- .../Generated/Management/IconInfo.cs | 31 +- .../Generated/Management/InstallOptions.cs | 31 +- .../Generated/Management/ManagementApi.cs | 14 +- .../Generated/Management/OnDisabledEvent.cs | 2 + .../Generated/Management/OnEnabledEvent.cs | 2 + .../Generated/Management/OnInstalledEvent.cs | 2 + .../Management/OnUninstalledEvent.cs | 2 + .../Generated/Management/Result.cs | 17 +- .../Management/UninstallSelfOptions.cs | 31 +- .../Menus/AddListenerCallbackInfo.cs | 171 +------- .../Generated/Menus/ContextOptions.cs | 59 +-- .../Generated/Menus/CreateProperties.cs | 199 +--------- .../Menus/HasListenerCallbackInfo.cs | 171 +------- .../Generated/Menus/MenusApi.cs | 12 +- .../Generated/Menus/OnClickData.cs | 255 +----------- .../Generated/Menus/OnClickedEvent.cs | 2 + .../Generated/Menus/OnShownEvent.cs | 2 + .../Menus/RemoveListenerCallbackInfo.cs | 171 +------- .../Generated/Menus/UpdateProperties.cs | 171 +------- .../CreateNotificationOptions.cs | 171 +------- .../Notifications/NotificationItem.cs | 31 +- .../Notifications/NotificationsApi.cs | 14 +- .../Notifications/OnButtonClickedEvent.cs | 2 + .../Generated/Notifications/OnClickedEvent.cs | 2 + .../Generated/Notifications/OnClosedEvent.cs | 2 + .../Generated/Notifications/OnShownEvent.cs | 2 + .../Generated/Omnibox/DefaultSuggestResult.cs | 17 +- .../Generated/Omnibox/OmniboxApi.cs | 14 +- .../Generated/Omnibox/OnInputChangedEvent.cs | 2 + .../Generated/Omnibox/OnInputEnteredEvent.cs | 2 + .../Generated/Omnibox/SuggestResult.cs | 31 +- .../Generated/PageAction/GetPopupDetails.cs | 17 +- .../Generated/PageAction/GetTitleDetails.cs | 17 +- .../Generated/PageAction/ImageDataType.cs | 3 + .../Generated/PageAction/IsShownDetails.cs | 17 +- .../Generated/PageAction/OnClickData.cs | 31 +- .../Generated/PageAction/OnClickedEvent.cs | 2 + .../Generated/PageAction/PageActionApi.cs | 8 +- .../Generated/PageAction/SetIconDetails.cs | 45 +-- .../Generated/PageAction/SetPopupDetails.cs | 31 +- .../Generated/PageAction/SetTitleDetails.cs | 31 +- .../Generated/Permissions/AnyPermissions.cs | 31 +- .../Generated/Permissions/OnAddedEvent.cs | 2 + .../Generated/Permissions/OnRemovedEvent.cs | 2 + .../Generated/Permissions/PermissionsApi.cs | 10 +- .../Generated/Permissions/PermissionsType.cs | 31 +- .../Generated/Privacy/Network/NetworkApi.cs | 6 +- .../Generated/Privacy/PrivacyApi.cs | 12 +- .../Generated/Privacy/Services/ServicesApi.cs | 6 +- .../Generated/Privacy/Websites/WebsitesApi.cs | 6 +- .../Proxy/AddListenerCallbackDetails.cs | 227 +---------- .../Proxy/HasListenerCallbackDetails.cs | 227 +---------- .../Generated/Proxy/OnErrorEvent.cs | 2 + .../Generated/Proxy/OnRequestEvent.cs | 2 + .../Generated/Proxy/ProxyApi.cs | 10 +- .../Proxy/RemoveListenerCallbackDetails.cs | 227 +---------- .../Generated/Runtime/BrowserInfo.cs | 59 +-- .../Generated/Runtime/ConnectInfo.cs | 31 +- .../Generated/Runtime/LastError.cs | 17 +- .../Generated/Runtime/MessageSender.cs | 59 +-- .../Generated/Runtime/OnConnectEvent.cs | 2 + .../Runtime/OnConnectExternalEvent.cs | 2 + .../Generated/Runtime/OnInstalledEvent.cs | 2 + ...nstalledEventAddListenerCallbackDetails.cs | 45 +-- ...nstalledEventHasListenerCallbackDetails.cs | 45 +-- ...alledEventRemoveListenerCallbackDetails.cs | 45 +-- .../Generated/Runtime/OnMessageEvent.cs | 2 + .../Runtime/OnMessageExternalEvent.cs | 2 + .../Runtime/OnUpdateAvailableEvent.cs | 2 + ...vailableEventAddListenerCallbackDetails.cs | 17 +- ...vailableEventHasListenerCallbackDetails.cs | 17 +- ...lableEventRemoveListenerCallbackDetails.cs | 17 +- .../Generated/Runtime/PlatformInfo.cs | 31 +- .../Generated/Runtime/Port.cs | 87 +---- .../Generated/Runtime/RuntimeApi.cs | 20 +- .../Generated/Search/SearchApi.cs | 6 +- .../Generated/Search/SearchProperties.cs | 45 +-- .../Generated/Sessions/Filter.cs | 17 +- .../Generated/Sessions/Session.cs | 45 +-- .../Generated/Sessions/SessionsApi.cs | 8 +- .../Generated/Storage/OnChangedEvent.cs | 2 + .../Generated/Storage/StorageApi.cs | 8 +- .../Generated/Storage/StorageArea.cs | 2 + .../Generated/Storage/StorageAreaSync.cs | 2 + .../Tabs/AddListenerCallbackActiveInfo.cs | 45 +-- .../Tabs/AddListenerCallbackAttachInfo.cs | 31 +- .../Tabs/AddListenerCallbackChangeInfo.cs | 171 +------- .../Tabs/AddListenerCallbackDetachInfo.cs | 31 +- .../Tabs/AddListenerCallbackHighlightInfo.cs | 31 +- .../Tabs/AddListenerCallbackMoveInfo.cs | 45 +-- .../Tabs/AddListenerCallbackRemoveInfo.cs | 31 +- .../Tabs/AddListenerCallbackZoomChangeInfo.cs | 59 +-- .../Generated/Tabs/ConnectInfo.cs | 31 +- .../Generated/Tabs/CreateProperties.cs | 143 +------ .../Generated/Tabs/DuplicateProperties.cs | 31 +- .../Tabs/HasListenerCallbackActiveInfo.cs | 45 +-- .../Tabs/HasListenerCallbackAttachInfo.cs | 31 +- .../Tabs/HasListenerCallbackChangeInfo.cs | 171 +------- .../Tabs/HasListenerCallbackDetachInfo.cs | 31 +- .../Tabs/HasListenerCallbackHighlightInfo.cs | 31 +- .../Tabs/HasListenerCallbackMoveInfo.cs | 45 +-- .../Tabs/HasListenerCallbackRemoveInfo.cs | 31 +- .../Tabs/HasListenerCallbackZoomChangeInfo.cs | 59 +-- .../Generated/Tabs/HighlightHighlightInfo.cs | 45 +-- .../Generated/Tabs/MoveInSuccessionOptions.cs | 31 +- .../Generated/Tabs/MoveProperties.cs | 31 +- .../Generated/Tabs/MutedInfo.cs | 45 +-- .../Generated/Tabs/OnActivatedEvent.cs | 2 + .../Generated/Tabs/OnAttachedEvent.cs | 2 + .../Generated/Tabs/OnCreatedEvent.cs | 2 + .../Generated/Tabs/OnDetachedEvent.cs | 2 + .../Generated/Tabs/OnHighlightedEvent.cs | 2 + .../Generated/Tabs/OnMovedEvent.cs | 2 + .../Generated/Tabs/OnRemovedEvent.cs | 2 + .../Generated/Tabs/OnReplacedEvent.cs | 2 + .../Generated/Tabs/OnUpdatedEvent.cs | 2 + .../Generated/Tabs/OnZoomChangeEvent.cs | 2 + .../Generated/Tabs/PageSettings.cs | 325 ++-------------- .../Generated/Tabs/QueryInfo.cs | 297 ++------------ .../Generated/Tabs/ReloadProperties.cs | 17 +- .../Tabs/RemoveListenerCallbackActiveInfo.cs | 45 +-- .../Tabs/RemoveListenerCallbackAttachInfo.cs | 31 +- .../Tabs/RemoveListenerCallbackChangeInfo.cs | 171 +------- .../Tabs/RemoveListenerCallbackDetachInfo.cs | 31 +- .../RemoveListenerCallbackHighlightInfo.cs | 31 +- .../Tabs/RemoveListenerCallbackMoveInfo.cs | 45 +-- .../Tabs/RemoveListenerCallbackRemoveInfo.cs | 31 +- .../RemoveListenerCallbackZoomChangeInfo.cs | 59 +-- .../Generated/Tabs/SendMessageOptions.cs | 17 +- .../Generated/Tabs/SharingState.cs | 45 +-- src/WebExtensions.Net/Generated/Tabs/Tab.cs | 367 ++---------------- .../Generated/Tabs/TabsApi.cs | 26 +- .../Generated/Tabs/UpdateFilter.cs | 59 +-- .../Generated/Tabs/UpdateProperties.cs | 115 +----- .../Generated/Tabs/ZoomSettings.cs | 45 +-- .../Generated/TopSites/MostVisitedURL.cs | 59 +-- .../Generated/TopSites/Options.cs | 115 +----- .../Generated/TopSites/TopSitesApi.cs | 6 +- .../Generated/Types/CallbackDetails.cs | 45 +-- .../Generated/Types/ClearDetails.cs | 17 +- .../Generated/Types/GetDetails.cs | 17 +- .../Generated/Types/SetDetails.cs | 31 +- .../Generated/Types/Setting.cs | 2 + .../Generated/WebExtensionsApi.cs | 74 ++-- .../WebNavigation/DetailsArrayItem.cs | 73 +--- .../WebNavigation/EventUrlFilters.cs | 17 +- .../WebNavigation/GetAllFramesDetails.cs | 17 +- .../WebNavigation/GetFrameCallbackDetails.cs | 73 +--- .../WebNavigation/GetFrameDetails.cs | 45 +-- .../WebNavigation/OnBeforeNavigateEvent.cs | 2 + ...NavigateEventAddListenerCallbackDetails.cs | 73 +--- ...NavigateEventHasListenerCallbackDetails.cs | 73 +--- ...igateEventRemoveListenerCallbackDetails.cs | 73 +--- .../WebNavigation/OnCommittedEvent.cs | 2 + ...ommittedEventAddListenerCallbackDetails.cs | 59 +-- ...ommittedEventHasListenerCallbackDetails.cs | 59 +-- ...ittedEventRemoveListenerCallbackDetails.cs | 59 +-- .../WebNavigation/OnCompletedEvent.cs | 2 + ...ompletedEventAddListenerCallbackDetails.cs | 59 +-- ...ompletedEventHasListenerCallbackDetails.cs | 59 +-- ...letedEventRemoveListenerCallbackDetails.cs | 59 +-- .../OnCreatedNavigationTargetEvent.cs | 2 + ...onTargetEventAddListenerCallbackDetails.cs | 87 +---- ...onTargetEventHasListenerCallbackDetails.cs | 87 +---- ...argetEventRemoveListenerCallbackDetails.cs | 87 +---- .../WebNavigation/OnDomContentLoadedEvent.cs | 2 + ...ntLoadedEventAddListenerCallbackDetails.cs | 59 +-- ...ntLoadedEventHasListenerCallbackDetails.cs | 59 +-- ...oadedEventRemoveListenerCallbackDetails.cs | 59 +-- .../WebNavigation/OnErrorOccurredEvent.cs | 2 + ...OccurredEventAddListenerCallbackDetails.cs | 59 +-- ...OccurredEventHasListenerCallbackDetails.cs | 59 +-- ...urredEventRemoveListenerCallbackDetails.cs | 59 +-- .../OnHistoryStateUpdatedEvent.cs | 2 + ...eUpdatedEventAddListenerCallbackDetails.cs | 59 +-- ...eUpdatedEventHasListenerCallbackDetails.cs | 59 +-- ...datedEventRemoveListenerCallbackDetails.cs | 59 +-- .../OnReferenceFragmentUpdatedEvent.cs | 2 + ...tUpdatedEventAddListenerCallbackDetails.cs | 59 +-- ...tUpdatedEventHasListenerCallbackDetails.cs | 59 +-- ...datedEventRemoveListenerCallbackDetails.cs | 59 +-- .../WebNavigation/OnTabReplacedEvent.cs | 2 + ...ReplacedEventAddListenerCallbackDetails.cs | 45 +-- ...ReplacedEventHasListenerCallbackDetails.cs | 45 +-- ...lacedEventRemoveListenerCallbackDetails.cs | 45 +-- .../WebNavigation/WebNavigationApi.cs | 24 +- .../AddListenerCallbackDetailsChallenger.cs | 31 +- .../AddListenerCallbackDetailsRequestBody.cs | 45 +-- .../Generated/WebRequest/AuthCredentials.cs | 31 +- .../Generated/WebRequest/BlockingResponse.cs | 87 +---- .../HasListenerCallbackDetailsChallenger.cs | 31 +- .../HasListenerCallbackDetailsRequestBody.cs | 45 +-- .../WebRequest/HttpHeadersArrayItem.cs | 45 +-- .../WebRequest/OnAuthRequiredEvent.cs | 2 + ...RequiredEventAddListenerCallbackDetails.cs | 297 ++------------ ...RequiredEventHasListenerCallbackDetails.cs | 297 ++------------ ...uiredEventRemoveListenerCallbackDetails.cs | 297 ++------------ .../WebRequest/OnBeforeRedirectEvent.cs | 2 + ...RedirectEventAddListenerCallbackDetails.cs | 283 ++------------ ...RedirectEventHasListenerCallbackDetails.cs | 283 ++------------ ...irectEventRemoveListenerCallbackDetails.cs | 283 ++------------ .../WebRequest/OnBeforeRequestEvent.cs | 2 + ...eRequestEventAddListenerCallbackDetails.cs | 213 +--------- ...eRequestEventHasListenerCallbackDetails.cs | 213 +--------- ...questEventRemoveListenerCallbackDetails.cs | 213 +--------- .../WebRequest/OnBeforeSendHeadersEvent.cs | 2 + ...dHeadersEventAddListenerCallbackDetails.cs | 213 +--------- ...dHeadersEventHasListenerCallbackDetails.cs | 213 +--------- ...adersEventRemoveListenerCallbackDetails.cs | 213 +--------- .../Generated/WebRequest/OnCompletedEvent.cs | 2 + ...ompletedEventAddListenerCallbackDetails.cs | 297 ++------------ ...ompletedEventHasListenerCallbackDetails.cs | 297 ++------------ ...letedEventRemoveListenerCallbackDetails.cs | 297 ++------------ .../WebRequest/OnErrorOccurredEvent.cs | 2 + ...OccurredEventAddListenerCallbackDetails.cs | 241 +----------- ...OccurredEventHasListenerCallbackDetails.cs | 241 +----------- ...urredEventRemoveListenerCallbackDetails.cs | 241 +----------- .../WebRequest/OnHeadersReceivedEvent.cs | 2 + ...ReceivedEventAddListenerCallbackDetails.cs | 241 +----------- ...ReceivedEventHasListenerCallbackDetails.cs | 241 +----------- ...eivedEventRemoveListenerCallbackDetails.cs | 241 +----------- .../WebRequest/OnResponseStartedEvent.cs | 2 + ...eStartedEventAddListenerCallbackDetails.cs | 269 +------------ ...eStartedEventHasListenerCallbackDetails.cs | 269 +------------ ...artedEventRemoveListenerCallbackDetails.cs | 269 +------------ .../WebRequest/OnSendHeadersEvent.cs | 2 + ...dHeadersEventAddListenerCallbackDetails.cs | 213 +--------- ...dHeadersEventHasListenerCallbackDetails.cs | 213 +--------- ...adersEventRemoveListenerCallbackDetails.cs | 213 +--------- .../Generated/WebRequest/Options.cs | 31 +- ...RemoveListenerCallbackDetailsChallenger.cs | 31 +- ...emoveListenerCallbackDetailsRequestBody.cs | 45 +-- .../Generated/WebRequest/RequestFilter.cs | 73 +--- .../Generated/WebRequest/UploadData.cs | 31 +- .../Generated/WebRequest/UrlClassification.cs | 31 +- .../Generated/WebRequest/WebRequestApi.cs | 24 +- .../Generated/Windows/CreateData.cs | 185 +-------- .../Generated/Windows/GetAllGetInfo.cs | 17 +- .../Generated/Windows/GetInfo.cs | 31 +- .../Generated/Windows/OnCreatedEvent.cs | 2 + .../Generated/Windows/OnFocusChangedEvent.cs | 2 + .../Generated/Windows/OnRemovedEvent.cs | 2 + .../Generated/Windows/UpdateInfo.cs | 115 +----- .../Generated/Windows/Window.cs | 185 +-------- .../Generated/Windows/WindowsApi.cs | 12 +- src/WebExtensions.Net/Generated/generated.txt | 2 +- .../IWebExtensionsJSRuntime.cs | 49 --- .../InvokeFunctionReferenceOption.cs | 25 -- .../InvokeObjectReferenceOption.cs | 35 -- src/WebExtensions.Net/InvokeOption.cs | 13 - src/WebExtensions.Net/JSFunctionProxy.cs | 68 ---- .../Mock/DefaultMockHandlers.cs | 11 - .../Mock/MockConfigurationContext.cs | 2 +- .../Mock/MockJsRuntimeAdapter.cs | 172 ++++++++ .../Mock/MockWebExtensionsJSRuntime.cs | 109 ------ .../RemoveObjectReferenceOption.cs | 23 -- .../WebExtensions.Net.csproj | 10 +- .../WebExtensionsJSRuntime.cs | 100 ----- .../build/WebExtensions.Net.props | 9 - .../build/WebExtensions.Net.targets | 15 - .../Modules/ArgumentsHandler.js | 67 ---- .../Modules/DotNetDelegateProxy.js | 35 -- .../Modules/FunctionReferenceHandler.js | 60 --- .../WebExtensionsScripts/Modules/Guid.js | 12 - .../Modules/JSFunctionReference.js | 22 -- .../Modules/WebExtensions.js | 113 ------ .../WebExtensionsScripts/WebExtensionsNet.js | 4 - ...Net.BrowserExtensionIntegrationTest.csproj | 3 - 412 files changed, 2735 insertions(+), 20935 deletions(-) create mode 100644 src/WebExtensions.Net.Extensions.DependencyInjection/ServiceCollectionExtensions.cs create mode 100644 src/WebExtensions.Net.Extensions.DependencyInjection/WebExtensions.Net.Extensions.DependencyInjection.csproj delete mode 100644 src/WebExtensions.Net/ArgumentsHandler.cs delete mode 100644 src/WebExtensions.Net/DelegateReferenceHandler.cs delete mode 100644 src/WebExtensions.Net/DotNetDelegateReference.cs delete mode 100644 src/WebExtensions.Net/IWebExtensionsJSRuntime.cs delete mode 100644 src/WebExtensions.Net/InvokeFunctionReferenceOption.cs delete mode 100644 src/WebExtensions.Net/InvokeObjectReferenceOption.cs delete mode 100644 src/WebExtensions.Net/InvokeOption.cs delete mode 100644 src/WebExtensions.Net/JSFunctionProxy.cs delete mode 100644 src/WebExtensions.Net/Mock/DefaultMockHandlers.cs create mode 100644 src/WebExtensions.Net/Mock/MockJsRuntimeAdapter.cs delete mode 100644 src/WebExtensions.Net/Mock/MockWebExtensionsJSRuntime.cs delete mode 100644 src/WebExtensions.Net/RemoveObjectReferenceOption.cs delete mode 100644 src/WebExtensions.Net/WebExtensionsJSRuntime.cs delete mode 100644 src/WebExtensions.Net/build/WebExtensions.Net.props delete mode 100644 src/WebExtensions.Net/build/WebExtensions.Net.targets delete mode 100644 src/WebExtensions.Net/content/WebExtensionsScripts/Modules/ArgumentsHandler.js delete mode 100644 src/WebExtensions.Net/content/WebExtensionsScripts/Modules/DotNetDelegateProxy.js delete mode 100644 src/WebExtensions.Net/content/WebExtensionsScripts/Modules/FunctionReferenceHandler.js delete mode 100644 src/WebExtensions.Net/content/WebExtensionsScripts/Modules/Guid.js delete mode 100644 src/WebExtensions.Net/content/WebExtensionsScripts/Modules/JSFunctionReference.js delete mode 100644 src/WebExtensions.Net/content/WebExtensionsScripts/Modules/WebExtensions.js delete mode 100644 src/WebExtensions.Net/content/WebExtensionsScripts/WebExtensionsNet.js diff --git a/WebExtensions.Net.sln b/WebExtensions.Net.sln index 9211923..fe10a7d 100644 --- a/WebExtensions.Net.sln +++ b/WebExtensions.Net.sln @@ -38,10 +38,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tool", "tool", "{4C80786C-7 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Icon", "Icon", "{12B00534-99DE-4E2A-AD2B-C73285B6541D}" ProjectSection(SolutionItems) = preProject - src\Icon\Icon.svg = src\Icon\Icon.svg src\Icon\Icon.png = src\Icon\Icon.png + src\Icon\Icon.svg = src\Icon\Icon.svg EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebExtensions.Net.Extensions.DependencyInjection", "src\WebExtensions.Net.Extensions.DependencyInjection\WebExtensions.Net.Extensions.DependencyInjection.csproj", "{2C1ED236-60A4-47D5-8467-33A456F5B458}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -59,11 +61,13 @@ Global {C8382E8F-80E4-4EA5-B64E-D8AD46D84F90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C8382E8F-80E4-4EA5-B64E-D8AD46D84F90}.Debug|Any CPU.Build.0 = Debug|Any CPU {C8382E8F-80E4-4EA5-B64E-D8AD46D84F90}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C8382E8F-80E4-4EA5-B64E-D8AD46D84F90}.Release|Any CPU.Build.0 = Release|Any CPU {6F6D0020-DE47-47F5-8D85-25A4D328B0A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6F6D0020-DE47-47F5-8D85-25A4D328B0A1}.Debug|Any CPU.Build.0 = Debug|Any CPU {6F6D0020-DE47-47F5-8D85-25A4D328B0A1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6F6D0020-DE47-47F5-8D85-25A4D328B0A1}.Release|Any CPU.Build.0 = Release|Any CPU + {2C1ED236-60A4-47D5-8467-33A456F5B458}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2C1ED236-60A4-47D5-8467-33A456F5B458}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2C1ED236-60A4-47D5-8467-33A456F5B458}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2C1ED236-60A4-47D5-8467-33A456F5B458}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -74,6 +78,7 @@ Global {C8382E8F-80E4-4EA5-B64E-D8AD46D84F90} = {402C7B21-F25A-4EB2-AAAE-A8F827CD0ED4} {6F6D0020-DE47-47F5-8D85-25A4D328B0A1} = {402C7B21-F25A-4EB2-AAAE-A8F827CD0ED4} {12B00534-99DE-4E2A-AD2B-C73285B6541D} = {37728F80-FC95-4451-B92C-3D915C0D11B6} + {2C1ED236-60A4-47D5-8467-33A456F5B458} = {37728F80-FC95-4451-B92C-3D915C0D11B6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {500E229A-A512-45E3-B66E-46EB228929D3} diff --git a/src/WebExtensions.Net.Extensions.DependencyInjection/ServiceCollectionExtensions.cs b/src/WebExtensions.Net.Extensions.DependencyInjection/ServiceCollectionExtensions.cs new file mode 100644 index 0000000..ede7d81 --- /dev/null +++ b/src/WebExtensions.Net.Extensions.DependencyInjection/ServiceCollectionExtensions.cs @@ -0,0 +1,39 @@ +using System.Linq; +using JsBind.Net; +using WebExtensions.Net; +using WebExtensions.Net.Mock; + +namespace Microsoft.Extensions.DependencyInjection +{ + /// + /// Extension method for service registration. + /// + public static class ServiceCollectionExtensions + { + /// + /// Adds the required services for using WebExtensions API. + /// + /// The to add the services to. + /// A reference to this instance after the operation has completed. + public static IServiceCollection AddWebExtensions(this IServiceCollection services) + { + services.AddJsBind(options => options.UseInProcessJsRuntime()); + services.AddTransient(); + return services; + } + + /// + /// Adds the required services for using Mock WebExtensions API. + /// + /// The to add the services to. + /// A reference to this instance after the operation has completed. + public static IServiceCollection AddMockWebExtensions(this IServiceCollection services) + { + AddWebExtensions(services); + // Replace registered IJsRuntimeAdapter with the mock adapter + services.Remove(services.First(service => service.ServiceType == typeof(IJsRuntimeAdapter))); + services.AddSingleton(); + return services; + } + } +} diff --git a/src/WebExtensions.Net.Extensions.DependencyInjection/WebExtensions.Net.Extensions.DependencyInjection.csproj b/src/WebExtensions.Net.Extensions.DependencyInjection/WebExtensions.Net.Extensions.DependencyInjection.csproj new file mode 100644 index 0000000..3475b94 --- /dev/null +++ b/src/WebExtensions.Net.Extensions.DependencyInjection/WebExtensions.Net.Extensions.DependencyInjection.csproj @@ -0,0 +1,39 @@ + + + + + net5.0 + false + true + true + false + + + + + true + ..\PackageOutput + mingyaulee + A package for service registration in WebExtensions.Net. + https://github.com/mingyaulee/WebExtensions.Net + Browser Chrome Firefox Edge Extension Addons .Net + MIT + Icon.png + + + + + true + + + + + + + + + + + + + diff --git a/src/WebExtensions.Net.Generator/ClrTypeTranslators/ClassEntityTranslator.cs b/src/WebExtensions.Net.Generator/ClrTypeTranslators/ClassEntityTranslator.cs index c9cc5d6..0113e7c 100644 --- a/src/WebExtensions.Net.Generator/ClrTypeTranslators/ClassEntityTranslator.cs +++ b/src/WebExtensions.Net.Generator/ClrTypeTranslators/ClassEntityTranslator.cs @@ -57,7 +57,7 @@ public IEnumerable ShallowTranslate(ClassEntity classEntity) Metadata = new Dictionary() { { Constants.TypeMetadata.ClassType, classEntity.Type }, - { Constants.TypeMetadata.ApiNamespace, classEntity.NamespaceEntity.FullName } + { Constants.TypeMetadata.ApiNamespace, classEntity.NamespaceEntity.Name } } }; diff --git a/src/WebExtensions.Net.Generator/ClrTypeTranslators/FunctionDefinitionTranslator.cs b/src/WebExtensions.Net.Generator/ClrTypeTranslators/FunctionDefinitionTranslator.cs index a2443a5..e36200e 100644 --- a/src/WebExtensions.Net.Generator/ClrTypeTranslators/FunctionDefinitionTranslator.cs +++ b/src/WebExtensions.Net.Generator/ClrTypeTranslators/FunctionDefinitionTranslator.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text.Json; using WebExtensions.Net.Generator.Extensions; using WebExtensions.Net.Generator.Helpers; using WebExtensions.Net.Generator.Models.ClrTypes; diff --git a/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverterFactories/TypeCodeConverterFactory.cs b/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverterFactories/TypeCodeConverterFactory.cs index 0f71645..dc6ddc4 100644 --- a/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverterFactories/TypeCodeConverterFactory.cs +++ b/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverterFactories/TypeCodeConverterFactory.cs @@ -13,8 +13,11 @@ public void AddInterfaceConvertersToCodeFile(ClrTypeInfo clrTypeInfo, CodeFile c public void AddConvertersToCodeFile(ClrTypeInfo clrTypeInfo, CodeFile codeFile) { + codeFile.UsingNamespaces.Add("JsBind.Net"); + codeFile.Comments.Add(new CommentCodeConverter("Type Class")); codeFile.Comments.Add(new CommentSummaryCodeConverter(clrTypeInfo.Description)); + codeFile.Comments.Add(new AttributeCodeConverter("BindAllProperties")); if (clrTypeInfo.IsObsolete) { diff --git a/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/ApiClassApiPropertyCodeConverter.cs b/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/ApiClassApiPropertyCodeConverter.cs index d8b2aea..57dce7d 100644 --- a/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/ApiClassApiPropertyCodeConverter.cs +++ b/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/ApiClassApiPropertyCodeConverter.cs @@ -29,7 +29,7 @@ public void WriteTo(CodeWriter codeWriter, CodeWriterOptions options) .WriteStartBlock() .WriteLine($"if (_{privatePropertyName} is null)") .WriteStartBlock() - .WriteLine($"_{privatePropertyName} = new {propertyType}(webExtensionsJSRuntime);") + .WriteLine($"_{privatePropertyName} = new {propertyType}(JsRuntime, AccessPath);") .WriteEndBlock() .WriteLine($"return _{privatePropertyName};") // end property get diff --git a/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/ApiConstructorCodeConverter.cs b/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/ApiConstructorCodeConverter.cs index ebf6703..deb82e9 100644 --- a/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/ApiConstructorCodeConverter.cs +++ b/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/ApiConstructorCodeConverter.cs @@ -13,10 +13,13 @@ public ApiConstructorCodeConverter(string className, string apiName) public void WriteTo(CodeWriter codeWriter, CodeWriterOptions options) { + codeWriter.WriteUsingStatement("JsBind.Net"); + codeWriter.Constructors .WriteWithConverter(new CommentSummaryCodeConverter($"Creates a new instance of .")) - .WriteWithConverter(new CommentParamCodeSectionConverter("webExtensionsJSRuntime", "Web Extension JS Runtime")) - .WriteLine($"public {className}(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, \"{apiName}\")") + .WriteWithConverter(new CommentParamCodeSectionConverter("jsRuntime", "The JS runtime adapter.")) + .WriteWithConverter(new CommentParamCodeSectionConverter("accessPath", "The base API access path.")) + .WriteLine($"public {className}(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, \"{apiName}\"))") .WriteStartBlock() .WriteEndBlock(); } diff --git a/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/ApiPropertyCodeConverter.cs b/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/ApiPropertyCodeConverter.cs index 0fb9345..41cbf92 100644 --- a/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/ApiPropertyCodeConverter.cs +++ b/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/ApiPropertyCodeConverter.cs @@ -29,6 +29,9 @@ public void WriteTo(CodeWriter codeWriter, CodeWriterOptions options) { // Event property var privatePropertyName = clrPropertyInfo.PrivateName; + + codeWriter.WriteUsingStatement("JsBind.Net"); + codeWriter.Properties .WriteLine($"private {clrPropertyInfo.PropertyType.CSharpName} _{privatePropertyName};"); @@ -44,7 +47,7 @@ public void WriteTo(CodeWriter codeWriter, CodeWriterOptions options) .WriteLine($"if (_{privatePropertyName} is null)") .WriteStartBlock() .WriteLine($"_{privatePropertyName} = new {clrPropertyInfo.PropertyType.CSharpName}();") - .WriteLine($"InitializeProperty(\"{privatePropertyName}\", _{privatePropertyName});") + .WriteLine($"_{privatePropertyName}.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, \"{privatePropertyName}\"));") .WriteEndBlock() .WriteLine($"return _{privatePropertyName};") // end property get diff --git a/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/ApiRootConstructorCodeConverter.cs b/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/ApiRootConstructorCodeConverter.cs index 9daab0c..f09e983 100644 --- a/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/ApiRootConstructorCodeConverter.cs +++ b/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/ApiRootConstructorCodeConverter.cs @@ -11,14 +11,13 @@ public ApiRootConstructorCodeConverter(string apiRootName) public void WriteTo(CodeWriter codeWriter, CodeWriterOptions options) { - codeWriter.Properties - .WriteLine($"private readonly IWebExtensionsJSRuntime webExtensionsJSRuntime;"); + codeWriter.WriteUsingStatement("JsBind.Net"); codeWriter.Constructors .WriteWithConverter(new CommentSummaryCodeConverter($"Creates a new instance of .")) - .WriteLine($"public {apiRootName}(IWebExtensionsJSRuntime webExtensionsJSRuntime)") + .WriteWithConverter(new CommentParamCodeSectionConverter("jsRuntime", "The JS runtime adapter.")) + .WriteLine($"public {apiRootName}(IJsRuntimeAdapter jsRuntime) : base(jsRuntime, \"browser\")") .WriteStartBlock() - .WriteLine($"this.webExtensionsJSRuntime = webExtensionsJSRuntime;") .WriteEndBlock(); } } diff --git a/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/TypePropertyCodeConverter.cs b/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/TypePropertyCodeConverter.cs index 70d636e..f7911e1 100644 --- a/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/TypePropertyCodeConverter.cs +++ b/src/WebExtensions.Net.Generator/CodeGeneration/CodeConverters/TypePropertyCodeConverter.cs @@ -15,30 +15,12 @@ public void WriteTo(CodeWriter codeWriter, CodeWriterOptions options) { codeWriter.WriteUsingStatement("System.Text.Json.Serialization"); - var privatePropertyName = clrPropertyInfo.PrivateName; - codeWriter.Properties - .WriteLine($"private {clrPropertyInfo.PropertyType.CSharpName} _{privatePropertyName};"); - codeWriter.PublicProperties .WriteWithConverter(new CommentSummaryCodeConverter(clrPropertyInfo.Description)) .WriteWithConverter(clrPropertyInfo.IsObsolete ? new AttributeObsoleteCodeConverter(clrPropertyInfo.ObsoleteMessage) : null) - .WriteWithConverter(new AttributeCodeConverter($"JsonPropertyName(\"{privatePropertyName}\")")) + .WriteWithConverter(new AttributeCodeConverter($"JsonPropertyName(\"{clrPropertyInfo.Name}\")")) .WriteWithConverter(clrPropertyInfo.PropertyType.IsNullable ? new AttributeCodeConverter($"JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)") : null) - .WriteLine($"public {clrPropertyInfo.PropertyType.CSharpName} {clrPropertyInfo.PublicName}") - // start property body - .WriteStartBlock() - .WriteLine($"get") - .WriteStartBlock() - .WriteLine($"InitializeProperty(\"{privatePropertyName}\", _{privatePropertyName});") - .WriteLine($"return _{privatePropertyName};") - .WriteEndBlock() - - .WriteLine($"set") - .WriteStartBlock() - .WriteLine($"_{privatePropertyName} = value;") - .WriteEndBlock() - // end property body - .WriteEndBlock(); + .WriteLine($"public {clrPropertyInfo.PropertyType.CSharpName} {clrPropertyInfo.PublicName} {{ get; set; }}"); } } } diff --git a/src/WebExtensions.Net.Generator/EntitiesRegistration/ClassEntityRegistrars/ApiRootClassEntityRegistrar.cs b/src/WebExtensions.Net.Generator/EntitiesRegistration/ClassEntityRegistrars/ApiRootClassEntityRegistrar.cs index cf3c70e..dd47055 100644 --- a/src/WebExtensions.Net.Generator/EntitiesRegistration/ClassEntityRegistrars/ApiRootClassEntityRegistrar.cs +++ b/src/WebExtensions.Net.Generator/EntitiesRegistration/ClassEntityRegistrars/ApiRootClassEntityRegistrar.cs @@ -5,11 +5,15 @@ namespace WebExtensions.Net.Generator.EntitiesRegistration.ClassEntityRegistrars { public class ApiRootClassEntityRegistrar : BaseClassEntityRegistrar { - public ApiRootClassEntityRegistrar(EntitiesContext entitiesContext) : base(entitiesContext) + private readonly RegistrationOptions registrationOptions; + + public ApiRootClassEntityRegistrar(EntitiesContext entitiesContext, RegistrationOptions registrationOptions) : base(entitiesContext) { + this.registrationOptions = registrationOptions; } protected override ClassType GetClassType() => ClassType.ApiRootClass; + protected override string? GetBaseClassName() => registrationOptions.ApiClassBaseClassName; protected override bool ShouldImplementInterface() => true; } } diff --git a/src/WebExtensions.Net/ArgumentsHandler.cs b/src/WebExtensions.Net/ArgumentsHandler.cs deleted file mode 100644 index ca8f936..0000000 --- a/src/WebExtensions.Net/ArgumentsHandler.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Linq; -using System.Text.Json; - -namespace WebExtensions.Net -{ - /// - /// Process incoming and outgoing arguments. - /// - internal static class ArgumentsHandler - { - /// - /// Process incoming arguments. - /// - /// The incoming arguments. - /// The argument types. - /// The processed incoming arguments. - public static object[] ProcessIncomingArguments(object[] incomingArguments, Type[] argumentTypes) - { - var index = 0; - return argumentTypes.Select(argumentType => - { - var incomingArgument = index < incomingArguments.Length ? incomingArguments[index] : GetDefaultValueForType(argumentType); - - if (incomingArgument is JsonElement jsonElementArg) - { - if (jsonElementArg.ValueKind == JsonValueKind.Object && jsonElementArg.TryGetProperty("__isFunctionReference", out var isFunctionReference) && isFunctionReference.ValueKind == JsonValueKind.True) - { - return DelegateReferenceHandler.GetJSProxyDelegate(jsonElementArg.GetProperty("__id").GetGuid(), argumentType); - } - - var json = jsonElementArg.GetRawText(); - try - { - incomingArgument = JsonSerializer.Deserialize(json, argumentType); - } - catch (JsonException jsonException) - { - throw new JsonException($"Error when deserializing JSON: {json}", jsonException); - } - } - - index++; - return incomingArgument; - }).ToArray(); - } - - /// - /// Process outgoing arguments. - /// - /// The outgoing arguments. - /// The processed outgoing arguments. - public static object[] ProcessOutgoingArguments(object[] outgoingArguments) - { - return outgoingArguments.Select(outgoingArgument => - { - if (outgoingArgument is Delegate delegateArgument) - { - return DelegateReferenceHandler.GetDotNetDelegateReference(delegateArgument); - } - - return outgoingArgument; - }).ToArray(); - } - - private static object GetDefaultValueForType(Type type) - { - if (type.IsValueType) - { - return Activator.CreateInstance(type); - } - - return null; - } - } -} diff --git a/src/WebExtensions.Net/BaseApi.cs b/src/WebExtensions.Net/BaseApi.cs index b05ba63..ff3eff6 100644 --- a/src/WebExtensions.Net/BaseApi.cs +++ b/src/WebExtensions.Net/BaseApi.cs @@ -1,19 +1,16 @@ -namespace WebExtensions.Net +using JsBind.Net; + +namespace WebExtensions.Net { /// /// Base API class. /// - public class BaseApi : BaseObject + public class BaseApi : ObjectBindingBase { - /// - /// Gets the WebExtensionsJsRuntime instance. - /// - protected new IWebExtensionsJSRuntime webExtensionsJSRuntime; - - internal BaseApi(IWebExtensionsJSRuntime webExtensionsJSRuntime, string apiNamespace) + internal BaseApi(IJsRuntimeAdapter jsRuntime, string apiNamespace) { - this.webExtensionsJSRuntime = webExtensionsJSRuntime; - Initialize(webExtensionsJSRuntime, "browser", apiNamespace); + SetAccessPath(apiNamespace); + Initialize(jsRuntime); } } } diff --git a/src/WebExtensions.Net/BaseMultiTypeObject.cs b/src/WebExtensions.Net/BaseMultiTypeObject.cs index 7edcca6..72af871 100644 --- a/src/WebExtensions.Net/BaseMultiTypeObject.cs +++ b/src/WebExtensions.Net/BaseMultiTypeObject.cs @@ -1,4 +1,5 @@ using System; +using JsBind.Net; namespace WebExtensions.Net { @@ -20,22 +21,21 @@ protected BaseMultiTypeObject(object value, Type valueType) ValueType = valueType; } - /// - /// The value. - /// - public object Value + /// + protected override void Initialize(IJsRuntimeAdapter jsRuntime) { - get + base.Initialize(jsRuntime); + if (value is BaseObject baseObject) { - if (value is BaseObject baseObject && IsInitialized) - { - baseObject.Initialize(webExtensionsJSRuntime, referenceId, accessPath); - } - - return value; + baseObject.Initialize(jsRuntime, AccessPath); } } + /// + /// The value. + /// + public object Value => value; + /// /// The type of the value. /// diff --git a/src/WebExtensions.Net/BaseObject.cs b/src/WebExtensions.Net/BaseObject.cs index eef4ffe..de0c245 100644 --- a/src/WebExtensions.Net/BaseObject.cs +++ b/src/WebExtensions.Net/BaseObject.cs @@ -1,113 +1,16 @@ -using System; -using System.Collections.Generic; -using System.Text.Json.Serialization; -using System.Threading.Tasks; +using JsBind.Net; namespace WebExtensions.Net { /// /// Base object returned from JavaScript. /// - public class BaseObject : IDisposable + public class BaseObject : ObjectBindingBase { - internal bool IsInitialized; - internal IWebExtensionsJSRuntime webExtensionsJSRuntime; - internal string referenceId; - internal string accessPath; - - /// Contains any additional data within this object instance. - [JsonExtensionData] - public IDictionary AdditionalData { get; set; } - - internal void Initialize(IWebExtensionsJSRuntime webExtensionsJSRuntime, string referenceId, string accessPath) - { - if (!IsInitialized) - { - IsInitialized = true; - this.webExtensionsJSRuntime = webExtensionsJSRuntime; - this.referenceId = referenceId; - this.accessPath = accessPath; - } - } - - /// - /// Initialize property if it is a base object - /// - /// The property name. - /// The property value. - protected void InitializeProperty(string propertyName, object propertyValue) - { - if (propertyValue is BaseObject baseObject && !baseObject.IsInitialized) - { - var propertyAccessPath = string.IsNullOrEmpty(accessPath) ? propertyName : $"{accessPath}.{propertyName}"; - baseObject.Initialize(webExtensionsJSRuntime, referenceId, propertyAccessPath); - } - } - - /// - /// Gets the property from the object asynchronously. - /// - /// The property name to get. - /// An instance of TValue obtained by JSON-deserializing the return value. - internal ValueTask GetPropertyAsync(string propertyName) - { - var functionIdentifier = string.IsNullOrEmpty(accessPath) ? propertyName : $"{accessPath}.{propertyName}"; - return webExtensionsJSRuntime.InvokeAsync(InvokeObjectReferenceOption.Identifier, new InvokeObjectReferenceOption(referenceId, functionIdentifier, false)); - } - - /// - /// Invokes the specified JavaScript function asynchronously. - /// - /// The function to invoke. - /// JSON-serializable arguments. - /// An instance of TValue obtained by JSON-deserializing the return value. - internal ValueTask InvokeAsync(string function, params object[] args) - { - var functionIdentifier = string.IsNullOrEmpty(accessPath) ? function : $"{accessPath}.{function}"; - return webExtensionsJSRuntime.InvokeAsync(InvokeObjectReferenceOption.Identifier, new InvokeObjectReferenceOption(referenceId, functionIdentifier, true), args); - } - - /// - /// Invokes the specified JavaScript function asynchronously. - /// - /// The function to invoke. - /// JSON-serializable arguments. - /// A System.Threading.Tasks.ValueTask that represents the asynchronous invocation operation. - internal ValueTask InvokeVoidAsync(string function, params object[] args) - { - var functionIdentifier = string.IsNullOrEmpty(accessPath) ? function : $"{accessPath}.{function}"; - return webExtensionsJSRuntime.InvokeVoidAsync(InvokeObjectReferenceOption.Identifier, new InvokeObjectReferenceOption(referenceId, functionIdentifier, true), args); - } - - /// - /// Dispose the object - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Dispose the object - /// - /// - protected virtual void Dispose(bool disposing) - { - // Cleanup - if (!string.IsNullOrEmpty(referenceId) && webExtensionsJSRuntime != null) - { - webExtensionsJSRuntime.InvokeVoid(RemoveObjectReferenceOption.Identifier, new RemoveObjectReferenceOption(referenceId)); - referenceId = null; - } - } - - /// - /// Finalizer to call Dispose() - /// - ~BaseObject() + internal void Initialize(IJsRuntimeAdapter jsRuntime, string accessPath) { - Dispose(false); + SetAccessPath(accessPath); + Initialize(jsRuntime); } } } diff --git a/src/WebExtensions.Net/DelegateReferenceHandler.cs b/src/WebExtensions.Net/DelegateReferenceHandler.cs deleted file mode 100644 index 4149a82..0000000 --- a/src/WebExtensions.Net/DelegateReferenceHandler.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.JSInterop; - -namespace WebExtensions.Net -{ - /// - /// Handles passing delegate reference to be invoked in JavaScript. - /// - public static class DelegateReferenceHandler - { - private static readonly Dictionary delegateReferences = new(); - private static readonly Dictionary jsProxyDelegates = new(); - - /// - /// Invoke a delegate reference from JavaScript. - /// - /// The identifier of the delegate. - /// The arguments to invoke the delegate. - /// The result of the delegate invocation. - [JSInvokable] - public static object InvokeDelegateFromJS(Guid id, object[] args) - { - if (delegateReferences.TryGetValue(id, out var delegateInstance)) - { - return InvokeDelegate(delegateInstance, args); - } - - throw new InvalidOperationException("Delegate reference does not exist."); - } - - /// - /// Gets an instance of DotNetDelegateReference representing the delegate. - /// - /// The delegate. - /// An instance of DotNetDelegateReference referencing the delegate argument. - internal static DotNetDelegateReference GetDotNetDelegateReference(Delegate delegateArgument) - { - Guid delegateReferenceId; - if (delegateReferences.ContainsValue(delegateArgument)) - { - delegateReferenceId = delegateReferences.ToDictionary(p => p.Value, p => p.Key)[delegateArgument]; - } - else - { - delegateReferenceId = Guid.NewGuid(); - delegateReferences.Add(delegateReferenceId, delegateArgument); - } - - return new DotNetDelegateReference(delegateReferenceId); - } - - /// - /// Gets the proxy delegate to invoke the JavaScript function. - /// - /// The identifier of the function. - /// The delegate type. - /// A delegate matching the signature of the delegate type, when invoked executes the JavaScript function. - internal static Delegate GetJSProxyDelegate(Guid id, Type delegateType) - { - if (jsProxyDelegates.ContainsKey(id)) - { - return jsProxyDelegates[id]; - } - - var functionProxy = new JSFunctionProxy(id); - var proxyDelegate = functionProxy.GetDelegate(delegateType); - jsProxyDelegates.Add(id, proxyDelegate); - return proxyDelegate; - } - - /// - /// Invokes a delegate instance with the arguments. - /// - /// The delegate. - /// The arguments to invoke the delegate. - /// The result of the delegate invocation. - private static object InvokeDelegate(Delegate delegateInstance, object[] args) - { - var invokeMethod = delegateInstance.GetType().GetMethod("Invoke"); - var argumentTypes = invokeMethod.GetParameters().Select(p => p.ParameterType).ToArray(); - var processedArgs = ArgumentsHandler.ProcessIncomingArguments(args, argumentTypes); - return invokeMethod.Invoke(delegateInstance, processedArgs.ToArray()); - } - } -} diff --git a/src/WebExtensions.Net/DotNetDelegateReference.cs b/src/WebExtensions.Net/DotNetDelegateReference.cs deleted file mode 100644 index ed278ea..0000000 --- a/src/WebExtensions.Net/DotNetDelegateReference.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Text.Json.Serialization; - -namespace WebExtensions.Net -{ - /// - /// A DotNet delegate reference to be invoked in JavaScript. - /// - internal class DotNetDelegateReference - { - /// - /// Creates a new instance of the DotNetDelegateReference class. - /// - /// The identifier. - public DotNetDelegateReference(Guid id) - { - Id = id; - } - - /// - /// Indicate that this object is a DotNet delegate reference. - /// - [JsonPropertyName("__isDelegateReference")] - public bool IsDelegateReference { get; } = true; - - /// - /// The identifier of this DotNet delegate reference. - /// - [JsonPropertyName("__id")] - public Guid Id { get; } - } -} diff --git a/src/WebExtensions.Net/Extensions/Search/Disposition.cs b/src/WebExtensions.Net/Extensions/Search/Disposition.cs index 6668231..8986350 100644 --- a/src/WebExtensions.Net/Extensions/Search/Disposition.cs +++ b/src/WebExtensions.Net/Extensions/Search/Disposition.cs @@ -17,6 +17,5 @@ public enum Disposition /// New Window [EnumValue("NEW_WINDOW")] NewWindow - } } diff --git a/src/WebExtensions.Net/Extensions/Search/QueryInfo.cs b/src/WebExtensions.Net/Extensions/Search/QueryInfo.cs index ed0c285..3b49db5 100644 --- a/src/WebExtensions.Net/Extensions/Search/QueryInfo.cs +++ b/src/WebExtensions.Net/Extensions/Search/QueryInfo.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using WebExtensions.Net.Search; -using System.Text.Json.Serialization; +using System.Text.Json.Serialization; namespace WebExtensions.Net.Search { @@ -12,58 +6,19 @@ namespace WebExtensions.Net.Search /// public class QueryInfo : BaseObject { - private Disposition _disposition; - private string _text; - private int? _tabId; - - /// Optional, Location where search results should be displayed. CURRENT_TAB is the default. [JsonPropertyName("disposition")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Disposition Disposition - { - get - { - InitializeProperty("disposition", _disposition); - return _disposition; - } - set - { - _disposition = value; - } - } - + public Disposition Disposition { get; set; } /// Optional, Location where search results should be displayed. Cannot be used with disposition. [JsonPropertyName("tabId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int? TabId { get; set; } /// String to query with the default search provider. [JsonPropertyName("text")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Text - { - get - { - InitializeProperty("text", _text); - return _text; - } - set - { - _text = value; - } - } + public string Text { get; set; } } } diff --git a/src/WebExtensions.Net/Extensions/Search/SearchApi.cs b/src/WebExtensions.Net/Extensions/Search/SearchApi.cs index b124392..c2d7401 100644 --- a/src/WebExtensions.Net/Extensions/Search/SearchApi.cs +++ b/src/WebExtensions.Net/Extensions/Search/SearchApi.cs @@ -4,6 +4,7 @@ namespace WebExtensions.Net.Search { public partial class SearchApi { + /// public ValueTask Query(QueryInfo queryInfo) { return InvokeVoidAsync("query", queryInfo); diff --git a/src/WebExtensions.Net/Generated/Alarms/Alarm.cs b/src/WebExtensions.Net/Generated/Alarms/Alarm.cs index 002c326..2facf7b 100644 --- a/src/WebExtensions.Net/Generated/Alarms/Alarm.cs +++ b/src/WebExtensions.Net/Generated/Alarms/Alarm.cs @@ -1,60 +1,25 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Alarms { // Type Class /// + [BindAllProperties] public partial class Alarm : BaseObject { - private string _name; - private double? _periodInMinutes; - private EpochTime _scheduledTime; - /// Name of this alarm. [JsonPropertyName("name")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Name - { - get - { - InitializeProperty("name", _name); - return _name; - } - set - { - _name = value; - } - } + public string Name { get; set; } /// When present, signals that the alarm triggers periodically after so many minutes. [JsonPropertyName("periodInMinutes")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? PeriodInMinutes - { - get - { - InitializeProperty("periodInMinutes", _periodInMinutes); - return _periodInMinutes; - } - set - { - _periodInMinutes = value; - } - } + public double? PeriodInMinutes { get; set; } /// Time when the alarm is scheduled to fire, in milliseconds past the epoch. [JsonPropertyName("scheduledTime")] - public EpochTime ScheduledTime - { - get - { - InitializeProperty("scheduledTime", _scheduledTime); - return _scheduledTime; - } - set - { - _scheduledTime = value; - } - } + public EpochTime ScheduledTime { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Alarms/AlarmInfo.cs b/src/WebExtensions.Net/Generated/Alarms/AlarmInfo.cs index fc21ef5..e776947 100644 --- a/src/WebExtensions.Net/Generated/Alarms/AlarmInfo.cs +++ b/src/WebExtensions.Net/Generated/Alarms/AlarmInfo.cs @@ -1,61 +1,26 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Alarms { // Type Class /// Details about the alarm. The alarm first fires either at 'when' milliseconds past the epoch (if 'when' is provided), after 'delayInMinutes' minutes from the current time (if 'delayInMinutes' is provided instead), or after 'periodInMinutes' minutes from the current time (if only 'periodInMinutes' is provided). Users should never provide both 'when' and 'delayInMinutes'. If 'periodInMinutes' is provided, then the alarm recurs repeatedly after that many minutes. + [BindAllProperties] public partial class AlarmInfo : BaseObject { - private double? _delayInMinutes; - private double? _periodInMinutes; - private EpochTime? _when; - /// Number of minutes from the current time after which the alarm should first fire. [JsonPropertyName("delayInMinutes")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? DelayInMinutes - { - get - { - InitializeProperty("delayInMinutes", _delayInMinutes); - return _delayInMinutes; - } - set - { - _delayInMinutes = value; - } - } + public double? DelayInMinutes { get; set; } /// Number of minutes after which the alarm should recur repeatedly. [JsonPropertyName("periodInMinutes")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? PeriodInMinutes - { - get - { - InitializeProperty("periodInMinutes", _periodInMinutes); - return _periodInMinutes; - } - set - { - _periodInMinutes = value; - } - } + public double? PeriodInMinutes { get; set; } /// Time when the alarm is scheduled to first fire, in milliseconds past the epoch. [JsonPropertyName("when")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public EpochTime? When - { - get - { - InitializeProperty("when", _when); - return _when; - } - set - { - _when = value; - } - } + public EpochTime? When { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Alarms/AlarmsApi.cs b/src/WebExtensions.Net/Generated/Alarms/AlarmsApi.cs index ba305a6..0c0815b 100644 --- a/src/WebExtensions.Net/Generated/Alarms/AlarmsApi.cs +++ b/src/WebExtensions.Net/Generated/Alarms/AlarmsApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Threading.Tasks; @@ -9,8 +10,9 @@ public partial class AlarmsApi : BaseApi, IAlarmsApi private OnAlarmEvent _onAlarm; /// Creates a new instance of . - /// Web Extension JS Runtime - public AlarmsApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "alarms") + /// The JS runtime adapter. + /// The base API access path. + public AlarmsApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "alarms")) { } @@ -22,7 +24,7 @@ public OnAlarmEvent OnAlarm if (_onAlarm is null) { _onAlarm = new OnAlarmEvent(); - InitializeProperty("onAlarm", _onAlarm); + _onAlarm.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onAlarm")); } return _onAlarm; } diff --git a/src/WebExtensions.Net/Generated/Alarms/OnAlarmEvent.cs b/src/WebExtensions.Net/Generated/Alarms/OnAlarmEvent.cs index 2a02df6..88b87c7 100644 --- a/src/WebExtensions.Net/Generated/Alarms/OnAlarmEvent.cs +++ b/src/WebExtensions.Net/Generated/Alarms/OnAlarmEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Alarms { // Type Class /// Fired when an alarm has expired. Useful for transient background pages. + [BindAllProperties] public partial class OnAlarmEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Bookmarks/AddListenerCallbackChangeInfo.cs b/src/WebExtensions.Net/Generated/Bookmarks/AddListenerCallbackChangeInfo.cs index 62f8418..569bf80 100644 --- a/src/WebExtensions.Net/Generated/Bookmarks/AddListenerCallbackChangeInfo.cs +++ b/src/WebExtensions.Net/Generated/Bookmarks/AddListenerCallbackChangeInfo.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Bookmarks { // Type Class /// + [BindAllProperties] public partial class AddListenerCallbackChangeInfo : BaseObject { - private string _title; - private string _url; - /// [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Bookmarks/AddListenerCallbackMoveInfo.cs b/src/WebExtensions.Net/Generated/Bookmarks/AddListenerCallbackMoveInfo.cs index 989a09b..cc4f788 100644 --- a/src/WebExtensions.Net/Generated/Bookmarks/AddListenerCallbackMoveInfo.cs +++ b/src/WebExtensions.Net/Generated/Bookmarks/AddListenerCallbackMoveInfo.cs @@ -1,76 +1,29 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Bookmarks { // Type Class /// + [BindAllProperties] public partial class AddListenerCallbackMoveInfo : BaseObject { - private int _index; - private int _oldIndex; - private string _oldParentId; - private string _parentId; - /// [JsonPropertyName("index")] - public int Index - { - get - { - InitializeProperty("index", _index); - return _index; - } - set - { - _index = value; - } - } + public int Index { get; set; } /// [JsonPropertyName("oldIndex")] - public int OldIndex - { - get - { - InitializeProperty("oldIndex", _oldIndex); - return _oldIndex; - } - set - { - _oldIndex = value; - } - } + public int OldIndex { get; set; } /// [JsonPropertyName("oldParentId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OldParentId - { - get - { - InitializeProperty("oldParentId", _oldParentId); - return _oldParentId; - } - set - { - _oldParentId = value; - } - } + public string OldParentId { get; set; } /// [JsonPropertyName("parentId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string ParentId - { - get - { - InitializeProperty("parentId", _parentId); - return _parentId; - } - set - { - _parentId = value; - } - } + public string ParentId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Bookmarks/AddListenerCallbackRemoveInfo.cs b/src/WebExtensions.Net/Generated/Bookmarks/AddListenerCallbackRemoveInfo.cs index 3c03d14..c774a30 100644 --- a/src/WebExtensions.Net/Generated/Bookmarks/AddListenerCallbackRemoveInfo.cs +++ b/src/WebExtensions.Net/Generated/Bookmarks/AddListenerCallbackRemoveInfo.cs @@ -1,60 +1,25 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Bookmarks { // Type Class /// + [BindAllProperties] public partial class AddListenerCallbackRemoveInfo : BaseObject { - private int _index; - private BookmarkTreeNode _node; - private string _parentId; - /// [JsonPropertyName("index")] - public int Index - { - get - { - InitializeProperty("index", _index); - return _index; - } - set - { - _index = value; - } - } + public int Index { get; set; } /// [JsonPropertyName("node")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public BookmarkTreeNode Node - { - get - { - InitializeProperty("node", _node); - return _node; - } - set - { - _node = value; - } - } + public BookmarkTreeNode Node { get; set; } /// [JsonPropertyName("parentId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string ParentId - { - get - { - InitializeProperty("parentId", _parentId); - return _parentId; - } - set - { - _parentId = value; - } - } + public string ParentId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Bookmarks/BookmarkTreeNode.cs b/src/WebExtensions.Net/Generated/Bookmarks/BookmarkTreeNode.cs index eddeee6..3bec33f 100644 --- a/src/WebExtensions.Net/Generated/Bookmarks/BookmarkTreeNode.cs +++ b/src/WebExtensions.Net/Generated/Bookmarks/BookmarkTreeNode.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,177 +6,57 @@ namespace WebExtensions.Net.Bookmarks { // Type Class /// A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder. + [BindAllProperties] public partial class BookmarkTreeNode : BaseObject { - private IEnumerable _children; - private EpochTime? _dateAdded; - private EpochTime? _dateGroupModified; - private string _id; - private int? _index; - private string _parentId; - private string _title; - private BookmarkTreeNodeType? _type; - private BookmarkTreeNodeUnmodifiable? _unmodifiable; - private string _url; - /// An ordered list of children of this node. [JsonPropertyName("children")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Children - { - get - { - InitializeProperty("children", _children); - return _children; - } - set - { - _children = value; - } - } + public IEnumerable Children { get; set; } /// When this node was created, in milliseconds since the epoch (new Date(dateAdded)). [JsonPropertyName("dateAdded")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public EpochTime? DateAdded - { - get - { - InitializeProperty("dateAdded", _dateAdded); - return _dateAdded; - } - set - { - _dateAdded = value; - } - } + public EpochTime? DateAdded { get; set; } /// When the contents of this folder last changed, in milliseconds since the epoch. [JsonPropertyName("dateGroupModified")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public EpochTime? DateGroupModified - { - get - { - InitializeProperty("dateGroupModified", _dateGroupModified); - return _dateGroupModified; - } - set - { - _dateGroupModified = value; - } - } + public EpochTime? DateGroupModified { get; set; } /// The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the browser is restarted. [JsonPropertyName("id")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Id - { - get - { - InitializeProperty("id", _id); - return _id; - } - set - { - _id = value; - } - } + public string Id { get; set; } /// The 0-based position of this node within its parent folder. [JsonPropertyName("index")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Index - { - get - { - InitializeProperty("index", _index); - return _index; - } - set - { - _index = value; - } - } + public int? Index { get; set; } /// The id of the parent folder. Omitted for the root node. [JsonPropertyName("parentId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string ParentId - { - get - { - InitializeProperty("parentId", _parentId); - return _parentId; - } - set - { - _parentId = value; - } - } + public string ParentId { get; set; } /// The text displayed for the node. [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// Indicates the type of the BookmarkTreeNode, which can be one of bookmark, folder or separator. [JsonPropertyName("type")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public BookmarkTreeNodeType? Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public BookmarkTreeNodeType? Type { get; set; } /// Indicates the reason why this node is unmodifiable. The managed value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default). [JsonPropertyName("unmodifiable")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public BookmarkTreeNodeUnmodifiable? Unmodifiable - { - get - { - InitializeProperty("unmodifiable", _unmodifiable); - return _unmodifiable; - } - set - { - _unmodifiable = value; - } - } + public BookmarkTreeNodeUnmodifiable? Unmodifiable { get; set; } /// The URL navigated to when a user clicks the bookmark. Omitted for folders. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Bookmarks/BookmarksApi.cs b/src/WebExtensions.Net/Generated/Bookmarks/BookmarksApi.cs index da33033..da7e365 100644 --- a/src/WebExtensions.Net/Generated/Bookmarks/BookmarksApi.cs +++ b/src/WebExtensions.Net/Generated/Bookmarks/BookmarksApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Threading.Tasks; @@ -12,8 +13,9 @@ public partial class BookmarksApi : BaseApi, IBookmarksApi private OnRemovedEvent _onRemoved; /// Creates a new instance of . - /// Web Extension JS Runtime - public BookmarksApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "bookmarks") + /// The JS runtime adapter. + /// The base API access path. + public BookmarksApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "bookmarks")) { } @@ -25,7 +27,7 @@ public OnChangedEvent OnChanged if (_onChanged is null) { _onChanged = new OnChangedEvent(); - InitializeProperty("onChanged", _onChanged); + _onChanged.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onChanged")); } return _onChanged; } @@ -39,7 +41,7 @@ public OnCreatedEvent OnCreated if (_onCreated is null) { _onCreated = new OnCreatedEvent(); - InitializeProperty("onCreated", _onCreated); + _onCreated.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onCreated")); } return _onCreated; } @@ -53,7 +55,7 @@ public OnMovedEvent OnMoved if (_onMoved is null) { _onMoved = new OnMovedEvent(); - InitializeProperty("onMoved", _onMoved); + _onMoved.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onMoved")); } return _onMoved; } @@ -67,7 +69,7 @@ public OnRemovedEvent OnRemoved if (_onRemoved is null) { _onRemoved = new OnRemovedEvent(); - InitializeProperty("onRemoved", _onRemoved); + _onRemoved.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onRemoved")); } return _onRemoved; } diff --git a/src/WebExtensions.Net/Generated/Bookmarks/Changes.cs b/src/WebExtensions.Net/Generated/Bookmarks/Changes.cs index e353d61..a2bf44e 100644 --- a/src/WebExtensions.Net/Generated/Bookmarks/Changes.cs +++ b/src/WebExtensions.Net/Generated/Bookmarks/Changes.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Bookmarks { // Type Class /// + [BindAllProperties] public partial class Changes : BaseObject { - private string _title; - private string _url; - /// [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Bookmarks/CreateDetails.cs b/src/WebExtensions.Net/Generated/Bookmarks/CreateDetails.cs index 1555c03..c50bdf6 100644 --- a/src/WebExtensions.Net/Generated/Bookmarks/CreateDetails.cs +++ b/src/WebExtensions.Net/Generated/Bookmarks/CreateDetails.cs @@ -1,95 +1,36 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Bookmarks { // Type Class /// Object passed to the create() function. + [BindAllProperties] public partial class CreateDetails : BaseObject { - private int? _index; - private string _parentId; - private string _title; - private BookmarkTreeNodeType? _type; - private string _url; - /// [JsonPropertyName("index")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Index - { - get - { - InitializeProperty("index", _index); - return _index; - } - set - { - _index = value; - } - } + public int? Index { get; set; } /// Defaults to the Other Bookmarks folder. [JsonPropertyName("parentId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string ParentId - { - get - { - InitializeProperty("parentId", _parentId); - return _parentId; - } - set - { - _parentId = value; - } - } + public string ParentId { get; set; } /// [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// Indicates the type of BookmarkTreeNode to create, which can be one of bookmark, folder or separator. [JsonPropertyName("type")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public BookmarkTreeNodeType? Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public BookmarkTreeNodeType? Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Bookmarks/Destination.cs b/src/WebExtensions.Net/Generated/Bookmarks/Destination.cs index 10a7ed9..7f88094 100644 --- a/src/WebExtensions.Net/Generated/Bookmarks/Destination.cs +++ b/src/WebExtensions.Net/Generated/Bookmarks/Destination.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Bookmarks { // Type Class /// + [BindAllProperties] public partial class Destination : BaseObject { - private int? _index; - private string _parentId; - /// [JsonPropertyName("index")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Index - { - get - { - InitializeProperty("index", _index); - return _index; - } - set - { - _index = value; - } - } + public int? Index { get; set; } /// [JsonPropertyName("parentId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string ParentId - { - get - { - InitializeProperty("parentId", _parentId); - return _parentId; - } - set - { - _parentId = value; - } - } + public string ParentId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Bookmarks/HasListenerCallbackChangeInfo.cs b/src/WebExtensions.Net/Generated/Bookmarks/HasListenerCallbackChangeInfo.cs index b5ba3c4..b8d5567 100644 --- a/src/WebExtensions.Net/Generated/Bookmarks/HasListenerCallbackChangeInfo.cs +++ b/src/WebExtensions.Net/Generated/Bookmarks/HasListenerCallbackChangeInfo.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Bookmarks { // Type Class /// + [BindAllProperties] public partial class HasListenerCallbackChangeInfo : BaseObject { - private string _title; - private string _url; - /// [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Bookmarks/HasListenerCallbackMoveInfo.cs b/src/WebExtensions.Net/Generated/Bookmarks/HasListenerCallbackMoveInfo.cs index b70b793..b84fff2 100644 --- a/src/WebExtensions.Net/Generated/Bookmarks/HasListenerCallbackMoveInfo.cs +++ b/src/WebExtensions.Net/Generated/Bookmarks/HasListenerCallbackMoveInfo.cs @@ -1,76 +1,29 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Bookmarks { // Type Class /// + [BindAllProperties] public partial class HasListenerCallbackMoveInfo : BaseObject { - private int _index; - private int _oldIndex; - private string _oldParentId; - private string _parentId; - /// [JsonPropertyName("index")] - public int Index - { - get - { - InitializeProperty("index", _index); - return _index; - } - set - { - _index = value; - } - } + public int Index { get; set; } /// [JsonPropertyName("oldIndex")] - public int OldIndex - { - get - { - InitializeProperty("oldIndex", _oldIndex); - return _oldIndex; - } - set - { - _oldIndex = value; - } - } + public int OldIndex { get; set; } /// [JsonPropertyName("oldParentId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OldParentId - { - get - { - InitializeProperty("oldParentId", _oldParentId); - return _oldParentId; - } - set - { - _oldParentId = value; - } - } + public string OldParentId { get; set; } /// [JsonPropertyName("parentId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string ParentId - { - get - { - InitializeProperty("parentId", _parentId); - return _parentId; - } - set - { - _parentId = value; - } - } + public string ParentId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Bookmarks/HasListenerCallbackRemoveInfo.cs b/src/WebExtensions.Net/Generated/Bookmarks/HasListenerCallbackRemoveInfo.cs index 047680b..1c8f690 100644 --- a/src/WebExtensions.Net/Generated/Bookmarks/HasListenerCallbackRemoveInfo.cs +++ b/src/WebExtensions.Net/Generated/Bookmarks/HasListenerCallbackRemoveInfo.cs @@ -1,60 +1,25 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Bookmarks { // Type Class /// + [BindAllProperties] public partial class HasListenerCallbackRemoveInfo : BaseObject { - private int _index; - private BookmarkTreeNode _node; - private string _parentId; - /// [JsonPropertyName("index")] - public int Index - { - get - { - InitializeProperty("index", _index); - return _index; - } - set - { - _index = value; - } - } + public int Index { get; set; } /// [JsonPropertyName("node")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public BookmarkTreeNode Node - { - get - { - InitializeProperty("node", _node); - return _node; - } - set - { - _node = value; - } - } + public BookmarkTreeNode Node { get; set; } /// [JsonPropertyName("parentId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string ParentId - { - get - { - InitializeProperty("parentId", _parentId); - return _parentId; - } - set - { - _parentId = value; - } - } + public string ParentId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Bookmarks/OnChangedEvent.cs b/src/WebExtensions.Net/Generated/Bookmarks/OnChangedEvent.cs index 7a4492f..5f9c2ed 100644 --- a/src/WebExtensions.Net/Generated/Bookmarks/OnChangedEvent.cs +++ b/src/WebExtensions.Net/Generated/Bookmarks/OnChangedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Bookmarks { // Type Class /// Fired when a bookmark or folder changes. 'b'Note:'/b' Currently, only title and url changes trigger this. + [BindAllProperties] public partial class OnChangedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Bookmarks/OnCreatedEvent.cs b/src/WebExtensions.Net/Generated/Bookmarks/OnCreatedEvent.cs index c7eac77..d571a07 100644 --- a/src/WebExtensions.Net/Generated/Bookmarks/OnCreatedEvent.cs +++ b/src/WebExtensions.Net/Generated/Bookmarks/OnCreatedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Bookmarks { // Type Class /// Fired when a bookmark or folder is created. + [BindAllProperties] public partial class OnCreatedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Bookmarks/OnMovedEvent.cs b/src/WebExtensions.Net/Generated/Bookmarks/OnMovedEvent.cs index 96f8505..d080ae7 100644 --- a/src/WebExtensions.Net/Generated/Bookmarks/OnMovedEvent.cs +++ b/src/WebExtensions.Net/Generated/Bookmarks/OnMovedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Bookmarks { // Type Class /// Fired when a bookmark or folder is moved to a different parent folder. + [BindAllProperties] public partial class OnMovedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Bookmarks/OnRemovedEvent.cs b/src/WebExtensions.Net/Generated/Bookmarks/OnRemovedEvent.cs index 5e3f226..0af4031 100644 --- a/src/WebExtensions.Net/Generated/Bookmarks/OnRemovedEvent.cs +++ b/src/WebExtensions.Net/Generated/Bookmarks/OnRemovedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Bookmarks { // Type Class /// Fired when a bookmark or folder is removed. When a folder is removed recursively, a single notification is fired for the folder, and none for its contents. + [BindAllProperties] public partial class OnRemovedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Bookmarks/RemoveListenerCallbackChangeInfo.cs b/src/WebExtensions.Net/Generated/Bookmarks/RemoveListenerCallbackChangeInfo.cs index eea4164..bf4679f 100644 --- a/src/WebExtensions.Net/Generated/Bookmarks/RemoveListenerCallbackChangeInfo.cs +++ b/src/WebExtensions.Net/Generated/Bookmarks/RemoveListenerCallbackChangeInfo.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Bookmarks { // Type Class /// + [BindAllProperties] public partial class RemoveListenerCallbackChangeInfo : BaseObject { - private string _title; - private string _url; - /// [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Bookmarks/RemoveListenerCallbackMoveInfo.cs b/src/WebExtensions.Net/Generated/Bookmarks/RemoveListenerCallbackMoveInfo.cs index 350f7f1..0da85e5 100644 --- a/src/WebExtensions.Net/Generated/Bookmarks/RemoveListenerCallbackMoveInfo.cs +++ b/src/WebExtensions.Net/Generated/Bookmarks/RemoveListenerCallbackMoveInfo.cs @@ -1,76 +1,29 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Bookmarks { // Type Class /// + [BindAllProperties] public partial class RemoveListenerCallbackMoveInfo : BaseObject { - private int _index; - private int _oldIndex; - private string _oldParentId; - private string _parentId; - /// [JsonPropertyName("index")] - public int Index - { - get - { - InitializeProperty("index", _index); - return _index; - } - set - { - _index = value; - } - } + public int Index { get; set; } /// [JsonPropertyName("oldIndex")] - public int OldIndex - { - get - { - InitializeProperty("oldIndex", _oldIndex); - return _oldIndex; - } - set - { - _oldIndex = value; - } - } + public int OldIndex { get; set; } /// [JsonPropertyName("oldParentId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OldParentId - { - get - { - InitializeProperty("oldParentId", _oldParentId); - return _oldParentId; - } - set - { - _oldParentId = value; - } - } + public string OldParentId { get; set; } /// [JsonPropertyName("parentId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string ParentId - { - get - { - InitializeProperty("parentId", _parentId); - return _parentId; - } - set - { - _parentId = value; - } - } + public string ParentId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Bookmarks/RemoveListenerCallbackRemoveInfo.cs b/src/WebExtensions.Net/Generated/Bookmarks/RemoveListenerCallbackRemoveInfo.cs index fad85b0..da8d22f 100644 --- a/src/WebExtensions.Net/Generated/Bookmarks/RemoveListenerCallbackRemoveInfo.cs +++ b/src/WebExtensions.Net/Generated/Bookmarks/RemoveListenerCallbackRemoveInfo.cs @@ -1,60 +1,25 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Bookmarks { // Type Class /// + [BindAllProperties] public partial class RemoveListenerCallbackRemoveInfo : BaseObject { - private int _index; - private BookmarkTreeNode _node; - private string _parentId; - /// [JsonPropertyName("index")] - public int Index - { - get - { - InitializeProperty("index", _index); - return _index; - } - set - { - _index = value; - } - } + public int Index { get; set; } /// [JsonPropertyName("node")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public BookmarkTreeNode Node - { - get - { - InitializeProperty("node", _node); - return _node; - } - set - { - _node = value; - } - } + public BookmarkTreeNode Node { get; set; } /// [JsonPropertyName("parentId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string ParentId - { - get - { - InitializeProperty("parentId", _parentId); - return _parentId; - } - set - { - _parentId = value; - } - } + public string ParentId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/BrowserAction/BrowserActionApi.cs b/src/WebExtensions.Net/Generated/BrowserAction/BrowserActionApi.cs index 243734f..f5ffec5 100644 --- a/src/WebExtensions.Net/Generated/BrowserAction/BrowserActionApi.cs +++ b/src/WebExtensions.Net/Generated/BrowserAction/BrowserActionApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Threading.Tasks; namespace WebExtensions.Net.BrowserAction @@ -8,8 +9,9 @@ public partial class BrowserActionApi : BaseApi, IBrowserActionApi private OnClickedEvent _onClicked; /// Creates a new instance of . - /// Web Extension JS Runtime - public BrowserActionApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "browserAction") + /// The JS runtime adapter. + /// The base API access path. + public BrowserActionApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "browserAction")) { } @@ -21,7 +23,7 @@ public OnClickedEvent OnClicked if (_onClicked is null) { _onClicked = new OnClickedEvent(); - InitializeProperty("onClicked", _onClicked); + _onClicked.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onClicked")); } return _onClicked; } diff --git a/src/WebExtensions.Net/Generated/BrowserAction/Details.cs b/src/WebExtensions.Net/Generated/BrowserAction/Details.cs index 502a4ee..1e42dc0 100644 --- a/src/WebExtensions.Net/Generated/BrowserAction/Details.cs +++ b/src/WebExtensions.Net/Generated/BrowserAction/Details.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.BrowserAction { // Type Class /// Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved. + [BindAllProperties] public partial class Details : BaseObject { - private int? _tabId; - private int? _windowId; - /// When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the window one will be inherited. [JsonPropertyName("tabId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int? TabId { get; set; } /// When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value from; if there is no window-specific value, the global one will be inherited. [JsonPropertyName("windowId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int? WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/BrowserAction/ImageDataType.cs b/src/WebExtensions.Net/Generated/BrowserAction/ImageDataType.cs index 503f760..916563f 100644 --- a/src/WebExtensions.Net/Generated/BrowserAction/ImageDataType.cs +++ b/src/WebExtensions.Net/Generated/BrowserAction/ImageDataType.cs @@ -1,7 +1,10 @@ +using JsBind.Net; + namespace WebExtensions.Net.BrowserAction { // Type Class /// Pixel data for an image. Must be an ImageData object (for example, from a canvas element). + [BindAllProperties] public partial class ImageDataType : BaseObject { } diff --git a/src/WebExtensions.Net/Generated/BrowserAction/OnClickData.cs b/src/WebExtensions.Net/Generated/BrowserAction/OnClickData.cs index 3400cc7..aaa8dd2 100644 --- a/src/WebExtensions.Net/Generated/BrowserAction/OnClickData.cs +++ b/src/WebExtensions.Net/Generated/BrowserAction/OnClickData.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,41 +6,17 @@ namespace WebExtensions.Net.BrowserAction { // Type Class /// Information sent when a browser action is clicked. + [BindAllProperties] public partial class OnClickData : BaseObject { - private int? _button; - private IEnumerable _modifiers; - /// An integer value of button by which menu item was clicked. [JsonPropertyName("button")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Button - { - get - { - InitializeProperty("button", _button); - return _button; - } - set - { - _button = value; - } - } + public int? Button { get; set; } /// An array of keyboard modifiers that were held while the menu item was clicked. [JsonPropertyName("modifiers")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Modifiers - { - get - { - InitializeProperty("modifiers", _modifiers); - return _modifiers; - } - set - { - _modifiers = value; - } - } + public IEnumerable Modifiers { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/BrowserAction/OnClickedEvent.cs b/src/WebExtensions.Net/Generated/BrowserAction/OnClickedEvent.cs index c265a20..8c906c6 100644 --- a/src/WebExtensions.Net/Generated/BrowserAction/OnClickedEvent.cs +++ b/src/WebExtensions.Net/Generated/BrowserAction/OnClickedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -7,6 +8,7 @@ namespace WebExtensions.Net.BrowserAction { // Type Class /// Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup. + [BindAllProperties] public partial class OnClickedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/BrowserAction/SetBadgeBackgroundColorDetails.cs b/src/WebExtensions.Net/Generated/BrowserAction/SetBadgeBackgroundColorDetails.cs index 017ff6a..1345e28 100644 --- a/src/WebExtensions.Net/Generated/BrowserAction/SetBadgeBackgroundColorDetails.cs +++ b/src/WebExtensions.Net/Generated/BrowserAction/SetBadgeBackgroundColorDetails.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.BrowserAction { // Type Class /// + [BindAllProperties] public partial class SetBadgeBackgroundColorDetails : BaseObject { - private ColorValue _color; - /// [JsonPropertyName("color")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ColorValue Color - { - get - { - InitializeProperty("color", _color); - return _color; - } - set - { - _color = value; - } - } + public ColorValue Color { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/BrowserAction/SetBadgeTextColorDetails.cs b/src/WebExtensions.Net/Generated/BrowserAction/SetBadgeTextColorDetails.cs index 4478c88..95d1f1c 100644 --- a/src/WebExtensions.Net/Generated/BrowserAction/SetBadgeTextColorDetails.cs +++ b/src/WebExtensions.Net/Generated/BrowserAction/SetBadgeTextColorDetails.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.BrowserAction { // Type Class /// + [BindAllProperties] public partial class SetBadgeTextColorDetails : BaseObject { - private ColorValue _color; - /// [JsonPropertyName("color")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ColorValue Color - { - get - { - InitializeProperty("color", _color); - return _color; - } - set - { - _color = value; - } - } + public ColorValue Color { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/BrowserAction/SetBadgeTextDetails.cs b/src/WebExtensions.Net/Generated/BrowserAction/SetBadgeTextDetails.cs index 5e166ef..a614a85 100644 --- a/src/WebExtensions.Net/Generated/BrowserAction/SetBadgeTextDetails.cs +++ b/src/WebExtensions.Net/Generated/BrowserAction/SetBadgeTextDetails.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.BrowserAction { // Type Class /// + [BindAllProperties] public partial class SetBadgeTextDetails : BaseObject { - private Text _text; - /// Any number of characters can be passed, but only about four can fit in the space. [JsonPropertyName("text")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Text Text - { - get - { - InitializeProperty("text", _text); - return _text; - } - set - { - _text = value; - } - } + public Text Text { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/BrowserAction/SetIconDetails.cs b/src/WebExtensions.Net/Generated/BrowserAction/SetIconDetails.cs index 91ceb1d..f06af32 100644 --- a/src/WebExtensions.Net/Generated/BrowserAction/SetIconDetails.cs +++ b/src/WebExtensions.Net/Generated/BrowserAction/SetIconDetails.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.BrowserAction { // Type Class /// + [BindAllProperties] public partial class SetIconDetails : BaseObject { - private ImageData _imageData; - private Path _path; - /// Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}' [JsonPropertyName("imageData")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ImageData ImageData - { - get - { - InitializeProperty("imageData", _imageData); - return _imageData; - } - set - { - _imageData = value; - } - } + public ImageData ImageData { get; set; } /// Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}' [JsonPropertyName("path")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Path Path - { - get - { - InitializeProperty("path", _path); - return _path; - } - set - { - _path = value; - } - } + public Path Path { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/BrowserAction/SetPopupDetails.cs b/src/WebExtensions.Net/Generated/BrowserAction/SetPopupDetails.cs index fc1ca37..912da80 100644 --- a/src/WebExtensions.Net/Generated/BrowserAction/SetPopupDetails.cs +++ b/src/WebExtensions.Net/Generated/BrowserAction/SetPopupDetails.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.BrowserAction { // Type Class /// + [BindAllProperties] public partial class SetPopupDetails : BaseObject { - private Popup _popup; - /// The html file to show in a popup. If set to the empty string (''), no popup is shown. [JsonPropertyName("popup")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Popup Popup - { - get - { - InitializeProperty("popup", _popup); - return _popup; - } - set - { - _popup = value; - } - } + public Popup Popup { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/BrowserAction/SetTitleDetails.cs b/src/WebExtensions.Net/Generated/BrowserAction/SetTitleDetails.cs index 3ce51d5..6bf1c38 100644 --- a/src/WebExtensions.Net/Generated/BrowserAction/SetTitleDetails.cs +++ b/src/WebExtensions.Net/Generated/BrowserAction/SetTitleDetails.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.BrowserAction { // Type Class /// + [BindAllProperties] public partial class SetTitleDetails : BaseObject { - private Title _title; - /// The string the browser action should display when moused over. [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Title Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public Title Title { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/BrowserSettings/BrowserSettingsApi.cs b/src/WebExtensions.Net/Generated/BrowserSettings/BrowserSettingsApi.cs index 0c13237..1e28d47 100644 --- a/src/WebExtensions.Net/Generated/BrowserSettings/BrowserSettingsApi.cs +++ b/src/WebExtensions.Net/Generated/BrowserSettings/BrowserSettingsApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Types; @@ -8,8 +9,9 @@ namespace WebExtensions.Net.BrowserSettings public partial class BrowserSettingsApi : BaseApi, IBrowserSettingsApi { /// Creates a new instance of . - /// Web Extension JS Runtime - public BrowserSettingsApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "browserSettings") + /// The JS runtime adapter. + /// The base API access path. + public BrowserSettingsApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "browserSettings")) { } diff --git a/src/WebExtensions.Net/Generated/BrowsingData/BrowsingDataApi.cs b/src/WebExtensions.Net/Generated/BrowsingData/BrowsingDataApi.cs index e964229..2b06cba 100644 --- a/src/WebExtensions.Net/Generated/BrowsingData/BrowsingDataApi.cs +++ b/src/WebExtensions.Net/Generated/BrowsingData/BrowsingDataApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Threading.Tasks; namespace WebExtensions.Net.BrowsingData @@ -6,8 +7,9 @@ namespace WebExtensions.Net.BrowsingData public partial class BrowsingDataApi : BaseApi, IBrowsingDataApi { /// Creates a new instance of . - /// Web Extension JS Runtime - public BrowsingDataApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "browsingData") + /// The JS runtime adapter. + /// The base API access path. + public BrowsingDataApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "browsingData")) { } diff --git a/src/WebExtensions.Net/Generated/BrowsingData/DataTypeSet.cs b/src/WebExtensions.Net/Generated/BrowsingData/DataTypeSet.cs index 5a8a277..a8e1798 100644 --- a/src/WebExtensions.Net/Generated/BrowsingData/DataTypeSet.cs +++ b/src/WebExtensions.Net/Generated/BrowsingData/DataTypeSet.cs @@ -1,197 +1,66 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.BrowsingData { // Type Class /// A set of data types. Missing data types are interpreted as false. + [BindAllProperties] public partial class DataTypeSet : BaseObject { - private bool? _cache; - private bool? _cookies; - private bool? _downloads; - private bool? _formData; - private bool? _history; - private bool? _indexedDB; - private bool? _localStorage; - private bool? _passwords; - private bool? _pluginData; - private bool? _serverBoundCertificates; - private bool? _serviceWorkers; - /// The browser's cache. Note: when removing data, this clears the entire cache: it is not limited to the range you specify. [JsonPropertyName("cache")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Cache - { - get - { - InitializeProperty("cache", _cache); - return _cache; - } - set - { - _cache = value; - } - } + public bool? Cache { get; set; } /// The browser's cookies. [JsonPropertyName("cookies")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Cookies - { - get - { - InitializeProperty("cookies", _cookies); - return _cookies; - } - set - { - _cookies = value; - } - } + public bool? Cookies { get; set; } /// The browser's download list. [JsonPropertyName("downloads")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Downloads - { - get - { - InitializeProperty("downloads", _downloads); - return _downloads; - } - set - { - _downloads = value; - } - } + public bool? Downloads { get; set; } /// The browser's stored form data. [JsonPropertyName("formData")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? FormData - { - get - { - InitializeProperty("formData", _formData); - return _formData; - } - set - { - _formData = value; - } - } + public bool? FormData { get; set; } /// The browser's history. [JsonPropertyName("history")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? History - { - get - { - InitializeProperty("history", _history); - return _history; - } - set - { - _history = value; - } - } + public bool? History { get; set; } /// Websites' IndexedDB data. [JsonPropertyName("indexedDB")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? IndexedDB - { - get - { - InitializeProperty("indexedDB", _indexedDB); - return _indexedDB; - } - set - { - _indexedDB = value; - } - } + public bool? IndexedDB { get; set; } /// Websites' local storage data. [JsonPropertyName("localStorage")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? LocalStorage - { - get - { - InitializeProperty("localStorage", _localStorage); - return _localStorage; - } - set - { - _localStorage = value; - } - } + public bool? LocalStorage { get; set; } /// Stored passwords. [JsonPropertyName("passwords")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Passwords - { - get - { - InitializeProperty("passwords", _passwords); - return _passwords; - } - set - { - _passwords = value; - } - } + public bool? Passwords { get; set; } /// Plugins' data. [JsonPropertyName("pluginData")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? PluginData - { - get - { - InitializeProperty("pluginData", _pluginData); - return _pluginData; - } - set - { - _pluginData = value; - } - } + public bool? PluginData { get; set; } /// Server-bound certificates. [JsonPropertyName("serverBoundCertificates")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? ServerBoundCertificates - { - get - { - InitializeProperty("serverBoundCertificates", _serverBoundCertificates); - return _serverBoundCertificates; - } - set - { - _serverBoundCertificates = value; - } - } + public bool? ServerBoundCertificates { get; set; } /// Service Workers. [JsonPropertyName("serviceWorkers")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? ServiceWorkers - { - get - { - InitializeProperty("serviceWorkers", _serviceWorkers); - return _serviceWorkers; - } - set - { - _serviceWorkers = value; - } - } + public bool? ServiceWorkers { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/BrowsingData/OriginTypes.cs b/src/WebExtensions.Net/Generated/BrowsingData/OriginTypes.cs index 48204f5..407f72b 100644 --- a/src/WebExtensions.Net/Generated/BrowsingData/OriginTypes.cs +++ b/src/WebExtensions.Net/Generated/BrowsingData/OriginTypes.cs @@ -1,61 +1,26 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.BrowsingData { // Type Class /// An object whose properties specify which origin types ought to be cleared. If this object isn't specified, it defaults to clearing only "unprotected" origins. Please ensure that you really want to remove application data before adding 'protectedWeb' or 'extensions'. + [BindAllProperties] public partial class OriginTypes : BaseObject { - private bool? _extension; - private bool? _protectedWeb; - private bool? _unprotectedWeb; - /// Extensions and packaged applications a user has installed (be _really_ careful!). [JsonPropertyName("extension")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Extension - { - get - { - InitializeProperty("extension", _extension); - return _extension; - } - set - { - _extension = value; - } - } + public bool? Extension { get; set; } /// Websites that have been installed as hosted applications (be careful!). [JsonPropertyName("protectedWeb")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? ProtectedWeb - { - get - { - InitializeProperty("protectedWeb", _protectedWeb); - return _protectedWeb; - } - set - { - _protectedWeb = value; - } - } + public bool? ProtectedWeb { get; set; } /// Normal websites. [JsonPropertyName("unprotectedWeb")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? UnprotectedWeb - { - get - { - InitializeProperty("unprotectedWeb", _unprotectedWeb); - return _unprotectedWeb; - } - set - { - _unprotectedWeb = value; - } - } + public bool? UnprotectedWeb { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/BrowsingData/RemovalOptions.cs b/src/WebExtensions.Net/Generated/BrowsingData/RemovalOptions.cs index b9636f6..c045ff2 100644 --- a/src/WebExtensions.Net/Generated/BrowsingData/RemovalOptions.cs +++ b/src/WebExtensions.Net/Generated/BrowsingData/RemovalOptions.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; using WebExtensions.Net.ExtensionTypes; @@ -6,75 +7,27 @@ namespace WebExtensions.Net.BrowsingData { // Type Class /// Options that determine exactly what data will be removed. + [BindAllProperties] public partial class RemovalOptions : BaseObject { - private string _cookieStoreId; - private IEnumerable _hostnames; - private OriginTypes _originTypes; - private Date _since; - /// Only remove data associated with this specific cookieStoreId. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// Only remove data associated with these hostnames (only applies to cookies and localStorage). [JsonPropertyName("hostnames")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Hostnames - { - get - { - InitializeProperty("hostnames", _hostnames); - return _hostnames; - } - set - { - _hostnames = value; - } - } + public IEnumerable Hostnames { get; set; } /// An object whose properties specify which origin types ought to be cleared. If this object isn't specified, it defaults to clearing only "unprotected" origins. Please ensure that you really want to remove application data before adding 'protectedWeb' or 'extensions'. [JsonPropertyName("originTypes")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public OriginTypes OriginTypes - { - get - { - InitializeProperty("originTypes", _originTypes); - return _originTypes; - } - set - { - _originTypes = value; - } - } + public OriginTypes OriginTypes { get; set; } /// Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the getTime method of the JavaScript Date object). If absent, defaults to 0 (which would remove all browsing data). [JsonPropertyName("since")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Date Since - { - get - { - InitializeProperty("since", _since); - return _since; - } - set - { - _since = value; - } - } + public Date Since { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/BrowsingData/Result.cs b/src/WebExtensions.Net/Generated/BrowsingData/Result.cs index 26a8f77..f73ede8 100644 --- a/src/WebExtensions.Net/Generated/BrowsingData/Result.cs +++ b/src/WebExtensions.Net/Generated/BrowsingData/Result.cs @@ -1,61 +1,26 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.BrowsingData { // Type Class /// + [BindAllProperties] public partial class Result : BaseObject { - private DataTypeSet _dataRemovalPermitted; - private DataTypeSet _dataToRemove; - private RemovalOptions _options; - /// All of the types will be present in the result, with values of true if they are permitted to be removed (e.g., by enterprise policy) and false if not. [JsonPropertyName("dataRemovalPermitted")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public DataTypeSet DataRemovalPermitted - { - get - { - InitializeProperty("dataRemovalPermitted", _dataRemovalPermitted); - return _dataRemovalPermitted; - } - set - { - _dataRemovalPermitted = value; - } - } + public DataTypeSet DataRemovalPermitted { get; set; } /// All of the types will be present in the result, with values of true if they are both selected to be removed and permitted to be removed, otherwise false. [JsonPropertyName("dataToRemove")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public DataTypeSet DataToRemove - { - get - { - InitializeProperty("dataToRemove", _dataToRemove); - return _dataToRemove; - } - set - { - _dataToRemove = value; - } - } + public DataTypeSet DataToRemove { get; set; } /// [JsonPropertyName("options")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public RemovalOptions Options - { - get - { - InitializeProperty("options", _options); - return _options; - } - set - { - _options = value; - } - } + public RemovalOptions Options { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Clipboard/ClipboardApi.cs b/src/WebExtensions.Net/Generated/Clipboard/ClipboardApi.cs index dc69224..ca8b79c 100644 --- a/src/WebExtensions.Net/Generated/Clipboard/ClipboardApi.cs +++ b/src/WebExtensions.Net/Generated/Clipboard/ClipboardApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Threading.Tasks; namespace WebExtensions.Net.Clipboard @@ -6,8 +7,9 @@ namespace WebExtensions.Net.Clipboard public partial class ClipboardApi : BaseApi, IClipboardApi { /// Creates a new instance of . - /// Web Extension JS Runtime - public ClipboardApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "clipboard") + /// The JS runtime adapter. + /// The base API access path. + public ClipboardApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "clipboard")) { } diff --git a/src/WebExtensions.Net/Generated/Commands/Command.cs b/src/WebExtensions.Net/Generated/Commands/Command.cs index a35cb16..4188f74 100644 --- a/src/WebExtensions.Net/Generated/Commands/Command.cs +++ b/src/WebExtensions.Net/Generated/Commands/Command.cs @@ -1,61 +1,26 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Commands { // Type Class /// + [BindAllProperties] public partial class Command : BaseObject { - private string _description; - private string _name; - private string _shortcut; - /// The Extension Command description [JsonPropertyName("description")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Description - { - get - { - InitializeProperty("description", _description); - return _description; - } - set - { - _description = value; - } - } + public string Description { get; set; } /// The name of the Extension Command [JsonPropertyName("name")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Name - { - get - { - InitializeProperty("name", _name); - return _name; - } - set - { - _name = value; - } - } + public string Name { get; set; } /// The shortcut active for this command, or blank if not active. [JsonPropertyName("shortcut")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Shortcut - { - get - { - InitializeProperty("shortcut", _shortcut); - return _shortcut; - } - set - { - _shortcut = value; - } - } + public string Shortcut { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Commands/CommandsApi.cs b/src/WebExtensions.Net/Generated/Commands/CommandsApi.cs index 838d522..3bfd248 100644 --- a/src/WebExtensions.Net/Generated/Commands/CommandsApi.cs +++ b/src/WebExtensions.Net/Generated/Commands/CommandsApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Threading.Tasks; @@ -9,8 +10,9 @@ public partial class CommandsApi : BaseApi, ICommandsApi private OnCommandEvent _onCommand; /// Creates a new instance of . - /// Web Extension JS Runtime - public CommandsApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "commands") + /// The JS runtime adapter. + /// The base API access path. + public CommandsApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "commands")) { } @@ -22,7 +24,7 @@ public OnCommandEvent OnCommand if (_onCommand is null) { _onCommand = new OnCommandEvent(); - InitializeProperty("onCommand", _onCommand); + _onCommand.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onCommand")); } return _onCommand; } diff --git a/src/WebExtensions.Net/Generated/Commands/Detail.cs b/src/WebExtensions.Net/Generated/Commands/Detail.cs index e2f430f..be62af6 100644 --- a/src/WebExtensions.Net/Generated/Commands/Detail.cs +++ b/src/WebExtensions.Net/Generated/Commands/Detail.cs @@ -1,61 +1,26 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Commands { // Type Class /// The new description for the command. + [BindAllProperties] public partial class Detail : BaseObject { - private string _description; - private string _name; - private string _shortcut; - /// The new description for the command. [JsonPropertyName("description")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Description - { - get - { - InitializeProperty("description", _description); - return _description; - } - set - { - _description = value; - } - } + public string Description { get; set; } /// The name of the command. [JsonPropertyName("name")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Name - { - get - { - InitializeProperty("name", _name); - return _name; - } - set - { - _name = value; - } - } + public string Name { get; set; } /// [JsonPropertyName("shortcut")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Shortcut - { - get - { - InitializeProperty("shortcut", _shortcut); - return _shortcut; - } - set - { - _shortcut = value; - } - } + public string Shortcut { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Commands/OnCommandEvent.cs b/src/WebExtensions.Net/Generated/Commands/OnCommandEvent.cs index 57a118c..fd19541 100644 --- a/src/WebExtensions.Net/Generated/Commands/OnCommandEvent.cs +++ b/src/WebExtensions.Net/Generated/Commands/OnCommandEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Commands { // Type Class /// Fired when a registered command is activated using a keyboard shortcut. + [BindAllProperties] public partial class OnCommandEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/ContentScripts/ContentScriptsApi.cs b/src/WebExtensions.Net/Generated/ContentScripts/ContentScriptsApi.cs index 2c90519..9bb1d1f 100644 --- a/src/WebExtensions.Net/Generated/ContentScripts/ContentScriptsApi.cs +++ b/src/WebExtensions.Net/Generated/ContentScripts/ContentScriptsApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Threading.Tasks; namespace WebExtensions.Net.ContentScripts @@ -6,8 +7,9 @@ namespace WebExtensions.Net.ContentScripts public partial class ContentScriptsApi : BaseApi, IContentScriptsApi { /// Creates a new instance of . - /// Web Extension JS Runtime - public ContentScriptsApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "contentScripts") + /// The JS runtime adapter. + /// The base API access path. + public ContentScriptsApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "contentScripts")) { } diff --git a/src/WebExtensions.Net/Generated/ContentScripts/RegisteredContentScriptOptions.cs b/src/WebExtensions.Net/Generated/ContentScripts/RegisteredContentScriptOptions.cs index 6d42747..5fad720 100644 --- a/src/WebExtensions.Net/Generated/ContentScripts/RegisteredContentScriptOptions.cs +++ b/src/WebExtensions.Net/Generated/ContentScripts/RegisteredContentScriptOptions.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; using WebExtensions.Net.ExtensionTypes; @@ -7,160 +8,52 @@ namespace WebExtensions.Net.ContentScripts { // Type Class /// Details of a content script registered programmatically + [BindAllProperties] public partial class RegisteredContentScriptOptions : BaseObject { - private bool? _allFrames; - private IEnumerable _css; - private IEnumerable _excludeGlobs; - private IEnumerable _excludeMatches; - private IEnumerable _includeGlobs; - private IEnumerable _js; - private bool? _matchAboutBlank; - private IEnumerable _matches; - private RunAt? _runAt; - /// If allFrames is true, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's false and is only injected into the top frame. [JsonPropertyName("allFrames")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? AllFrames - { - get - { - InitializeProperty("allFrames", _allFrames); - return _allFrames; - } - set - { - _allFrames = value; - } - } + public bool? AllFrames { get; set; } /// The list of CSS files to inject [JsonPropertyName("css")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Css - { - get - { - InitializeProperty("css", _css); - return _css; - } - set - { - _css = value; - } - } + public IEnumerable Css { get; set; } /// [JsonPropertyName("excludeGlobs")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable ExcludeGlobs - { - get - { - InitializeProperty("excludeGlobs", _excludeGlobs); - return _excludeGlobs; - } - set - { - _excludeGlobs = value; - } - } + public IEnumerable ExcludeGlobs { get; set; } /// [JsonPropertyName("excludeMatches")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable ExcludeMatches - { - get - { - InitializeProperty("excludeMatches", _excludeMatches); - return _excludeMatches; - } - set - { - _excludeMatches = value; - } - } + public IEnumerable ExcludeMatches { get; set; } /// [JsonPropertyName("includeGlobs")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable IncludeGlobs - { - get - { - InitializeProperty("includeGlobs", _includeGlobs); - return _includeGlobs; - } - set - { - _includeGlobs = value; - } - } + public IEnumerable IncludeGlobs { get; set; } /// The list of JS files to inject [JsonPropertyName("js")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Js - { - get - { - InitializeProperty("js", _js); - return _js; - } - set - { - _js = value; - } - } + public IEnumerable Js { get; set; } /// If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default it is false. [JsonPropertyName("matchAboutBlank")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? MatchAboutBlank - { - get - { - InitializeProperty("matchAboutBlank", _matchAboutBlank); - return _matchAboutBlank; - } - set - { - _matchAboutBlank = value; - } - } + public bool? MatchAboutBlank { get; set; } /// [JsonPropertyName("matches")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Matches - { - get - { - InitializeProperty("matches", _matches); - return _matches; - } - set - { - _matches = value; - } - } + public IEnumerable Matches { get; set; } /// The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle". [JsonPropertyName("runAt")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public RunAt? RunAt - { - get - { - InitializeProperty("runAt", _runAt); - return _runAt; - } - set - { - _runAt = value; - } - } + public RunAt? RunAt { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Cookies/AddListenerCallbackChangeInfo.cs b/src/WebExtensions.Net/Generated/Cookies/AddListenerCallbackChangeInfo.cs index 6cc50a5..d21a77d 100644 --- a/src/WebExtensions.Net/Generated/Cookies/AddListenerCallbackChangeInfo.cs +++ b/src/WebExtensions.Net/Generated/Cookies/AddListenerCallbackChangeInfo.cs @@ -1,59 +1,24 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Cookies { // Type Class /// + [BindAllProperties] public partial class AddListenerCallbackChangeInfo : BaseObject { - private OnChangedCause _cause; - private Cookie _cookie; - private bool _removed; - /// The underlying reason behind the cookie's change. [JsonPropertyName("cause")] - public OnChangedCause Cause - { - get - { - InitializeProperty("cause", _cause); - return _cause; - } - set - { - _cause = value; - } - } + public OnChangedCause Cause { get; set; } /// Information about the cookie that was set or removed. [JsonPropertyName("cookie")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Cookie Cookie - { - get - { - InitializeProperty("cookie", _cookie); - return _cookie; - } - set - { - _cookie = value; - } - } + public Cookie Cookie { get; set; } /// True if a cookie was removed. [JsonPropertyName("removed")] - public bool Removed - { - get - { - InitializeProperty("removed", _removed); - return _removed; - } - set - { - _removed = value; - } - } + public bool Removed { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Cookies/CallbackDetails.cs b/src/WebExtensions.Net/Generated/Cookies/CallbackDetails.cs index e385d8a..58f8786 100644 --- a/src/WebExtensions.Net/Generated/Cookies/CallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/Cookies/CallbackDetails.cs @@ -1,78 +1,31 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Cookies { // Type Class /// Contains details about the cookie that's been removed. If removal failed for any reason, this will be "null", and $(ref:runtime.lastError) will be set. + [BindAllProperties] public partial class CallbackDetails : BaseObject { - private string _firstPartyDomain; - private string _name; - private string _storeId; - private string _url; - /// The first-party domain associated with the cookie that's been removed. [JsonPropertyName("firstPartyDomain")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string FirstPartyDomain - { - get - { - InitializeProperty("firstPartyDomain", _firstPartyDomain); - return _firstPartyDomain; - } - set - { - _firstPartyDomain = value; - } - } + public string FirstPartyDomain { get; set; } /// The name of the cookie that's been removed. [JsonPropertyName("name")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Name - { - get - { - InitializeProperty("name", _name); - return _name; - } - set - { - _name = value; - } - } + public string Name { get; set; } /// The ID of the cookie store from which the cookie was removed. [JsonPropertyName("storeId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StoreId - { - get - { - InitializeProperty("storeId", _storeId); - return _storeId; - } - set - { - _storeId = value; - } - } + public string StoreId { get; set; } /// The URL associated with the cookie that's been removed. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Cookies/Cookie.cs b/src/WebExtensions.Net/Generated/Cookies/Cookie.cs index 4cc5a7a..6cf92de 100644 --- a/src/WebExtensions.Net/Generated/Cookies/Cookie.cs +++ b/src/WebExtensions.Net/Generated/Cookies/Cookie.cs @@ -1,209 +1,66 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Cookies { // Type Class /// Represents information about an HTTP cookie. + [BindAllProperties] public partial class Cookie : BaseObject { - private string _domain; - private double? _expirationDate; - private string _firstPartyDomain; - private bool _hostOnly; - private bool _httpOnly; - private string _name; - private string _path; - private SameSiteStatus _sameSite; - private bool _secure; - private bool _session; - private string _storeId; - private string _value; - /// The domain of the cookie (e.g. "www.google.com", "example.com"). [JsonPropertyName("domain")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Domain - { - get - { - InitializeProperty("domain", _domain); - return _domain; - } - set - { - _domain = value; - } - } + public string Domain { get; set; } /// The expiration date of the cookie as the number of seconds since the UNIX epoch. Not provided for session cookies. [JsonPropertyName("expirationDate")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? ExpirationDate - { - get - { - InitializeProperty("expirationDate", _expirationDate); - return _expirationDate; - } - set - { - _expirationDate = value; - } - } + public double? ExpirationDate { get; set; } /// The first-party domain of the cookie. [JsonPropertyName("firstPartyDomain")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string FirstPartyDomain - { - get - { - InitializeProperty("firstPartyDomain", _firstPartyDomain); - return _firstPartyDomain; - } - set - { - _firstPartyDomain = value; - } - } + public string FirstPartyDomain { get; set; } /// True if the cookie is a host-only cookie (i.e. a request's host must exactly match the domain of the cookie). [JsonPropertyName("hostOnly")] - public bool HostOnly - { - get - { - InitializeProperty("hostOnly", _hostOnly); - return _hostOnly; - } - set - { - _hostOnly = value; - } - } + public bool HostOnly { get; set; } /// True if the cookie is marked as HttpOnly (i.e. the cookie is inaccessible to client-side scripts). [JsonPropertyName("httpOnly")] - public bool HttpOnly - { - get - { - InitializeProperty("httpOnly", _httpOnly); - return _httpOnly; - } - set - { - _httpOnly = value; - } - } + public bool HttpOnly { get; set; } /// The name of the cookie. [JsonPropertyName("name")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Name - { - get - { - InitializeProperty("name", _name); - return _name; - } - set - { - _name = value; - } - } + public string Name { get; set; } /// The path of the cookie. [JsonPropertyName("path")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Path - { - get - { - InitializeProperty("path", _path); - return _path; - } - set - { - _path = value; - } - } + public string Path { get; set; } /// The cookie's same-site status (i.e. whether the cookie is sent with cross-site requests). [JsonPropertyName("sameSite")] - public SameSiteStatus SameSite - { - get - { - InitializeProperty("sameSite", _sameSite); - return _sameSite; - } - set - { - _sameSite = value; - } - } + public SameSiteStatus SameSite { get; set; } /// True if the cookie is marked as Secure (i.e. its scope is limited to secure channels, typically HTTPS). [JsonPropertyName("secure")] - public bool Secure - { - get - { - InitializeProperty("secure", _secure); - return _secure; - } - set - { - _secure = value; - } - } + public bool Secure { get; set; } /// True if the cookie is a session cookie, as opposed to a persistent cookie with an expiration date. [JsonPropertyName("session")] - public bool Session - { - get - { - InitializeProperty("session", _session); - return _session; - } - set - { - _session = value; - } - } + public bool Session { get; set; } /// The ID of the cookie store containing this cookie, as provided in getAllCookieStores(). [JsonPropertyName("storeId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StoreId - { - get - { - InitializeProperty("storeId", _storeId); - return _storeId; - } - set - { - _storeId = value; - } - } + public string StoreId { get; set; } /// The value of the cookie. [JsonPropertyName("value")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Value - { - get - { - InitializeProperty("value", _value); - return _value; - } - set - { - _value = value; - } - } + public string Value { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Cookies/CookieStore.cs b/src/WebExtensions.Net/Generated/Cookies/CookieStore.cs index 5ee6cb1..4d41e5c 100644 --- a/src/WebExtensions.Net/Generated/Cookies/CookieStore.cs +++ b/src/WebExtensions.Net/Generated/Cookies/CookieStore.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,57 +6,21 @@ namespace WebExtensions.Net.Cookies { // Type Class /// Represents a cookie store in the browser. An incognito mode window, for instance, uses a separate cookie store from a non-incognito window. + [BindAllProperties] public partial class CookieStore : BaseObject { - private string _id; - private bool _incognito; - private IEnumerable _tabIds; - /// The unique identifier for the cookie store. [JsonPropertyName("id")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Id - { - get - { - InitializeProperty("id", _id); - return _id; - } - set - { - _id = value; - } - } + public string Id { get; set; } /// Indicates if this is an incognito cookie store [JsonPropertyName("incognito")] - public bool Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool Incognito { get; set; } /// Identifiers of all the browser tabs that share this cookie store. [JsonPropertyName("tabIds")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable TabIds - { - get - { - InitializeProperty("tabIds", _tabIds); - return _tabIds; - } - set - { - _tabIds = value; - } - } + public IEnumerable TabIds { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Cookies/CookiesApi.cs b/src/WebExtensions.Net/Generated/Cookies/CookiesApi.cs index cb616dd..1e5f082 100644 --- a/src/WebExtensions.Net/Generated/Cookies/CookiesApi.cs +++ b/src/WebExtensions.Net/Generated/Cookies/CookiesApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Threading.Tasks; @@ -9,8 +10,9 @@ public partial class CookiesApi : BaseApi, ICookiesApi private OnChangedEvent _onChanged; /// Creates a new instance of . - /// Web Extension JS Runtime - public CookiesApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "cookies") + /// The JS runtime adapter. + /// The base API access path. + public CookiesApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "cookies")) { } @@ -22,7 +24,7 @@ public OnChangedEvent OnChanged if (_onChanged is null) { _onChanged = new OnChangedEvent(); - InitializeProperty("onChanged", _onChanged); + _onChanged.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onChanged")); } return _onChanged; } diff --git a/src/WebExtensions.Net/Generated/Cookies/GetAllDetails.cs b/src/WebExtensions.Net/Generated/Cookies/GetAllDetails.cs index f95013c..3d83bac 100644 --- a/src/WebExtensions.Net/Generated/Cookies/GetAllDetails.cs +++ b/src/WebExtensions.Net/Generated/Cookies/GetAllDetails.cs @@ -1,146 +1,51 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Cookies { // Type Class /// Information to filter the cookies being retrieved. + [BindAllProperties] public partial class GetAllDetails : BaseObject { - private string _domain; - private string _firstPartyDomain; - private string _name; - private string _path; - private bool? _secure; - private bool? _session; - private string _storeId; - private string _url; - /// Restricts the retrieved cookies to those whose domains match or are subdomains of this one. [JsonPropertyName("domain")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Domain - { - get - { - InitializeProperty("domain", _domain); - return _domain; - } - set - { - _domain = value; - } - } + public string Domain { get; set; } /// Restricts the retrieved cookies to those whose first-party domains match this one. This attribute is required if First-Party Isolation is enabled. To not filter by a specific first-party domain, use `null` or `undefined`. [JsonPropertyName("firstPartyDomain")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string FirstPartyDomain - { - get - { - InitializeProperty("firstPartyDomain", _firstPartyDomain); - return _firstPartyDomain; - } - set - { - _firstPartyDomain = value; - } - } + public string FirstPartyDomain { get; set; } /// Filters the cookies by name. [JsonPropertyName("name")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Name - { - get - { - InitializeProperty("name", _name); - return _name; - } - set - { - _name = value; - } - } + public string Name { get; set; } /// Restricts the retrieved cookies to those whose path exactly matches this string. [JsonPropertyName("path")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Path - { - get - { - InitializeProperty("path", _path); - return _path; - } - set - { - _path = value; - } - } + public string Path { get; set; } /// Filters the cookies by their Secure property. [JsonPropertyName("secure")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Secure - { - get - { - InitializeProperty("secure", _secure); - return _secure; - } - set - { - _secure = value; - } - } + public bool? Secure { get; set; } /// Filters out session vs. persistent cookies. [JsonPropertyName("session")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Session - { - get - { - InitializeProperty("session", _session); - return _session; - } - set - { - _session = value; - } - } + public bool? Session { get; set; } /// The cookie store to retrieve cookies from. If omitted, the current execution context's cookie store will be used. [JsonPropertyName("storeId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StoreId - { - get - { - InitializeProperty("storeId", _storeId); - return _storeId; - } - set - { - _storeId = value; - } - } + public string StoreId { get; set; } /// Restricts the retrieved cookies to those that would match the given URL. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Cookies/GetDetails.cs b/src/WebExtensions.Net/Generated/Cookies/GetDetails.cs index 83d844a..9fe37a1 100644 --- a/src/WebExtensions.Net/Generated/Cookies/GetDetails.cs +++ b/src/WebExtensions.Net/Generated/Cookies/GetDetails.cs @@ -1,78 +1,31 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Cookies { // Type Class /// Details to identify the cookie being retrieved. + [BindAllProperties] public partial class GetDetails : BaseObject { - private string _firstPartyDomain; - private string _name; - private string _storeId; - private string _url; - /// The first-party domain which the cookie to retrieve is associated. This attribute is required if First-Party Isolation is enabled. [JsonPropertyName("firstPartyDomain")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string FirstPartyDomain - { - get - { - InitializeProperty("firstPartyDomain", _firstPartyDomain); - return _firstPartyDomain; - } - set - { - _firstPartyDomain = value; - } - } + public string FirstPartyDomain { get; set; } /// The name of the cookie to retrieve. [JsonPropertyName("name")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Name - { - get - { - InitializeProperty("name", _name); - return _name; - } - set - { - _name = value; - } - } + public string Name { get; set; } /// The ID of the cookie store in which to look for the cookie. By default, the current execution context's cookie store will be used. [JsonPropertyName("storeId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StoreId - { - get - { - InitializeProperty("storeId", _storeId); - return _storeId; - } - set - { - _storeId = value; - } - } + public string StoreId { get; set; } /// The URL with which the cookie to retrieve is associated. This argument may be a full URL, in which case any data following the URL path (e.g. the query string) is simply ignored. If host permissions for this URL are not specified in the manifest file, the API call will fail. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Cookies/HasListenerCallbackChangeInfo.cs b/src/WebExtensions.Net/Generated/Cookies/HasListenerCallbackChangeInfo.cs index 3cfa339..1ba4ebe 100644 --- a/src/WebExtensions.Net/Generated/Cookies/HasListenerCallbackChangeInfo.cs +++ b/src/WebExtensions.Net/Generated/Cookies/HasListenerCallbackChangeInfo.cs @@ -1,59 +1,24 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Cookies { // Type Class /// + [BindAllProperties] public partial class HasListenerCallbackChangeInfo : BaseObject { - private OnChangedCause _cause; - private Cookie _cookie; - private bool _removed; - /// The underlying reason behind the cookie's change. [JsonPropertyName("cause")] - public OnChangedCause Cause - { - get - { - InitializeProperty("cause", _cause); - return _cause; - } - set - { - _cause = value; - } - } + public OnChangedCause Cause { get; set; } /// Information about the cookie that was set or removed. [JsonPropertyName("cookie")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Cookie Cookie - { - get - { - InitializeProperty("cookie", _cookie); - return _cookie; - } - set - { - _cookie = value; - } - } + public Cookie Cookie { get; set; } /// True if a cookie was removed. [JsonPropertyName("removed")] - public bool Removed - { - get - { - InitializeProperty("removed", _removed); - return _removed; - } - set - { - _removed = value; - } - } + public bool Removed { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Cookies/OnChangedEvent.cs b/src/WebExtensions.Net/Generated/Cookies/OnChangedEvent.cs index 268c896..262d135 100644 --- a/src/WebExtensions.Net/Generated/Cookies/OnChangedEvent.cs +++ b/src/WebExtensions.Net/Generated/Cookies/OnChangedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Cookies { // Type Class /// Fired when a cookie is set or removed. As a special case, note that updating a cookie's properties is implemented as a two step process: the cookie to be updated is first removed entirely, generating a notification with "cause" of "overwrite" . Afterwards, a new cookie is written with the updated values, generating a second notification with "cause" "explicit". + [BindAllProperties] public partial class OnChangedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Cookies/RemoveDetails.cs b/src/WebExtensions.Net/Generated/Cookies/RemoveDetails.cs index eeb5807..1469116 100644 --- a/src/WebExtensions.Net/Generated/Cookies/RemoveDetails.cs +++ b/src/WebExtensions.Net/Generated/Cookies/RemoveDetails.cs @@ -1,78 +1,31 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Cookies { // Type Class /// Information to identify the cookie to remove. + [BindAllProperties] public partial class RemoveDetails : BaseObject { - private string _firstPartyDomain; - private string _name; - private string _storeId; - private string _url; - /// The first-party domain associated with the cookie. This attribute is required if First-Party Isolation is enabled. [JsonPropertyName("firstPartyDomain")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string FirstPartyDomain - { - get - { - InitializeProperty("firstPartyDomain", _firstPartyDomain); - return _firstPartyDomain; - } - set - { - _firstPartyDomain = value; - } - } + public string FirstPartyDomain { get; set; } /// The name of the cookie to remove. [JsonPropertyName("name")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Name - { - get - { - InitializeProperty("name", _name); - return _name; - } - set - { - _name = value; - } - } + public string Name { get; set; } /// The ID of the cookie store to look in for the cookie. If unspecified, the cookie is looked for by default in the current execution context's cookie store. [JsonPropertyName("storeId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StoreId - { - get - { - InitializeProperty("storeId", _storeId); - return _storeId; - } - set - { - _storeId = value; - } - } + public string StoreId { get; set; } /// The URL associated with the cookie. If host permissions for this URL are not specified in the manifest file, the API call will fail. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Cookies/RemoveListenerCallbackChangeInfo.cs b/src/WebExtensions.Net/Generated/Cookies/RemoveListenerCallbackChangeInfo.cs index 8a1fed8..3e081ab 100644 --- a/src/WebExtensions.Net/Generated/Cookies/RemoveListenerCallbackChangeInfo.cs +++ b/src/WebExtensions.Net/Generated/Cookies/RemoveListenerCallbackChangeInfo.cs @@ -1,59 +1,24 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Cookies { // Type Class /// + [BindAllProperties] public partial class RemoveListenerCallbackChangeInfo : BaseObject { - private OnChangedCause _cause; - private Cookie _cookie; - private bool _removed; - /// The underlying reason behind the cookie's change. [JsonPropertyName("cause")] - public OnChangedCause Cause - { - get - { - InitializeProperty("cause", _cause); - return _cause; - } - set - { - _cause = value; - } - } + public OnChangedCause Cause { get; set; } /// Information about the cookie that was set or removed. [JsonPropertyName("cookie")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Cookie Cookie - { - get - { - InitializeProperty("cookie", _cookie); - return _cookie; - } - set - { - _cookie = value; - } - } + public Cookie Cookie { get; set; } /// True if a cookie was removed. [JsonPropertyName("removed")] - public bool Removed - { - get - { - InitializeProperty("removed", _removed); - return _removed; - } - set - { - _removed = value; - } - } + public bool Removed { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Cookies/SetDetails.cs b/src/WebExtensions.Net/Generated/Cookies/SetDetails.cs index 73e1f8b..5325a57 100644 --- a/src/WebExtensions.Net/Generated/Cookies/SetDetails.cs +++ b/src/WebExtensions.Net/Generated/Cookies/SetDetails.cs @@ -1,197 +1,66 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Cookies { // Type Class /// Details about the cookie being set. + [BindAllProperties] public partial class SetDetails : BaseObject { - private string _domain; - private double? _expirationDate; - private string _firstPartyDomain; - private bool? _httpOnly; - private string _name; - private string _path; - private SameSiteStatus? _sameSite; - private bool? _secure; - private string _storeId; - private string _url; - private string _value; - /// The domain of the cookie. If omitted, the cookie becomes a host-only cookie. [JsonPropertyName("domain")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Domain - { - get - { - InitializeProperty("domain", _domain); - return _domain; - } - set - { - _domain = value; - } - } + public string Domain { get; set; } /// The expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, the cookie becomes a session cookie. [JsonPropertyName("expirationDate")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? ExpirationDate - { - get - { - InitializeProperty("expirationDate", _expirationDate); - return _expirationDate; - } - set - { - _expirationDate = value; - } - } + public double? ExpirationDate { get; set; } /// The first-party domain of the cookie. This attribute is required if First-Party Isolation is enabled. [JsonPropertyName("firstPartyDomain")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string FirstPartyDomain - { - get - { - InitializeProperty("firstPartyDomain", _firstPartyDomain); - return _firstPartyDomain; - } - set - { - _firstPartyDomain = value; - } - } + public string FirstPartyDomain { get; set; } /// Whether the cookie should be marked as HttpOnly. Defaults to false. [JsonPropertyName("httpOnly")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? HttpOnly - { - get - { - InitializeProperty("httpOnly", _httpOnly); - return _httpOnly; - } - set - { - _httpOnly = value; - } - } + public bool? HttpOnly { get; set; } /// The name of the cookie. Empty by default if omitted. [JsonPropertyName("name")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Name - { - get - { - InitializeProperty("name", _name); - return _name; - } - set - { - _name = value; - } - } + public string Name { get; set; } /// The path of the cookie. Defaults to the path portion of the url parameter. [JsonPropertyName("path")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Path - { - get - { - InitializeProperty("path", _path); - return _path; - } - set - { - _path = value; - } - } + public string Path { get; set; } /// The cookie's same-site status. [JsonPropertyName("sameSite")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public SameSiteStatus? SameSite - { - get - { - InitializeProperty("sameSite", _sameSite); - return _sameSite; - } - set - { - _sameSite = value; - } - } + public SameSiteStatus? SameSite { get; set; } /// Whether the cookie should be marked as Secure. Defaults to false. [JsonPropertyName("secure")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Secure - { - get - { - InitializeProperty("secure", _secure); - return _secure; - } - set - { - _secure = value; - } - } + public bool? Secure { get; set; } /// The ID of the cookie store in which to set the cookie. By default, the cookie is set in the current execution context's cookie store. [JsonPropertyName("storeId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StoreId - { - get - { - InitializeProperty("storeId", _storeId); - return _storeId; - } - set - { - _storeId = value; - } - } + public string StoreId { get; set; } /// The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie. If host permissions for this URL are not specified in the manifest file, the API call will fail. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// The value of the cookie. Empty by default if omitted. [JsonPropertyName("value")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Value - { - get - { - InitializeProperty("value", _value); - return _value; - } - set - { - _value = value; - } - } + public string Value { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Devtools/DevtoolsApi.cs b/src/WebExtensions.Net/Generated/Devtools/DevtoolsApi.cs index b9f6b93..5102f1b 100644 --- a/src/WebExtensions.Net/Generated/Devtools/DevtoolsApi.cs +++ b/src/WebExtensions.Net/Generated/Devtools/DevtoolsApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using WebExtensions.Net.Devtools.InspectedWindow; using WebExtensions.Net.Devtools.Network; using WebExtensions.Net.Devtools.Panels; @@ -12,8 +13,9 @@ public partial class DevtoolsApi : BaseApi, IDevtoolsApi private IPanelsApi _panels; /// Creates a new instance of . - /// Web Extension JS Runtime - public DevtoolsApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "devtools") + /// The JS runtime adapter. + /// The base API access path. + public DevtoolsApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "devtools")) { } @@ -24,7 +26,7 @@ public IInspectedWindowApi InspectedWindow { if (_inspectedWindow is null) { - _inspectedWindow = new InspectedWindowApi(webExtensionsJSRuntime); + _inspectedWindow = new InspectedWindowApi(JsRuntime, AccessPath); } return _inspectedWindow; } @@ -37,7 +39,7 @@ public INetworkApi Network { if (_network is null) { - _network = new NetworkApi(webExtensionsJSRuntime); + _network = new NetworkApi(JsRuntime, AccessPath); } return _network; } @@ -50,7 +52,7 @@ public IPanelsApi Panels { if (_panels is null) { - _panels = new PanelsApi(webExtensionsJSRuntime); + _panels = new PanelsApi(JsRuntime, AccessPath); } return _panels; } diff --git a/src/WebExtensions.Net/Generated/Devtools/InspectedWindow/EvalResult.cs b/src/WebExtensions.Net/Generated/Devtools/InspectedWindow/EvalResult.cs index 59946b3..0aad6cc 100644 --- a/src/WebExtensions.Net/Generated/Devtools/InspectedWindow/EvalResult.cs +++ b/src/WebExtensions.Net/Generated/Devtools/InspectedWindow/EvalResult.cs @@ -11,8 +11,6 @@ public partial class EvalResult : BaseCombinedCallbackParameterObject { private static readonly Type[] propertyTypes = new[] { typeof(JsonElement), typeof(ExceptionInfo) }; private static readonly string[] propertyNames = new[] { "Result", "ExceptionInfo" }; - private JsonElement _result; - private ExceptionInfo _exceptionInfo; /// Creates a new instance of . public EvalResult() : base(propertyTypes, propertyNames) @@ -22,33 +20,11 @@ public EvalResult() : base(propertyTypes, propertyNames) /// The result of evaluation. [JsonPropertyName("result")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public JsonElement Result - { - get - { - InitializeProperty("result", _result); - return _result; - } - set - { - _result = value; - } - } + public JsonElement Result { get; set; } /// An object providing details if an exception occurred while evaluating the expression. [JsonPropertyName("exceptionInfo")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ExceptionInfo ExceptionInfo - { - get - { - InitializeProperty("exceptionInfo", _exceptionInfo); - return _exceptionInfo; - } - set - { - _exceptionInfo = value; - } - } + public ExceptionInfo ExceptionInfo { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Devtools/InspectedWindow/ExceptionInfo.cs b/src/WebExtensions.Net/Generated/Devtools/InspectedWindow/ExceptionInfo.cs index 6400675..22c7a5a 100644 --- a/src/WebExtensions.Net/Generated/Devtools/InspectedWindow/ExceptionInfo.cs +++ b/src/WebExtensions.Net/Generated/Devtools/InspectedWindow/ExceptionInfo.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,107 +6,35 @@ namespace WebExtensions.Net.Devtools.InspectedWindow { // Type Class /// An object providing details if an exception occurred while evaluating the expression. + [BindAllProperties] public partial class ExceptionInfo : BaseObject { - private string _code; - private string _description; - private IEnumerable _details; - private bool _isError; - private bool _isException; - private string _value; - /// Set if the error occurred on the DevTools side before the expression is evaluated. [JsonPropertyName("code")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Code - { - get - { - InitializeProperty("code", _code); - return _code; - } - set - { - _code = value; - } - } + public string Code { get; set; } /// Set if the error occurred on the DevTools side before the expression is evaluated. [JsonPropertyName("description")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Description - { - get - { - InitializeProperty("description", _description); - return _description; - } - set - { - _description = value; - } - } + public string Description { get; set; } /// Set if the error occurred on the DevTools side before the expression is evaluated, contains the array of the values that may be substituted into the description string to provide more information about the cause of the error. [JsonPropertyName("details")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Details - { - get - { - InitializeProperty("details", _details); - return _details; - } - set - { - _details = value; - } - } + public IEnumerable Details { get; set; } /// Set if the error occurred on the DevTools side before the expression is evaluated. [JsonPropertyName("isError")] - public bool IsError - { - get - { - InitializeProperty("isError", _isError); - return _isError; - } - set - { - _isError = value; - } - } + public bool IsError { get; set; } /// Set if the evaluated code produces an unhandled exception. [JsonPropertyName("isException")] - public bool IsException - { - get - { - InitializeProperty("isException", _isException); - return _isException; - } - set - { - _isException = value; - } - } + public bool IsException { get; set; } /// Set if the evaluated code produces an unhandled exception. [JsonPropertyName("value")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Value - { - get - { - InitializeProperty("value", _value); - return _value; - } - set - { - _value = value; - } - } + public string Value { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Devtools/InspectedWindow/InspectedWindowApi.cs b/src/WebExtensions.Net/Generated/Devtools/InspectedWindow/InspectedWindowApi.cs index c99e291..b724b00 100644 --- a/src/WebExtensions.Net/Generated/Devtools/InspectedWindow/InspectedWindowApi.cs +++ b/src/WebExtensions.Net/Generated/Devtools/InspectedWindow/InspectedWindowApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Threading.Tasks; namespace WebExtensions.Net.Devtools.InspectedWindow @@ -6,8 +7,9 @@ namespace WebExtensions.Net.Devtools.InspectedWindow public partial class InspectedWindowApi : BaseApi, IInspectedWindowApi { /// Creates a new instance of . - /// Web Extension JS Runtime - public InspectedWindowApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "devtools.inspectedWindow") + /// The JS runtime adapter. + /// The base API access path. + public InspectedWindowApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "inspectedWindow")) { } diff --git a/src/WebExtensions.Net/Generated/Devtools/InspectedWindow/ReloadOptions.cs b/src/WebExtensions.Net/Generated/Devtools/InspectedWindow/ReloadOptions.cs index 180708f..0012967 100644 --- a/src/WebExtensions.Net/Generated/Devtools/InspectedWindow/ReloadOptions.cs +++ b/src/WebExtensions.Net/Generated/Devtools/InspectedWindow/ReloadOptions.cs @@ -1,61 +1,26 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Devtools.InspectedWindow { // Type Class /// + [BindAllProperties] public partial class ReloadOptions : BaseObject { - private bool? _ignoreCache; - private string _injectedScript; - private string _userAgent; - /// When true, the loader will bypass the cache for all inspected page resources loaded before the load event is fired. The effect is similar to pressing Ctrl+Shift+R in the inspected window or within the Developer Tools window. [JsonPropertyName("ignoreCache")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? IgnoreCache - { - get - { - InitializeProperty("ignoreCache", _ignoreCache); - return _ignoreCache; - } - set - { - _ignoreCache = value; - } - } + public bool? IgnoreCache { get; set; } /// If specified, the script will be injected into every frame of the inspected page immediately upon load, before any of the frame's scripts. The script will not be injected after subsequent reloads-for example, if the user presses Ctrl+R. [JsonPropertyName("injectedScript")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string InjectedScript - { - get - { - InitializeProperty("injectedScript", _injectedScript); - return _injectedScript; - } - set - { - _injectedScript = value; - } - } + public string InjectedScript { get; set; } /// If specified, the string will override the value of the User-Agent HTTP header that's sent while loading the resources of the inspected page. The string will also override the value of the navigator.userAgent property that's returned to any scripts that are running within the inspected page. [JsonPropertyName("userAgent")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string UserAgent - { - get - { - InitializeProperty("userAgent", _userAgent); - return _userAgent; - } - set - { - _userAgent = value; - } - } + public string UserAgent { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Devtools/Network/NetworkApi.cs b/src/WebExtensions.Net/Generated/Devtools/Network/NetworkApi.cs index 836a142..d4f2342 100644 --- a/src/WebExtensions.Net/Generated/Devtools/Network/NetworkApi.cs +++ b/src/WebExtensions.Net/Generated/Devtools/Network/NetworkApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Text.Json; using System.Threading.Tasks; @@ -10,8 +11,9 @@ public partial class NetworkApi : BaseApi, INetworkApi private OnRequestFinishedEvent _onRequestFinished; /// Creates a new instance of . - /// Web Extension JS Runtime - public NetworkApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "devtools.network") + /// The JS runtime adapter. + /// The base API access path. + public NetworkApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "network")) { } @@ -23,7 +25,7 @@ public OnNavigatedEvent OnNavigated if (_onNavigated is null) { _onNavigated = new OnNavigatedEvent(); - InitializeProperty("onNavigated", _onNavigated); + _onNavigated.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onNavigated")); } return _onNavigated; } @@ -37,7 +39,7 @@ public OnRequestFinishedEvent OnRequestFinished if (_onRequestFinished is null) { _onRequestFinished = new OnRequestFinishedEvent(); - InitializeProperty("onRequestFinished", _onRequestFinished); + _onRequestFinished.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onRequestFinished")); } return _onRequestFinished; } diff --git a/src/WebExtensions.Net/Generated/Devtools/Network/OnNavigatedEvent.cs b/src/WebExtensions.Net/Generated/Devtools/Network/OnNavigatedEvent.cs index d1a3339..b278465 100644 --- a/src/WebExtensions.Net/Generated/Devtools/Network/OnNavigatedEvent.cs +++ b/src/WebExtensions.Net/Generated/Devtools/Network/OnNavigatedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Devtools.Network { // Type Class /// Fired when the inspected window navigates to a new page. + [BindAllProperties] public partial class OnNavigatedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Devtools/Network/OnRequestFinishedEvent.cs b/src/WebExtensions.Net/Generated/Devtools/Network/OnRequestFinishedEvent.cs index 92de940..b7040a6 100644 --- a/src/WebExtensions.Net/Generated/Devtools/Network/OnRequestFinishedEvent.cs +++ b/src/WebExtensions.Net/Generated/Devtools/Network/OnRequestFinishedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Devtools.Network { // Type Class /// Fired when a network request is finished and all request data are available. + [BindAllProperties] public partial class OnRequestFinishedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Devtools/Network/Request.cs b/src/WebExtensions.Net/Generated/Devtools/Network/Request.cs index 01b79bf..4392a8d 100644 --- a/src/WebExtensions.Net/Generated/Devtools/Network/Request.cs +++ b/src/WebExtensions.Net/Generated/Devtools/Network/Request.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; @@ -5,6 +6,7 @@ namespace WebExtensions.Net.Devtools.Network { // Type Class /// Represents a network request for a document resource (script, image and so on). See HAR Specification for reference. + [BindAllProperties] public partial class Request : BaseObject { /// Returns content of the response body. diff --git a/src/WebExtensions.Net/Generated/Devtools/Panels/ElementsPanel.cs b/src/WebExtensions.Net/Generated/Devtools/Panels/ElementsPanel.cs index 72310ad..68954b1 100644 --- a/src/WebExtensions.Net/Generated/Devtools/Panels/ElementsPanel.cs +++ b/src/WebExtensions.Net/Generated/Devtools/Panels/ElementsPanel.cs @@ -1,9 +1,11 @@ +using JsBind.Net; using System.Threading.Tasks; namespace WebExtensions.Net.Devtools.Panels { // Type Class /// Represents the Elements panel. + [BindAllProperties] public partial class ElementsPanel : BaseObject { /// Creates a pane within panel's sidebar. diff --git a/src/WebExtensions.Net/Generated/Devtools/Panels/ExtensionPanel.cs b/src/WebExtensions.Net/Generated/Devtools/Panels/ExtensionPanel.cs index f3ea621..b9877d5 100644 --- a/src/WebExtensions.Net/Generated/Devtools/Panels/ExtensionPanel.cs +++ b/src/WebExtensions.Net/Generated/Devtools/Panels/ExtensionPanel.cs @@ -1,7 +1,10 @@ +using JsBind.Net; + namespace WebExtensions.Net.Devtools.Panels { // Type Class /// Represents a panel created by extension. + [BindAllProperties] public partial class ExtensionPanel : BaseObject { } diff --git a/src/WebExtensions.Net/Generated/Devtools/Panels/ExtensionSidebarPane.cs b/src/WebExtensions.Net/Generated/Devtools/Panels/ExtensionSidebarPane.cs index fa3f6ac..8869e18 100644 --- a/src/WebExtensions.Net/Generated/Devtools/Panels/ExtensionSidebarPane.cs +++ b/src/WebExtensions.Net/Generated/Devtools/Panels/ExtensionSidebarPane.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Threading.Tasks; using WebExtensions.Net.Manifest; @@ -5,6 +6,7 @@ namespace WebExtensions.Net.Devtools.Panels { // Type Class /// A sidebar created by the extension. + [BindAllProperties] public partial class ExtensionSidebarPane : BaseObject { /// Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane. diff --git a/src/WebExtensions.Net/Generated/Devtools/Panels/OnThemeChangedEvent.cs b/src/WebExtensions.Net/Generated/Devtools/Panels/OnThemeChangedEvent.cs index 755f04a..0e59f11 100644 --- a/src/WebExtensions.Net/Generated/Devtools/Panels/OnThemeChangedEvent.cs +++ b/src/WebExtensions.Net/Generated/Devtools/Panels/OnThemeChangedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Devtools.Panels { // Type Class /// Fired when the devtools theme changes. + [BindAllProperties] public partial class OnThemeChangedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Devtools/Panels/PanelsApi.cs b/src/WebExtensions.Net/Generated/Devtools/Panels/PanelsApi.cs index 21d47bb..1849ed6 100644 --- a/src/WebExtensions.Net/Generated/Devtools/Panels/PanelsApi.cs +++ b/src/WebExtensions.Net/Generated/Devtools/Panels/PanelsApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Threading.Tasks; using WebExtensions.Net.Manifest; @@ -9,8 +10,9 @@ public partial class PanelsApi : BaseApi, IPanelsApi private OnThemeChangedEvent _onThemeChanged; /// Creates a new instance of . - /// Web Extension JS Runtime - public PanelsApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "devtools.panels") + /// The JS runtime adapter. + /// The base API access path. + public PanelsApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "panels")) { } @@ -22,7 +24,7 @@ public OnThemeChangedEvent OnThemeChanged if (_onThemeChanged is null) { _onThemeChanged = new OnThemeChangedEvent(); - InitializeProperty("onThemeChanged", _onThemeChanged); + _onThemeChanged.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onThemeChanged")); } return _onThemeChanged; } diff --git a/src/WebExtensions.Net/Generated/Devtools/Panels/SourcesPanel.cs b/src/WebExtensions.Net/Generated/Devtools/Panels/SourcesPanel.cs index ce8806e..1528145 100644 --- a/src/WebExtensions.Net/Generated/Devtools/Panels/SourcesPanel.cs +++ b/src/WebExtensions.Net/Generated/Devtools/Panels/SourcesPanel.cs @@ -1,7 +1,10 @@ +using JsBind.Net; + namespace WebExtensions.Net.Devtools.Panels { // Type Class /// Represents the Sources panel. + [BindAllProperties] public partial class SourcesPanel : BaseObject { } diff --git a/src/WebExtensions.Net/Generated/Downloads/AddListenerCallbackDownloadDelta.cs b/src/WebExtensions.Net/Generated/Downloads/AddListenerCallbackDownloadDelta.cs index b326984..bce7866 100644 --- a/src/WebExtensions.Net/Generated/Downloads/AddListenerCallbackDownloadDelta.cs +++ b/src/WebExtensions.Net/Generated/Downloads/AddListenerCallbackDownloadDelta.cs @@ -1,247 +1,80 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Downloads { // Type Class /// + [BindAllProperties] public partial class AddListenerCallbackDownloadDelta : BaseObject { - private BooleanDelta _canResume; - private StringDelta _danger; - private StringDelta _endTime; - private StringDelta _error; - private BooleanDelta _exists; - private StringDelta _filename; - private DoubleDelta _fileSize; - private int _id; - private StringDelta _mime; - private BooleanDelta _paused; - private StringDelta _startTime; - private StringDelta _state; - private DoubleDelta _totalBytes; - private StringDelta _url; - /// [JsonPropertyName("canResume")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public BooleanDelta CanResume - { - get - { - InitializeProperty("canResume", _canResume); - return _canResume; - } - set - { - _canResume = value; - } - } + public BooleanDelta CanResume { get; set; } /// Describes a change in a DownloadItem's danger. [JsonPropertyName("danger")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta Danger - { - get - { - InitializeProperty("danger", _danger); - return _danger; - } - set - { - _danger = value; - } - } + public StringDelta Danger { get; set; } /// Describes a change in a DownloadItem's endTime. [JsonPropertyName("endTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta EndTime - { - get - { - InitializeProperty("endTime", _endTime); - return _endTime; - } - set - { - _endTime = value; - } - } + public StringDelta EndTime { get; set; } /// Describes a change in a DownloadItem's error. [JsonPropertyName("error")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta Error - { - get - { - InitializeProperty("error", _error); - return _error; - } - set - { - _error = value; - } - } + public StringDelta Error { get; set; } /// [JsonPropertyName("exists")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public BooleanDelta Exists - { - get - { - InitializeProperty("exists", _exists); - return _exists; - } - set - { - _exists = value; - } - } + public BooleanDelta Exists { get; set; } /// Describes a change in a DownloadItem's filename. [JsonPropertyName("filename")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta Filename - { - get - { - InitializeProperty("filename", _filename); - return _filename; - } - set - { - _filename = value; - } - } + public StringDelta Filename { get; set; } /// Describes a change in a DownloadItem's fileSize. [JsonPropertyName("fileSize")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public DoubleDelta FileSize - { - get - { - InitializeProperty("fileSize", _fileSize); - return _fileSize; - } - set - { - _fileSize = value; - } - } + public DoubleDelta FileSize { get; set; } /// The id of the DownloadItem that changed. [JsonPropertyName("id")] - public int Id - { - get - { - InitializeProperty("id", _id); - return _id; - } - set - { - _id = value; - } - } + public int Id { get; set; } /// Describes a change in a DownloadItem's mime. [JsonPropertyName("mime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta Mime - { - get - { - InitializeProperty("mime", _mime); - return _mime; - } - set - { - _mime = value; - } - } + public StringDelta Mime { get; set; } /// Describes a change in a DownloadItem's paused. [JsonPropertyName("paused")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public BooleanDelta Paused - { - get - { - InitializeProperty("paused", _paused); - return _paused; - } - set - { - _paused = value; - } - } + public BooleanDelta Paused { get; set; } /// Describes a change in a DownloadItem's startTime. [JsonPropertyName("startTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta StartTime - { - get - { - InitializeProperty("startTime", _startTime); - return _startTime; - } - set - { - _startTime = value; - } - } + public StringDelta StartTime { get; set; } /// Describes a change in a DownloadItem's state. [JsonPropertyName("state")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta State - { - get - { - InitializeProperty("state", _state); - return _state; - } - set - { - _state = value; - } - } + public StringDelta State { get; set; } /// Describes a change in a DownloadItem's totalBytes. [JsonPropertyName("totalBytes")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public DoubleDelta TotalBytes - { - get - { - InitializeProperty("totalBytes", _totalBytes); - return _totalBytes; - } - set - { - _totalBytes = value; - } - } + public DoubleDelta TotalBytes { get; set; } /// Describes a change in a DownloadItem's url. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public StringDelta Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Downloads/BooleanDelta.cs b/src/WebExtensions.Net/Generated/Downloads/BooleanDelta.cs index a7864a7..a8959ff 100644 --- a/src/WebExtensions.Net/Generated/Downloads/BooleanDelta.cs +++ b/src/WebExtensions.Net/Generated/Downloads/BooleanDelta.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Downloads { // Type Class /// + [BindAllProperties] public partial class BooleanDelta : BaseObject { - private bool? _current; - private bool? _previous; - /// [JsonPropertyName("current")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Current - { - get - { - InitializeProperty("current", _current); - return _current; - } - set - { - _current = value; - } - } + public bool? Current { get; set; } /// [JsonPropertyName("previous")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Previous - { - get - { - InitializeProperty("previous", _previous); - return _previous; - } - set - { - _previous = value; - } - } + public bool? Previous { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Downloads/DoubleDelta.cs b/src/WebExtensions.Net/Generated/Downloads/DoubleDelta.cs index 488b94c..00590d3 100644 --- a/src/WebExtensions.Net/Generated/Downloads/DoubleDelta.cs +++ b/src/WebExtensions.Net/Generated/Downloads/DoubleDelta.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Downloads { // Type Class /// + [BindAllProperties] public partial class DoubleDelta : BaseObject { - private double? _current; - private double? _previous; - /// [JsonPropertyName("current")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? Current - { - get - { - InitializeProperty("current", _current); - return _current; - } - set - { - _current = value; - } - } + public double? Current { get; set; } /// [JsonPropertyName("previous")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? Previous - { - get - { - InitializeProperty("previous", _previous); - return _previous; - } - set - { - _previous = value; - } - } + public double? Previous { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Downloads/DownloadItem.cs b/src/WebExtensions.Net/Generated/Downloads/DownloadItem.cs index 200cba7..1da2bd4 100644 --- a/src/WebExtensions.Net/Generated/Downloads/DownloadItem.cs +++ b/src/WebExtensions.Net/Generated/Downloads/DownloadItem.cs @@ -1,340 +1,101 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Downloads { // Type Class /// + [BindAllProperties] public partial class DownloadItem : BaseObject { - private string _byExtensionId; - private string _byExtensionName; - private double _bytesReceived; - private bool _canResume; - private DangerType _danger; - private string _endTime; - private InterruptReason? _error; - private string _estimatedEndTime; - private bool _exists; - private string _filename; - private double _fileSize; - private int _id; - private bool _incognito; - private string _mime; - private bool _paused; - private string _referrer; - private string _startTime; - private State _state; - private double _totalBytes; - private string _url; - /// [JsonPropertyName("byExtensionId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string ByExtensionId - { - get - { - InitializeProperty("byExtensionId", _byExtensionId); - return _byExtensionId; - } - set - { - _byExtensionId = value; - } - } + public string ByExtensionId { get; set; } /// [JsonPropertyName("byExtensionName")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string ByExtensionName - { - get - { - InitializeProperty("byExtensionName", _byExtensionName); - return _byExtensionName; - } - set - { - _byExtensionName = value; - } - } + public string ByExtensionName { get; set; } /// Number of bytes received so far from the host, without considering file compression. [JsonPropertyName("bytesReceived")] - public double BytesReceived - { - get - { - InitializeProperty("bytesReceived", _bytesReceived); - return _bytesReceived; - } - set - { - _bytesReceived = value; - } - } + public double BytesReceived { get; set; } /// [JsonPropertyName("canResume")] - public bool CanResume - { - get - { - InitializeProperty("canResume", _canResume); - return _canResume; - } - set - { - _canResume = value; - } - } + public bool CanResume { get; set; } /// Indication of whether this download is thought to be safe or known to be suspicious. [JsonPropertyName("danger")] - public DangerType Danger - { - get - { - InitializeProperty("danger", _danger); - return _danger; - } - set - { - _danger = value; - } - } + public DangerType Danger { get; set; } /// Number of milliseconds between the unix epoch and when this download ended. [JsonPropertyName("endTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string EndTime - { - get - { - InitializeProperty("endTime", _endTime); - return _endTime; - } - set - { - _endTime = value; - } - } + public string EndTime { get; set; } /// Number indicating why a download was interrupted. [JsonPropertyName("error")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public InterruptReason? Error - { - get - { - InitializeProperty("error", _error); - return _error; - } - set - { - _error = value; - } - } + public InterruptReason? Error { get; set; } /// [JsonPropertyName("estimatedEndTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string EstimatedEndTime - { - get - { - InitializeProperty("estimatedEndTime", _estimatedEndTime); - return _estimatedEndTime; - } - set - { - _estimatedEndTime = value; - } - } + public string EstimatedEndTime { get; set; } /// [JsonPropertyName("exists")] - public bool Exists - { - get - { - InitializeProperty("exists", _exists); - return _exists; - } - set - { - _exists = value; - } - } + public bool Exists { get; set; } /// Absolute local path. [JsonPropertyName("filename")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Filename - { - get - { - InitializeProperty("filename", _filename); - return _filename; - } - set - { - _filename = value; - } - } + public string Filename { get; set; } /// Number of bytes in the whole file post-decompression, or -1 if unknown. [JsonPropertyName("fileSize")] - public double FileSize - { - get - { - InitializeProperty("fileSize", _fileSize); - return _fileSize; - } - set - { - _fileSize = value; - } - } + public double FileSize { get; set; } /// An identifier that is persistent across browser sessions. [JsonPropertyName("id")] - public int Id - { - get - { - InitializeProperty("id", _id); - return _id; - } - set - { - _id = value; - } - } + public int Id { get; set; } /// False if this download is recorded in the history, true if it is not recorded. [JsonPropertyName("incognito")] - public bool Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool Incognito { get; set; } /// The file's MIME type. [JsonPropertyName("mime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Mime - { - get - { - InitializeProperty("mime", _mime); - return _mime; - } - set - { - _mime = value; - } - } + public string Mime { get; set; } /// True if the download has stopped reading data from the host, but kept the connection open. [JsonPropertyName("paused")] - public bool Paused - { - get - { - InitializeProperty("paused", _paused); - return _paused; - } - set - { - _paused = value; - } - } + public bool Paused { get; set; } /// [JsonPropertyName("referrer")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Referrer - { - get - { - InitializeProperty("referrer", _referrer); - return _referrer; - } - set - { - _referrer = value; - } - } + public string Referrer { get; set; } /// Number of milliseconds between the unix epoch and when this download began. [JsonPropertyName("startTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StartTime - { - get - { - InitializeProperty("startTime", _startTime); - return _startTime; - } - set - { - _startTime = value; - } - } + public string StartTime { get; set; } /// Indicates whether the download is progressing, interrupted, or complete. [JsonPropertyName("state")] - public State State - { - get - { - InitializeProperty("state", _state); - return _state; - } - set - { - _state = value; - } - } + public State State { get; set; } /// Number of bytes in the whole file, without considering file compression, or -1 if unknown. [JsonPropertyName("totalBytes")] - public double TotalBytes - { - get - { - InitializeProperty("totalBytes", _totalBytes); - return _totalBytes; - } - set - { - _totalBytes = value; - } - } + public double TotalBytes { get; set; } /// Absolute URL. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Downloads/DownloadOptions.cs b/src/WebExtensions.Net/Generated/Downloads/DownloadOptions.cs index 0879738..03bf151 100644 --- a/src/WebExtensions.Net/Generated/Downloads/DownloadOptions.cs +++ b/src/WebExtensions.Net/Generated/Downloads/DownloadOptions.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,160 +6,52 @@ namespace WebExtensions.Net.Downloads { // Type Class /// What to download and how. + [BindAllProperties] public partial class DownloadOptions : BaseObject { - private bool? _allowHttpErrors; - private string _body; - private FilenameConflictAction? _conflictAction; - private string _filename; - private IEnumerable _headers; - private bool? _incognito; - private string _method; - private bool? _saveAs; - private string _url; - /// When this flag is set to true, then the browser will allow downloads to proceed after encountering HTTP errors such as 404 Not Found. [JsonPropertyName("allowHttpErrors")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? AllowHttpErrors - { - get - { - InitializeProperty("allowHttpErrors", _allowHttpErrors); - return _allowHttpErrors; - } - set - { - _allowHttpErrors = value; - } - } + public bool? AllowHttpErrors { get; set; } /// Post body. [JsonPropertyName("body")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Body - { - get - { - InitializeProperty("body", _body); - return _body; - } - set - { - _body = value; - } - } + public string Body { get; set; } /// [JsonPropertyName("conflictAction")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public FilenameConflictAction? ConflictAction - { - get - { - InitializeProperty("conflictAction", _conflictAction); - return _conflictAction; - } - set - { - _conflictAction = value; - } - } + public FilenameConflictAction? ConflictAction { get; set; } /// A file path relative to the Downloads directory to contain the downloaded file. [JsonPropertyName("filename")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Filename - { - get - { - InitializeProperty("filename", _filename); - return _filename; - } - set - { - _filename = value; - } - } + public string Filename { get; set; } /// Extra HTTP headers to send with the request if the URL uses the HTTP[s] protocol. Each header is represented as a dictionary containing the keys name and either value or binaryValue, restricted to those allowed by XMLHttpRequest. [JsonPropertyName("headers")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Headers - { - get - { - InitializeProperty("headers", _headers); - return _headers; - } - set - { - _headers = value; - } - } + public IEnumerable Headers { get; set; } /// Whether to associate the download with a private browsing session. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// The HTTP method to use if the URL uses the HTTP[S] protocol. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// Use a file-chooser to allow the user to select a filename. If the option is not specified, the file chooser will be shown only if the Firefox "Always ask you where to save files" option is enabled (i.e. the pref browser.download.useDownloadDir is set to false). [JsonPropertyName("saveAs")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? SaveAs - { - get - { - InitializeProperty("saveAs", _saveAs); - return _saveAs; - } - set - { - _saveAs = value; - } - } + public bool? SaveAs { get; set; } /// The URL to download. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Downloads/DownloadQuery.cs b/src/WebExtensions.Net/Generated/Downloads/DownloadQuery.cs index b279fce..54b803a 100644 --- a/src/WebExtensions.Net/Generated/Downloads/DownloadQuery.cs +++ b/src/WebExtensions.Net/Generated/Downloads/DownloadQuery.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,432 +6,132 @@ namespace WebExtensions.Net.Downloads { // Type Class /// Parameters that combine to specify a predicate that can be used to select a set of downloads. Used for example in search() and erase() + [BindAllProperties] public partial class DownloadQuery : BaseObject { - private double? _bytesReceived; - private DangerType? _danger; - private DownloadTime _endedAfter; - private DownloadTime _endedBefore; - private string _endTime; - private InterruptReason? _error; - private bool? _exists; - private string _filename; - private string _filenameRegex; - private double? _fileSize; - private int? _id; - private int? _limit; - private string _mime; - private IEnumerable _orderBy; - private bool? _paused; - private IEnumerable _query; - private DownloadTime _startedAfter; - private DownloadTime _startedBefore; - private string _startTime; - private State? _state; - private double? _totalBytes; - private double? _totalBytesGreater; - private double? _totalBytesLess; - private string _url; - private string _urlRegex; - /// Number of bytes received so far from the host, without considering file compression. [JsonPropertyName("bytesReceived")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? BytesReceived - { - get - { - InitializeProperty("bytesReceived", _bytesReceived); - return _bytesReceived; - } - set - { - _bytesReceived = value; - } - } + public double? BytesReceived { get; set; } /// Indication of whether this download is thought to be safe or known to be suspicious. [JsonPropertyName("danger")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public DangerType? Danger - { - get - { - InitializeProperty("danger", _danger); - return _danger; - } - set - { - _danger = value; - } - } + public DangerType? Danger { get; set; } /// Limits results to downloads that ended after the given ms since the epoch. [JsonPropertyName("endedAfter")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public DownloadTime EndedAfter - { - get - { - InitializeProperty("endedAfter", _endedAfter); - return _endedAfter; - } - set - { - _endedAfter = value; - } - } + public DownloadTime EndedAfter { get; set; } /// Limits results to downloads that ended before the given ms since the epoch. [JsonPropertyName("endedBefore")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public DownloadTime EndedBefore - { - get - { - InitializeProperty("endedBefore", _endedBefore); - return _endedBefore; - } - set - { - _endedBefore = value; - } - } + public DownloadTime EndedBefore { get; set; } /// [JsonPropertyName("endTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string EndTime - { - get - { - InitializeProperty("endTime", _endTime); - return _endTime; - } - set - { - _endTime = value; - } - } + public string EndTime { get; set; } /// Why a download was interrupted. [JsonPropertyName("error")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public InterruptReason? Error - { - get - { - InitializeProperty("error", _error); - return _error; - } - set - { - _error = value; - } - } + public InterruptReason? Error { get; set; } /// [JsonPropertyName("exists")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Exists - { - get - { - InitializeProperty("exists", _exists); - return _exists; - } - set - { - _exists = value; - } - } + public bool? Exists { get; set; } /// Absolute local path. [JsonPropertyName("filename")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Filename - { - get - { - InitializeProperty("filename", _filename); - return _filename; - } - set - { - _filename = value; - } - } + public string Filename { get; set; } /// Limits results to DownloadItems whose filename matches the given regular expression. [JsonPropertyName("filenameRegex")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string FilenameRegex - { - get - { - InitializeProperty("filenameRegex", _filenameRegex); - return _filenameRegex; - } - set - { - _filenameRegex = value; - } - } + public string FilenameRegex { get; set; } /// Number of bytes in the whole file post-decompression, or -1 if unknown. [JsonPropertyName("fileSize")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? FileSize - { - get - { - InitializeProperty("fileSize", _fileSize); - return _fileSize; - } - set - { - _fileSize = value; - } - } + public double? FileSize { get; set; } /// [JsonPropertyName("id")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Id - { - get - { - InitializeProperty("id", _id); - return _id; - } - set - { - _id = value; - } - } + public int? Id { get; set; } /// Setting this integer limits the number of results. Otherwise, all matching DownloadItems will be returned. [JsonPropertyName("limit")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Limit - { - get - { - InitializeProperty("limit", _limit); - return _limit; - } - set - { - _limit = value; - } - } + public int? Limit { get; set; } /// The file's MIME type. [JsonPropertyName("mime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Mime - { - get - { - InitializeProperty("mime", _mime); - return _mime; - } - set - { - _mime = value; - } - } + public string Mime { get; set; } /// Setting elements of this array to DownloadItem properties in order to sort the search results. For example, setting orderBy='startTime' sorts the DownloadItems by their start time in ascending order. To specify descending order, prefix orderBy with a hyphen: '-startTime'. [JsonPropertyName("orderBy")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable OrderBy - { - get - { - InitializeProperty("orderBy", _orderBy); - return _orderBy; - } - set - { - _orderBy = value; - } - } + public IEnumerable OrderBy { get; set; } /// True if the download has stopped reading data from the host, but kept the connection open. [JsonPropertyName("paused")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Paused - { - get - { - InitializeProperty("paused", _paused); - return _paused; - } - set - { - _paused = value; - } - } + public bool? Paused { get; set; } /// This array of search terms limits results to DownloadItems whose filename or url contain all of the search terms that do not begin with a dash '-' and none of the search terms that do begin with a dash. [JsonPropertyName("query")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Query - { - get - { - InitializeProperty("query", _query); - return _query; - } - set - { - _query = value; - } - } + public IEnumerable Query { get; set; } /// Limits results to downloads that started after the given ms since the epoch. [JsonPropertyName("startedAfter")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public DownloadTime StartedAfter - { - get - { - InitializeProperty("startedAfter", _startedAfter); - return _startedAfter; - } - set - { - _startedAfter = value; - } - } + public DownloadTime StartedAfter { get; set; } /// Limits results to downloads that started before the given ms since the epoch. [JsonPropertyName("startedBefore")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public DownloadTime StartedBefore - { - get - { - InitializeProperty("startedBefore", _startedBefore); - return _startedBefore; - } - set - { - _startedBefore = value; - } - } + public DownloadTime StartedBefore { get; set; } /// [JsonPropertyName("startTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StartTime - { - get - { - InitializeProperty("startTime", _startTime); - return _startTime; - } - set - { - _startTime = value; - } - } + public string StartTime { get; set; } /// Indicates whether the download is progressing, interrupted, or complete. [JsonPropertyName("state")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public State? State - { - get - { - InitializeProperty("state", _state); - return _state; - } - set - { - _state = value; - } - } + public State? State { get; set; } /// Number of bytes in the whole file, without considering file compression, or -1 if unknown. [JsonPropertyName("totalBytes")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? TotalBytes - { - get - { - InitializeProperty("totalBytes", _totalBytes); - return _totalBytes; - } - set - { - _totalBytes = value; - } - } + public double? TotalBytes { get; set; } /// Limits results to downloads whose totalBytes is greater than the given integer. [JsonPropertyName("totalBytesGreater")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? TotalBytesGreater - { - get - { - InitializeProperty("totalBytesGreater", _totalBytesGreater); - return _totalBytesGreater; - } - set - { - _totalBytesGreater = value; - } - } + public double? TotalBytesGreater { get; set; } /// Limits results to downloads whose totalBytes is less than the given integer. [JsonPropertyName("totalBytesLess")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? TotalBytesLess - { - get - { - InitializeProperty("totalBytesLess", _totalBytesLess); - return _totalBytesLess; - } - set - { - _totalBytesLess = value; - } - } + public double? TotalBytesLess { get; set; } /// Absolute URL. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Limits results to DownloadItems whose url matches the given regular expression. [JsonPropertyName("urlRegex")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string UrlRegex - { - get - { - InitializeProperty("urlRegex", _urlRegex); - return _urlRegex; - } - set - { - _urlRegex = value; - } - } + public string UrlRegex { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Downloads/DownloadsApi.cs b/src/WebExtensions.Net/Generated/Downloads/DownloadsApi.cs index ef00ef0..973569c 100644 --- a/src/WebExtensions.Net/Generated/Downloads/DownloadsApi.cs +++ b/src/WebExtensions.Net/Generated/Downloads/DownloadsApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Threading.Tasks; @@ -11,8 +12,9 @@ public partial class DownloadsApi : BaseApi, IDownloadsApi private OnErasedEvent _onErased; /// Creates a new instance of . - /// Web Extension JS Runtime - public DownloadsApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "downloads") + /// The JS runtime adapter. + /// The base API access path. + public DownloadsApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "downloads")) { } @@ -24,7 +26,7 @@ public OnChangedEvent OnChanged if (_onChanged is null) { _onChanged = new OnChangedEvent(); - InitializeProperty("onChanged", _onChanged); + _onChanged.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onChanged")); } return _onChanged; } @@ -38,7 +40,7 @@ public OnCreatedEvent OnCreated if (_onCreated is null) { _onCreated = new OnCreatedEvent(); - InitializeProperty("onCreated", _onCreated); + _onCreated.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onCreated")); } return _onCreated; } @@ -52,7 +54,7 @@ public OnErasedEvent OnErased if (_onErased is null) { _onErased = new OnErasedEvent(); - InitializeProperty("onErased", _onErased); + _onErased.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onErased")); } return _onErased; } diff --git a/src/WebExtensions.Net/Generated/Downloads/GetFileIconOptions.cs b/src/WebExtensions.Net/Generated/Downloads/GetFileIconOptions.cs index a4c2f69..066f64f 100644 --- a/src/WebExtensions.Net/Generated/Downloads/GetFileIconOptions.cs +++ b/src/WebExtensions.Net/Generated/Downloads/GetFileIconOptions.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Downloads { // Type Class /// + [BindAllProperties] public partial class GetFileIconOptions : BaseObject { - private int? _size; - /// The size of the icon. The returned icon will be square with dimensions size * size pixels. The default size for the icon is 32x32 pixels. [JsonPropertyName("size")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Size - { - get - { - InitializeProperty("size", _size); - return _size; - } - set - { - _size = value; - } - } + public int? Size { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Downloads/HasListenerCallbackDownloadDelta.cs b/src/WebExtensions.Net/Generated/Downloads/HasListenerCallbackDownloadDelta.cs index 3874413..479796f 100644 --- a/src/WebExtensions.Net/Generated/Downloads/HasListenerCallbackDownloadDelta.cs +++ b/src/WebExtensions.Net/Generated/Downloads/HasListenerCallbackDownloadDelta.cs @@ -1,247 +1,80 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Downloads { // Type Class /// + [BindAllProperties] public partial class HasListenerCallbackDownloadDelta : BaseObject { - private BooleanDelta _canResume; - private StringDelta _danger; - private StringDelta _endTime; - private StringDelta _error; - private BooleanDelta _exists; - private StringDelta _filename; - private DoubleDelta _fileSize; - private int _id; - private StringDelta _mime; - private BooleanDelta _paused; - private StringDelta _startTime; - private StringDelta _state; - private DoubleDelta _totalBytes; - private StringDelta _url; - /// [JsonPropertyName("canResume")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public BooleanDelta CanResume - { - get - { - InitializeProperty("canResume", _canResume); - return _canResume; - } - set - { - _canResume = value; - } - } + public BooleanDelta CanResume { get; set; } /// Describes a change in a DownloadItem's danger. [JsonPropertyName("danger")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta Danger - { - get - { - InitializeProperty("danger", _danger); - return _danger; - } - set - { - _danger = value; - } - } + public StringDelta Danger { get; set; } /// Describes a change in a DownloadItem's endTime. [JsonPropertyName("endTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta EndTime - { - get - { - InitializeProperty("endTime", _endTime); - return _endTime; - } - set - { - _endTime = value; - } - } + public StringDelta EndTime { get; set; } /// Describes a change in a DownloadItem's error. [JsonPropertyName("error")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta Error - { - get - { - InitializeProperty("error", _error); - return _error; - } - set - { - _error = value; - } - } + public StringDelta Error { get; set; } /// [JsonPropertyName("exists")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public BooleanDelta Exists - { - get - { - InitializeProperty("exists", _exists); - return _exists; - } - set - { - _exists = value; - } - } + public BooleanDelta Exists { get; set; } /// Describes a change in a DownloadItem's filename. [JsonPropertyName("filename")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta Filename - { - get - { - InitializeProperty("filename", _filename); - return _filename; - } - set - { - _filename = value; - } - } + public StringDelta Filename { get; set; } /// Describes a change in a DownloadItem's fileSize. [JsonPropertyName("fileSize")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public DoubleDelta FileSize - { - get - { - InitializeProperty("fileSize", _fileSize); - return _fileSize; - } - set - { - _fileSize = value; - } - } + public DoubleDelta FileSize { get; set; } /// The id of the DownloadItem that changed. [JsonPropertyName("id")] - public int Id - { - get - { - InitializeProperty("id", _id); - return _id; - } - set - { - _id = value; - } - } + public int Id { get; set; } /// Describes a change in a DownloadItem's mime. [JsonPropertyName("mime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta Mime - { - get - { - InitializeProperty("mime", _mime); - return _mime; - } - set - { - _mime = value; - } - } + public StringDelta Mime { get; set; } /// Describes a change in a DownloadItem's paused. [JsonPropertyName("paused")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public BooleanDelta Paused - { - get - { - InitializeProperty("paused", _paused); - return _paused; - } - set - { - _paused = value; - } - } + public BooleanDelta Paused { get; set; } /// Describes a change in a DownloadItem's startTime. [JsonPropertyName("startTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta StartTime - { - get - { - InitializeProperty("startTime", _startTime); - return _startTime; - } - set - { - _startTime = value; - } - } + public StringDelta StartTime { get; set; } /// Describes a change in a DownloadItem's state. [JsonPropertyName("state")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta State - { - get - { - InitializeProperty("state", _state); - return _state; - } - set - { - _state = value; - } - } + public StringDelta State { get; set; } /// Describes a change in a DownloadItem's totalBytes. [JsonPropertyName("totalBytes")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public DoubleDelta TotalBytes - { - get - { - InitializeProperty("totalBytes", _totalBytes); - return _totalBytes; - } - set - { - _totalBytes = value; - } - } + public DoubleDelta TotalBytes { get; set; } /// Describes a change in a DownloadItem's url. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public StringDelta Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Downloads/HeadersArrayItem.cs b/src/WebExtensions.Net/Generated/Downloads/HeadersArrayItem.cs index bc3a02a..cd41c56 100644 --- a/src/WebExtensions.Net/Generated/Downloads/HeadersArrayItem.cs +++ b/src/WebExtensions.Net/Generated/Downloads/HeadersArrayItem.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Downloads { // Type Class /// + [BindAllProperties] public partial class HeadersArrayItem : BaseObject { - private string _name; - private string _value; - /// Name of the HTTP header. [JsonPropertyName("name")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Name - { - get - { - InitializeProperty("name", _name); - return _name; - } - set - { - _name = value; - } - } + public string Name { get; set; } /// Value of the HTTP header. [JsonPropertyName("value")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Value - { - get - { - InitializeProperty("value", _value); - return _value; - } - set - { - _value = value; - } - } + public string Value { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Downloads/OnChangedEvent.cs b/src/WebExtensions.Net/Generated/Downloads/OnChangedEvent.cs index ffd1479..fa589e0 100644 --- a/src/WebExtensions.Net/Generated/Downloads/OnChangedEvent.cs +++ b/src/WebExtensions.Net/Generated/Downloads/OnChangedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Downloads { // Type Class /// When any of a DownloadItem's properties except bytesReceived changes, this event fires with the downloadId and an object containing the properties that changed. + [BindAllProperties] public partial class OnChangedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Downloads/OnCreatedEvent.cs b/src/WebExtensions.Net/Generated/Downloads/OnCreatedEvent.cs index 0ceff51..ffbea79 100644 --- a/src/WebExtensions.Net/Generated/Downloads/OnCreatedEvent.cs +++ b/src/WebExtensions.Net/Generated/Downloads/OnCreatedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Downloads { // Type Class /// This event fires with the DownloadItem object when a download begins. + [BindAllProperties] public partial class OnCreatedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Downloads/OnErasedEvent.cs b/src/WebExtensions.Net/Generated/Downloads/OnErasedEvent.cs index a4616d6..78eabcd 100644 --- a/src/WebExtensions.Net/Generated/Downloads/OnErasedEvent.cs +++ b/src/WebExtensions.Net/Generated/Downloads/OnErasedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Downloads { // Type Class /// Fires with the downloadId when a download is erased from history. + [BindAllProperties] public partial class OnErasedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Downloads/RemoveListenerCallbackDownloadDelta.cs b/src/WebExtensions.Net/Generated/Downloads/RemoveListenerCallbackDownloadDelta.cs index 9012e32..36cfed6 100644 --- a/src/WebExtensions.Net/Generated/Downloads/RemoveListenerCallbackDownloadDelta.cs +++ b/src/WebExtensions.Net/Generated/Downloads/RemoveListenerCallbackDownloadDelta.cs @@ -1,247 +1,80 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Downloads { // Type Class /// + [BindAllProperties] public partial class RemoveListenerCallbackDownloadDelta : BaseObject { - private BooleanDelta _canResume; - private StringDelta _danger; - private StringDelta _endTime; - private StringDelta _error; - private BooleanDelta _exists; - private StringDelta _filename; - private DoubleDelta _fileSize; - private int _id; - private StringDelta _mime; - private BooleanDelta _paused; - private StringDelta _startTime; - private StringDelta _state; - private DoubleDelta _totalBytes; - private StringDelta _url; - /// [JsonPropertyName("canResume")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public BooleanDelta CanResume - { - get - { - InitializeProperty("canResume", _canResume); - return _canResume; - } - set - { - _canResume = value; - } - } + public BooleanDelta CanResume { get; set; } /// Describes a change in a DownloadItem's danger. [JsonPropertyName("danger")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta Danger - { - get - { - InitializeProperty("danger", _danger); - return _danger; - } - set - { - _danger = value; - } - } + public StringDelta Danger { get; set; } /// Describes a change in a DownloadItem's endTime. [JsonPropertyName("endTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta EndTime - { - get - { - InitializeProperty("endTime", _endTime); - return _endTime; - } - set - { - _endTime = value; - } - } + public StringDelta EndTime { get; set; } /// Describes a change in a DownloadItem's error. [JsonPropertyName("error")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta Error - { - get - { - InitializeProperty("error", _error); - return _error; - } - set - { - _error = value; - } - } + public StringDelta Error { get; set; } /// [JsonPropertyName("exists")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public BooleanDelta Exists - { - get - { - InitializeProperty("exists", _exists); - return _exists; - } - set - { - _exists = value; - } - } + public BooleanDelta Exists { get; set; } /// Describes a change in a DownloadItem's filename. [JsonPropertyName("filename")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta Filename - { - get - { - InitializeProperty("filename", _filename); - return _filename; - } - set - { - _filename = value; - } - } + public StringDelta Filename { get; set; } /// Describes a change in a DownloadItem's fileSize. [JsonPropertyName("fileSize")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public DoubleDelta FileSize - { - get - { - InitializeProperty("fileSize", _fileSize); - return _fileSize; - } - set - { - _fileSize = value; - } - } + public DoubleDelta FileSize { get; set; } /// The id of the DownloadItem that changed. [JsonPropertyName("id")] - public int Id - { - get - { - InitializeProperty("id", _id); - return _id; - } - set - { - _id = value; - } - } + public int Id { get; set; } /// Describes a change in a DownloadItem's mime. [JsonPropertyName("mime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta Mime - { - get - { - InitializeProperty("mime", _mime); - return _mime; - } - set - { - _mime = value; - } - } + public StringDelta Mime { get; set; } /// Describes a change in a DownloadItem's paused. [JsonPropertyName("paused")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public BooleanDelta Paused - { - get - { - InitializeProperty("paused", _paused); - return _paused; - } - set - { - _paused = value; - } - } + public BooleanDelta Paused { get; set; } /// Describes a change in a DownloadItem's startTime. [JsonPropertyName("startTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta StartTime - { - get - { - InitializeProperty("startTime", _startTime); - return _startTime; - } - set - { - _startTime = value; - } - } + public StringDelta StartTime { get; set; } /// Describes a change in a DownloadItem's state. [JsonPropertyName("state")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta State - { - get - { - InitializeProperty("state", _state); - return _state; - } - set - { - _state = value; - } - } + public StringDelta State { get; set; } /// Describes a change in a DownloadItem's totalBytes. [JsonPropertyName("totalBytes")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public DoubleDelta TotalBytes - { - get - { - InitializeProperty("totalBytes", _totalBytes); - return _totalBytes; - } - set - { - _totalBytes = value; - } - } + public DoubleDelta TotalBytes { get; set; } /// Describes a change in a DownloadItem's url. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public StringDelta Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public StringDelta Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Downloads/StringDelta.cs b/src/WebExtensions.Net/Generated/Downloads/StringDelta.cs index 64ec39f..fb93af8 100644 --- a/src/WebExtensions.Net/Generated/Downloads/StringDelta.cs +++ b/src/WebExtensions.Net/Generated/Downloads/StringDelta.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Downloads { // Type Class /// + [BindAllProperties] public partial class StringDelta : BaseObject { - private string _current; - private string _previous; - /// [JsonPropertyName("current")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Current - { - get - { - InitializeProperty("current", _current); - return _current; - } - set - { - _current = value; - } - } + public string Current { get; set; } /// [JsonPropertyName("previous")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Previous - { - get - { - InitializeProperty("previous", _previous); - return _previous; - } - set - { - _previous = value; - } - } + public string Previous { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Events/Event.cs b/src/WebExtensions.Net/Generated/Events/Event.cs index 1c55c77..b9e387c 100644 --- a/src/WebExtensions.Net/Generated/Events/Event.cs +++ b/src/WebExtensions.Net/Generated/Events/Event.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; @@ -5,6 +6,7 @@ namespace WebExtensions.Net.Events { // Type Class /// An object which allows the addition and removal of listeners for a Chrome event. + [BindAllProperties] public partial class Event : BaseObject { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Events/UrlFilter.cs b/src/WebExtensions.Net/Generated/Events/UrlFilter.cs index 0633f30..c33af1a 100644 --- a/src/WebExtensions.Net/Generated/Events/UrlFilter.cs +++ b/src/WebExtensions.Net/Generated/Events/UrlFilter.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,347 +6,107 @@ namespace WebExtensions.Net.Events { // Type Class /// Filters URLs for various criteria. See event filtering. All criteria are case sensitive. + [BindAllProperties] public partial class UrlFilter : BaseObject { - private string _hostContains; - private string _hostEquals; - private string _hostPrefix; - private string _hostSuffix; - private string _originAndPathMatches; - private string _pathContains; - private string _pathEquals; - private string _pathPrefix; - private string _pathSuffix; - private IEnumerable _ports; - private string _queryContains; - private string _queryEquals; - private string _queryPrefix; - private string _querySuffix; - private IEnumerable _schemes; - private string _urlContains; - private string _urlEquals; - private string _urlMatches; - private string _urlPrefix; - private string _urlSuffix; - /// Matches if the host name of the URL contains a specified string. To test whether a host name component has a prefix 'foo', use hostContains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implicit dot is added at the beginning of the host name. Similarly, hostContains can be used to match against component suffix ('foo.') and to exactly match against components ('.foo.'). Suffix- and exact-matching for the last components need to be done separately using hostSuffix, because no implicit dot is added at the end of the host name. [JsonPropertyName("hostContains")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string HostContains - { - get - { - InitializeProperty("hostContains", _hostContains); - return _hostContains; - } - set - { - _hostContains = value; - } - } + public string HostContains { get; set; } /// Matches if the host name of the URL is equal to a specified string. [JsonPropertyName("hostEquals")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string HostEquals - { - get - { - InitializeProperty("hostEquals", _hostEquals); - return _hostEquals; - } - set - { - _hostEquals = value; - } - } + public string HostEquals { get; set; } /// Matches if the host name of the URL starts with a specified string. [JsonPropertyName("hostPrefix")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string HostPrefix - { - get - { - InitializeProperty("hostPrefix", _hostPrefix); - return _hostPrefix; - } - set - { - _hostPrefix = value; - } - } + public string HostPrefix { get; set; } /// Matches if the host name of the URL ends with a specified string. [JsonPropertyName("hostSuffix")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string HostSuffix - { - get - { - InitializeProperty("hostSuffix", _hostSuffix); - return _hostSuffix; - } - set - { - _hostSuffix = value; - } - } + public string HostSuffix { get; set; } /// Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. [JsonPropertyName("originAndPathMatches")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginAndPathMatches - { - get - { - InitializeProperty("originAndPathMatches", _originAndPathMatches); - return _originAndPathMatches; - } - set - { - _originAndPathMatches = value; - } - } + public string OriginAndPathMatches { get; set; } /// Matches if the path segment of the URL contains a specified string. [JsonPropertyName("pathContains")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string PathContains - { - get - { - InitializeProperty("pathContains", _pathContains); - return _pathContains; - } - set - { - _pathContains = value; - } - } + public string PathContains { get; set; } /// Matches if the path segment of the URL is equal to a specified string. [JsonPropertyName("pathEquals")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string PathEquals - { - get - { - InitializeProperty("pathEquals", _pathEquals); - return _pathEquals; - } - set - { - _pathEquals = value; - } - } + public string PathEquals { get; set; } /// Matches if the path segment of the URL starts with a specified string. [JsonPropertyName("pathPrefix")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string PathPrefix - { - get - { - InitializeProperty("pathPrefix", _pathPrefix); - return _pathPrefix; - } - set - { - _pathPrefix = value; - } - } + public string PathPrefix { get; set; } /// Matches if the path segment of the URL ends with a specified string. [JsonPropertyName("pathSuffix")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string PathSuffix - { - get - { - InitializeProperty("pathSuffix", _pathSuffix); - return _pathSuffix; - } - set - { - _pathSuffix = value; - } - } + public string PathSuffix { get; set; } /// Matches if the port of the URL is contained in any of the specified port lists. For example [80, 443, [1000, 1200]] matches all requests on port 80, 443 and in the range 1000-1200. [JsonPropertyName("ports")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Ports - { - get - { - InitializeProperty("ports", _ports); - return _ports; - } - set - { - _ports = value; - } - } + public IEnumerable Ports { get; set; } /// Matches if the query segment of the URL contains a specified string. [JsonPropertyName("queryContains")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string QueryContains - { - get - { - InitializeProperty("queryContains", _queryContains); - return _queryContains; - } - set - { - _queryContains = value; - } - } + public string QueryContains { get; set; } /// Matches if the query segment of the URL is equal to a specified string. [JsonPropertyName("queryEquals")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string QueryEquals - { - get - { - InitializeProperty("queryEquals", _queryEquals); - return _queryEquals; - } - set - { - _queryEquals = value; - } - } + public string QueryEquals { get; set; } /// Matches if the query segment of the URL starts with a specified string. [JsonPropertyName("queryPrefix")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string QueryPrefix - { - get - { - InitializeProperty("queryPrefix", _queryPrefix); - return _queryPrefix; - } - set - { - _queryPrefix = value; - } - } + public string QueryPrefix { get; set; } /// Matches if the query segment of the URL ends with a specified string. [JsonPropertyName("querySuffix")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string QuerySuffix - { - get - { - InitializeProperty("querySuffix", _querySuffix); - return _querySuffix; - } - set - { - _querySuffix = value; - } - } + public string QuerySuffix { get; set; } /// Matches if the scheme of the URL is equal to any of the schemes specified in the array. [JsonPropertyName("schemes")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Schemes - { - get - { - InitializeProperty("schemes", _schemes); - return _schemes; - } - set - { - _schemes = value; - } - } + public IEnumerable Schemes { get; set; } /// Matches if the URL (without fragment identifier) contains a specified string. Port numbers are stripped from the URL if they match the default port number. [JsonPropertyName("urlContains")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string UrlContains - { - get - { - InitializeProperty("urlContains", _urlContains); - return _urlContains; - } - set - { - _urlContains = value; - } - } + public string UrlContains { get; set; } /// Matches if the URL (without fragment identifier) is equal to a specified string. Port numbers are stripped from the URL if they match the default port number. [JsonPropertyName("urlEquals")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string UrlEquals - { - get - { - InitializeProperty("urlEquals", _urlEquals); - return _urlEquals; - } - set - { - _urlEquals = value; - } - } + public string UrlEquals { get; set; } /// Matches if the URL (without fragment identifier) matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. [JsonPropertyName("urlMatches")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string UrlMatches - { - get - { - InitializeProperty("urlMatches", _urlMatches); - return _urlMatches; - } - set - { - _urlMatches = value; - } - } + public string UrlMatches { get; set; } /// Matches if the URL (without fragment identifier) starts with a specified string. Port numbers are stripped from the URL if they match the default port number. [JsonPropertyName("urlPrefix")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string UrlPrefix - { - get - { - InitializeProperty("urlPrefix", _urlPrefix); - return _urlPrefix; - } - set - { - _urlPrefix = value; - } - } + public string UrlPrefix { get; set; } /// Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number. [JsonPropertyName("urlSuffix")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string UrlSuffix - { - get - { - InitializeProperty("urlSuffix", _urlSuffix); - return _urlSuffix; - } - set - { - _urlSuffix = value; - } - } + public string UrlSuffix { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Extension/ExtensionApi.cs b/src/WebExtensions.Net/Generated/Extension/ExtensionApi.cs index 949f621..cd979d8 100644 --- a/src/WebExtensions.Net/Generated/Extension/ExtensionApi.cs +++ b/src/WebExtensions.Net/Generated/Extension/ExtensionApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Collections.Generic; using System.Text.Json; @@ -9,8 +10,9 @@ namespace WebExtensions.Net.Extension public partial class ExtensionApi : BaseApi, IExtensionApi { /// Creates a new instance of . - /// Web Extension JS Runtime - public ExtensionApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "extension") + /// The JS runtime adapter. + /// The base API access path. + public ExtensionApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "extension")) { } diff --git a/src/WebExtensions.Net/Generated/Extension/FetchProperties.cs b/src/WebExtensions.Net/Generated/Extension/FetchProperties.cs index 03a839e..c2721f3 100644 --- a/src/WebExtensions.Net/Generated/Extension/FetchProperties.cs +++ b/src/WebExtensions.Net/Generated/Extension/FetchProperties.cs @@ -1,61 +1,26 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Extension { // Type Class /// + [BindAllProperties] public partial class FetchProperties : BaseObject { - private int? _tabId; - private ViewType? _type; - private int? _windowId; - /// Find a view according to a tab id. If this field is omitted, returns all views. [JsonPropertyName("tabId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int? TabId { get; set; } /// The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'popup', 'sidebar'. [JsonPropertyName("type")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ViewType? Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ViewType? Type { get; set; } /// The window to restrict the search to. If omitted, returns all views. [JsonPropertyName("windowId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int? WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Extension/LastError.cs b/src/WebExtensions.Net/Generated/Extension/LastError.cs index 5a12d2e..8125f93 100644 --- a/src/WebExtensions.Net/Generated/Extension/LastError.cs +++ b/src/WebExtensions.Net/Generated/Extension/LastError.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Text.Json.Serialization; @@ -5,25 +6,13 @@ namespace WebExtensions.Net.Extension { // Type Class /// Set for the lifetime of a callback if an ansychronous extension api has resulted in an error. If no error has occured lastError will be undefined. + [BindAllProperties] [Obsolete("Please use $(ref:runtime.lastError).")] public partial class LastError : BaseObject { - private string _message; - /// Description of the error that has taken place. [JsonPropertyName("message")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Message - { - get - { - InitializeProperty("message", _message); - return _message; - } - set - { - _message = value; - } - } + public string Message { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/ExtensionTypes/ExtensionCode.cs b/src/WebExtensions.Net/Generated/ExtensionTypes/ExtensionCode.cs index 4439e41..5432ad1 100644 --- a/src/WebExtensions.Net/Generated/ExtensionTypes/ExtensionCode.cs +++ b/src/WebExtensions.Net/Generated/ExtensionTypes/ExtensionCode.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.ExtensionTypes { // Type Class /// + [BindAllProperties] public partial class ExtensionCode : BaseObject { - private string _code; - /// [JsonPropertyName("code")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Code - { - get - { - InitializeProperty("code", _code); - return _code; - } - set - { - _code = value; - } - } + public string Code { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/ExtensionTypes/ExtensionFile.cs b/src/WebExtensions.Net/Generated/ExtensionTypes/ExtensionFile.cs index 73e5550..87fd8d7 100644 --- a/src/WebExtensions.Net/Generated/ExtensionTypes/ExtensionFile.cs +++ b/src/WebExtensions.Net/Generated/ExtensionTypes/ExtensionFile.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Text.Json.Serialization; using WebExtensions.Net.Manifest; @@ -5,24 +6,12 @@ namespace WebExtensions.Net.ExtensionTypes { // Type Class /// + [BindAllProperties] public partial class ExtensionFile : BaseObject { - private ExtensionUrl _file; - /// [JsonPropertyName("file")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ExtensionUrl File - { - get - { - InitializeProperty("file", _file); - return _file; - } - set - { - _file = value; - } - } + public ExtensionUrl File { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/ExtensionTypes/ImageDetails.cs b/src/WebExtensions.Net/Generated/ExtensionTypes/ImageDetails.cs index 61944e1..d809f8e 100644 --- a/src/WebExtensions.Net/Generated/ExtensionTypes/ImageDetails.cs +++ b/src/WebExtensions.Net/Generated/ExtensionTypes/ImageDetails.cs @@ -1,78 +1,31 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.ExtensionTypes { // Type Class /// Details about the format, quality, area and scale of the capture. + [BindAllProperties] public partial class ImageDetails : BaseObject { - private ImageFormat? _format; - private int? _quality; - private Rect _rect; - private double? _scale; - /// The format of the resulting image. Default is "jpeg". [JsonPropertyName("format")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ImageFormat? Format - { - get - { - InitializeProperty("format", _format); - return _format; - } - set - { - _format = value; - } - } + public ImageFormat? Format { get; set; } /// When format is "jpeg", controls the quality of the resulting image. This value is ignored for PNG images. As quality is decreased, the resulting image will have more visual artifacts, and the number of bytes needed to store it will decrease. [JsonPropertyName("quality")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Quality - { - get - { - InitializeProperty("quality", _quality); - return _quality; - } - set - { - _quality = value; - } - } + public int? Quality { get; set; } /// The area of the document to capture, in CSS pixels, relative to the page. If omitted, capture the visible viewport. [JsonPropertyName("rect")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Rect Rect - { - get - { - InitializeProperty("rect", _rect); - return _rect; - } - set - { - _rect = value; - } - } + public Rect Rect { get; set; } /// The scale of the resulting image. Defaults to devicePixelRatio. [JsonPropertyName("scale")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? Scale - { - get - { - InitializeProperty("scale", _scale); - return _scale; - } - set - { - _scale = value; - } - } + public double? Scale { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/ExtensionTypes/InjectDetails.cs b/src/WebExtensions.Net/Generated/ExtensionTypes/InjectDetails.cs index 5d52177..718c166 100644 --- a/src/WebExtensions.Net/Generated/ExtensionTypes/InjectDetails.cs +++ b/src/WebExtensions.Net/Generated/ExtensionTypes/InjectDetails.cs @@ -1,129 +1,46 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.ExtensionTypes { // Type Class /// Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. + [BindAllProperties] public partial class InjectDetails : BaseObject { - private bool? _allFrames; - private string _code; - private CSSOrigin? _cssOrigin; - private string _file; - private int? _frameId; - private bool? _matchAboutBlank; - private RunAt? _runAt; - /// If allFrames is true, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's false and is only injected into the top frame. [JsonPropertyName("allFrames")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? AllFrames - { - get - { - InitializeProperty("allFrames", _allFrames); - return _allFrames; - } - set - { - _allFrames = value; - } - } + public bool? AllFrames { get; set; } /// JavaScript or CSS code to inject.

'b'Warning:'/b'
Be careful using the code parameter. Incorrect use of it may open your extension to cross site scripting attacks.
[JsonPropertyName("code")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Code - { - get - { - InitializeProperty("code", _code); - return _code; - } - set - { - _code = value; - } - } + public string Code { get; set; } /// The css origin of the stylesheet to inject. Defaults to "author". [JsonPropertyName("cssOrigin")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public CSSOrigin? CssOrigin - { - get - { - InitializeProperty("cssOrigin", _cssOrigin); - return _cssOrigin; - } - set - { - _cssOrigin = value; - } - } + public CSSOrigin? CssOrigin { get; set; } /// JavaScript or CSS file to inject. [JsonPropertyName("file")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string File - { - get - { - InitializeProperty("file", _file); - return _file; - } - set - { - _file = value; - } - } + public string File { get; set; } /// The ID of the frame to inject the script into. This may not be used in combination with allFrames. [JsonPropertyName("frameId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int? FrameId { get; set; } /// If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default it is false. [JsonPropertyName("matchAboutBlank")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? MatchAboutBlank - { - get - { - InitializeProperty("matchAboutBlank", _matchAboutBlank); - return _matchAboutBlank; - } - set - { - _matchAboutBlank = value; - } - } + public bool? MatchAboutBlank { get; set; } /// The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle". [JsonPropertyName("runAt")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public RunAt? RunAt - { - get - { - InitializeProperty("runAt", _runAt); - return _runAt; - } - set - { - _runAt = value; - } - } + public RunAt? RunAt { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/ExtensionTypes/Rect.cs b/src/WebExtensions.Net/Generated/ExtensionTypes/Rect.cs index 7399913..dd75a2e 100644 --- a/src/WebExtensions.Net/Generated/ExtensionTypes/Rect.cs +++ b/src/WebExtensions.Net/Generated/ExtensionTypes/Rect.cs @@ -1,74 +1,27 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.ExtensionTypes { // Type Class /// The area of the document to capture, in CSS pixels, relative to the page. If omitted, capture the visible viewport. + [BindAllProperties] public partial class Rect : BaseObject { - private double _height; - private double _width; - private double _X; - private double _Y; - /// [JsonPropertyName("height")] - public double Height - { - get - { - InitializeProperty("height", _height); - return _height; - } - set - { - _height = value; - } - } + public double Height { get; set; } /// [JsonPropertyName("width")] - public double Width - { - get - { - InitializeProperty("width", _width); - return _width; - } - set - { - _width = value; - } - } + public double Width { get; set; } /// - [JsonPropertyName("X")] - public double X - { - get - { - InitializeProperty("X", _X); - return _X; - } - set - { - _X = value; - } - } + [JsonPropertyName("x")] + public double X { get; set; } /// - [JsonPropertyName("Y")] - public double Y - { - get - { - InitializeProperty("Y", _Y); - return _Y; - } - set - { - _Y = value; - } - } + [JsonPropertyName("y")] + public double Y { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/History/AddListenerCallbackChanged.cs b/src/WebExtensions.Net/Generated/History/AddListenerCallbackChanged.cs index 1438f6e..54bbdf1 100644 --- a/src/WebExtensions.Net/Generated/History/AddListenerCallbackChanged.cs +++ b/src/WebExtensions.Net/Generated/History/AddListenerCallbackChanged.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.History { // Type Class /// + [BindAllProperties] public partial class AddListenerCallbackChanged : BaseObject { - private string _title; - private string _url; - /// The new title for the URL. [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// The URL for which the title has changed [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/History/AddListenerCallbackRemoved.cs b/src/WebExtensions.Net/Generated/History/AddListenerCallbackRemoved.cs index 59e8f41..d1f4dea 100644 --- a/src/WebExtensions.Net/Generated/History/AddListenerCallbackRemoved.cs +++ b/src/WebExtensions.Net/Generated/History/AddListenerCallbackRemoved.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,40 +6,16 @@ namespace WebExtensions.Net.History { // Type Class /// + [BindAllProperties] public partial class AddListenerCallbackRemoved : BaseObject { - private bool _allHistory; - private IEnumerable _urls; - /// True if all history was removed. If true, then urls will be empty. [JsonPropertyName("allHistory")] - public bool AllHistory - { - get - { - InitializeProperty("allHistory", _allHistory); - return _allHistory; - } - set - { - _allHistory = value; - } - } + public bool AllHistory { get; set; } /// [JsonPropertyName("urls")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Urls - { - get - { - InitializeProperty("urls", _urls); - return _urls; - } - set - { - _urls = value; - } - } + public IEnumerable Urls { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/History/AddUrlDetails.cs b/src/WebExtensions.Net/Generated/History/AddUrlDetails.cs index 0b5a121..559ced1 100644 --- a/src/WebExtensions.Net/Generated/History/AddUrlDetails.cs +++ b/src/WebExtensions.Net/Generated/History/AddUrlDetails.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Text.Json.Serialization; using WebExtensions.Net.ExtensionTypes; @@ -5,75 +6,27 @@ namespace WebExtensions.Net.History { // Type Class /// + [BindAllProperties] public partial class AddUrlDetails : BaseObject { - private string _title; - private TransitionType? _transition; - private string _url; - private Date _visitTime; - /// The title of the page. [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// The $(topic:transition-types)[transition type] for this visit from its referrer. [JsonPropertyName("transition")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public TransitionType? Transition - { - get - { - InitializeProperty("transition", _transition); - return _transition; - } - set - { - _transition = value; - } - } + public TransitionType? Transition { get; set; } /// The URL to add. Must be a valid URL that can be added to history. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// The date when this visit occurred. [JsonPropertyName("visitTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Date VisitTime - { - get - { - InitializeProperty("visitTime", _visitTime); - return _visitTime; - } - set - { - _visitTime = value; - } - } + public Date VisitTime { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/History/DeleteUrlDetails.cs b/src/WebExtensions.Net/Generated/History/DeleteUrlDetails.cs index 109aa27..d19079c 100644 --- a/src/WebExtensions.Net/Generated/History/DeleteUrlDetails.cs +++ b/src/WebExtensions.Net/Generated/History/DeleteUrlDetails.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.History { // Type Class /// + [BindAllProperties] public partial class DeleteUrlDetails : BaseObject { - private string _url; - /// The URL to remove. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/History/GetVisitsDetails.cs b/src/WebExtensions.Net/Generated/History/GetVisitsDetails.cs index 28e33e4..5c8acc3 100644 --- a/src/WebExtensions.Net/Generated/History/GetVisitsDetails.cs +++ b/src/WebExtensions.Net/Generated/History/GetVisitsDetails.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.History { // Type Class /// + [BindAllProperties] public partial class GetVisitsDetails : BaseObject { - private string _url; - /// The URL for which to retrieve visit information. It must be in the format as returned from a call to history.search. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/History/HasListenerCallbackChanged.cs b/src/WebExtensions.Net/Generated/History/HasListenerCallbackChanged.cs index 9320fc5..aabfbc9 100644 --- a/src/WebExtensions.Net/Generated/History/HasListenerCallbackChanged.cs +++ b/src/WebExtensions.Net/Generated/History/HasListenerCallbackChanged.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.History { // Type Class /// + [BindAllProperties] public partial class HasListenerCallbackChanged : BaseObject { - private string _title; - private string _url; - /// The new title for the URL. [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// The URL for which the title has changed [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/History/HasListenerCallbackRemoved.cs b/src/WebExtensions.Net/Generated/History/HasListenerCallbackRemoved.cs index 3b78c1c..9ee4c01 100644 --- a/src/WebExtensions.Net/Generated/History/HasListenerCallbackRemoved.cs +++ b/src/WebExtensions.Net/Generated/History/HasListenerCallbackRemoved.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,40 +6,16 @@ namespace WebExtensions.Net.History { // Type Class /// + [BindAllProperties] public partial class HasListenerCallbackRemoved : BaseObject { - private bool _allHistory; - private IEnumerable _urls; - /// True if all history was removed. If true, then urls will be empty. [JsonPropertyName("allHistory")] - public bool AllHistory - { - get - { - InitializeProperty("allHistory", _allHistory); - return _allHistory; - } - set - { - _allHistory = value; - } - } + public bool AllHistory { get; set; } /// [JsonPropertyName("urls")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Urls - { - get - { - InitializeProperty("urls", _urls); - return _urls; - } - set - { - _urls = value; - } - } + public IEnumerable Urls { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/History/HistoryApi.cs b/src/WebExtensions.Net/Generated/History/HistoryApi.cs index ebe0b79..f9bf098 100644 --- a/src/WebExtensions.Net/Generated/History/HistoryApi.cs +++ b/src/WebExtensions.Net/Generated/History/HistoryApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Threading.Tasks; @@ -11,8 +12,9 @@ public partial class HistoryApi : BaseApi, IHistoryApi private OnVisitRemovedEvent _onVisitRemoved; /// Creates a new instance of . - /// Web Extension JS Runtime - public HistoryApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "history") + /// The JS runtime adapter. + /// The base API access path. + public HistoryApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "history")) { } @@ -24,7 +26,7 @@ public OnTitleChangedEvent OnTitleChanged if (_onTitleChanged is null) { _onTitleChanged = new OnTitleChangedEvent(); - InitializeProperty("onTitleChanged", _onTitleChanged); + _onTitleChanged.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onTitleChanged")); } return _onTitleChanged; } @@ -38,7 +40,7 @@ public OnVisitedEvent OnVisited if (_onVisited is null) { _onVisited = new OnVisitedEvent(); - InitializeProperty("onVisited", _onVisited); + _onVisited.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onVisited")); } return _onVisited; } @@ -52,7 +54,7 @@ public OnVisitRemovedEvent OnVisitRemoved if (_onVisitRemoved is null) { _onVisitRemoved = new OnVisitRemovedEvent(); - InitializeProperty("onVisitRemoved", _onVisitRemoved); + _onVisitRemoved.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onVisitRemoved")); } return _onVisitRemoved; } diff --git a/src/WebExtensions.Net/Generated/History/HistoryItem.cs b/src/WebExtensions.Net/Generated/History/HistoryItem.cs index 7b74f83..00879cd 100644 --- a/src/WebExtensions.Net/Generated/History/HistoryItem.cs +++ b/src/WebExtensions.Net/Generated/History/HistoryItem.cs @@ -1,112 +1,41 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.History { // Type Class /// An object encapsulating one result of a history query. + [BindAllProperties] public partial class HistoryItem : BaseObject { - private string _id; - private EpochTime? _lastVisitTime; - private string _title; - private int? _typedCount; - private string _url; - private int? _visitCount; - /// The unique identifier for the item. [JsonPropertyName("id")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Id - { - get - { - InitializeProperty("id", _id); - return _id; - } - set - { - _id = value; - } - } + public string Id { get; set; } /// When this page was last loaded, represented in milliseconds since the epoch. [JsonPropertyName("lastVisitTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public EpochTime? LastVisitTime - { - get - { - InitializeProperty("lastVisitTime", _lastVisitTime); - return _lastVisitTime; - } - set - { - _lastVisitTime = value; - } - } + public EpochTime? LastVisitTime { get; set; } /// The title of the page when it was last loaded. [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// The number of times the user has navigated to this page by typing in the address. [JsonPropertyName("typedCount")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? TypedCount - { - get - { - InitializeProperty("typedCount", _typedCount); - return _typedCount; - } - set - { - _typedCount = value; - } - } + public int? TypedCount { get; set; } /// The URL navigated to by a user. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// The number of times the user has navigated to this page. [JsonPropertyName("visitCount")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? VisitCount - { - get - { - InitializeProperty("visitCount", _visitCount); - return _visitCount; - } - set - { - _visitCount = value; - } - } + public int? VisitCount { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/History/OnTitleChangedEvent.cs b/src/WebExtensions.Net/Generated/History/OnTitleChangedEvent.cs index d06e7be..38ce204 100644 --- a/src/WebExtensions.Net/Generated/History/OnTitleChangedEvent.cs +++ b/src/WebExtensions.Net/Generated/History/OnTitleChangedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.History { // Type Class /// Fired when the title of a URL is changed in the browser history. + [BindAllProperties] public partial class OnTitleChangedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/History/OnVisitRemovedEvent.cs b/src/WebExtensions.Net/Generated/History/OnVisitRemovedEvent.cs index 1cf5d0b..581f762 100644 --- a/src/WebExtensions.Net/Generated/History/OnVisitRemovedEvent.cs +++ b/src/WebExtensions.Net/Generated/History/OnVisitRemovedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.History { // Type Class /// Fired when one or more URLs are removed from the history service. When all visits have been removed the URL is purged from history. + [BindAllProperties] public partial class OnVisitRemovedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/History/OnVisitedEvent.cs b/src/WebExtensions.Net/Generated/History/OnVisitedEvent.cs index 5b11858..e72398e 100644 --- a/src/WebExtensions.Net/Generated/History/OnVisitedEvent.cs +++ b/src/WebExtensions.Net/Generated/History/OnVisitedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.History { // Type Class /// Fired when a URL is visited, providing the HistoryItem data for that URL. This event fires before the page has loaded. + [BindAllProperties] public partial class OnVisitedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/History/Query.cs b/src/WebExtensions.Net/Generated/History/Query.cs index f888bef..ce13dab 100644 --- a/src/WebExtensions.Net/Generated/History/Query.cs +++ b/src/WebExtensions.Net/Generated/History/Query.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Text.Json.Serialization; using WebExtensions.Net.ExtensionTypes; @@ -5,75 +6,27 @@ namespace WebExtensions.Net.History { // Type Class /// + [BindAllProperties] public partial class Query : BaseObject { - private Date _endTime; - private int? _maxResults; - private Date _startTime; - private string _text; - /// Limit results to those visited before this date. [JsonPropertyName("endTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Date EndTime - { - get - { - InitializeProperty("endTime", _endTime); - return _endTime; - } - set - { - _endTime = value; - } - } + public Date EndTime { get; set; } /// The maximum number of results to retrieve. Defaults to 100. [JsonPropertyName("maxResults")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? MaxResults - { - get - { - InitializeProperty("maxResults", _maxResults); - return _maxResults; - } - set - { - _maxResults = value; - } - } + public int? MaxResults { get; set; } /// Limit results to those visited after this date. If not specified, this defaults to 24 hours in the past. [JsonPropertyName("startTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Date StartTime - { - get - { - InitializeProperty("startTime", _startTime); - return _startTime; - } - set - { - _startTime = value; - } - } + public Date StartTime { get; set; } /// A free-text query to the history service. Leave empty to retrieve all pages. [JsonPropertyName("text")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Text - { - get - { - InitializeProperty("text", _text); - return _text; - } - set - { - _text = value; - } - } + public string Text { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/History/Range.cs b/src/WebExtensions.Net/Generated/History/Range.cs index f07925a..6b3711e 100644 --- a/src/WebExtensions.Net/Generated/History/Range.cs +++ b/src/WebExtensions.Net/Generated/History/Range.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Text.Json.Serialization; using WebExtensions.Net.ExtensionTypes; @@ -5,41 +6,17 @@ namespace WebExtensions.Net.History { // Type Class /// + [BindAllProperties] public partial class Range : BaseObject { - private Date _endTime; - private Date _startTime; - /// Items added to history before this date. [JsonPropertyName("endTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Date EndTime - { - get - { - InitializeProperty("endTime", _endTime); - return _endTime; - } - set - { - _endTime = value; - } - } + public Date EndTime { get; set; } /// Items added to history after this date. [JsonPropertyName("startTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Date StartTime - { - get - { - InitializeProperty("startTime", _startTime); - return _startTime; - } - set - { - _startTime = value; - } - } + public Date StartTime { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/History/RemoveListenerCallbackChanged.cs b/src/WebExtensions.Net/Generated/History/RemoveListenerCallbackChanged.cs index 31b24e6..cb2ed0a 100644 --- a/src/WebExtensions.Net/Generated/History/RemoveListenerCallbackChanged.cs +++ b/src/WebExtensions.Net/Generated/History/RemoveListenerCallbackChanged.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.History { // Type Class /// + [BindAllProperties] public partial class RemoveListenerCallbackChanged : BaseObject { - private string _title; - private string _url; - /// The new title for the URL. [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// The URL for which the title has changed [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/History/RemoveListenerCallbackRemoved.cs b/src/WebExtensions.Net/Generated/History/RemoveListenerCallbackRemoved.cs index 2435432..5ea4b07 100644 --- a/src/WebExtensions.Net/Generated/History/RemoveListenerCallbackRemoved.cs +++ b/src/WebExtensions.Net/Generated/History/RemoveListenerCallbackRemoved.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,40 +6,16 @@ namespace WebExtensions.Net.History { // Type Class /// + [BindAllProperties] public partial class RemoveListenerCallbackRemoved : BaseObject { - private bool _allHistory; - private IEnumerable _urls; - /// True if all history was removed. If true, then urls will be empty. [JsonPropertyName("allHistory")] - public bool AllHistory - { - get - { - InitializeProperty("allHistory", _allHistory); - return _allHistory; - } - set - { - _allHistory = value; - } - } + public bool AllHistory { get; set; } /// [JsonPropertyName("urls")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Urls - { - get - { - InitializeProperty("urls", _urls); - return _urls; - } - set - { - _urls = value; - } - } + public IEnumerable Urls { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/History/VisitItem.cs b/src/WebExtensions.Net/Generated/History/VisitItem.cs index 1219af1..c448051 100644 --- a/src/WebExtensions.Net/Generated/History/VisitItem.cs +++ b/src/WebExtensions.Net/Generated/History/VisitItem.cs @@ -1,94 +1,35 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.History { // Type Class /// An object encapsulating one visit to a URL. + [BindAllProperties] public partial class VisitItem : BaseObject { - private string _id; - private string _referringVisitId; - private TransitionType _transition; - private string _visitId; - private EpochTime? _visitTime; - /// The unique identifier for the item. [JsonPropertyName("id")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Id - { - get - { - InitializeProperty("id", _id); - return _id; - } - set - { - _id = value; - } - } + public string Id { get; set; } /// The visit ID of the referrer. [JsonPropertyName("referringVisitId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string ReferringVisitId - { - get - { - InitializeProperty("referringVisitId", _referringVisitId); - return _referringVisitId; - } - set - { - _referringVisitId = value; - } - } + public string ReferringVisitId { get; set; } /// The $(topic:transition-types)[transition type] for this visit from its referrer. [JsonPropertyName("transition")] - public TransitionType Transition - { - get - { - InitializeProperty("transition", _transition); - return _transition; - } - set - { - _transition = value; - } - } + public TransitionType Transition { get; set; } /// The unique identifier for this visit. [JsonPropertyName("visitId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string VisitId - { - get - { - InitializeProperty("visitId", _visitId); - return _visitId; - } - set - { - _visitId = value; - } - } + public string VisitId { get; set; } /// When this visit occurred, represented in milliseconds since the epoch. [JsonPropertyName("visitTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public EpochTime? VisitTime - { - get - { - InitializeProperty("visitTime", _visitTime); - return _visitTime; - } - set - { - _visitTime = value; - } - } + public EpochTime? VisitTime { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/I18n/I18nApi.cs b/src/WebExtensions.Net/Generated/I18n/I18nApi.cs index d87873e..a1364ef 100644 --- a/src/WebExtensions.Net/Generated/I18n/I18nApi.cs +++ b/src/WebExtensions.Net/Generated/I18n/I18nApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Threading.Tasks; @@ -7,8 +8,9 @@ namespace WebExtensions.Net.I18n public partial class I18nApi : BaseApi, II18nApi { /// Creates a new instance of . - /// Web Extension JS Runtime - public I18nApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "i18n") + /// The JS runtime adapter. + /// The base API access path. + public I18nApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "i18n")) { } diff --git a/src/WebExtensions.Net/Generated/I18n/LanguagesArrayItem.cs b/src/WebExtensions.Net/Generated/I18n/LanguagesArrayItem.cs index fa74710..2c29971 100644 --- a/src/WebExtensions.Net/Generated/I18n/LanguagesArrayItem.cs +++ b/src/WebExtensions.Net/Generated/I18n/LanguagesArrayItem.cs @@ -1,43 +1,20 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.I18n { // Type Class /// + [BindAllProperties] public partial class LanguagesArrayItem : BaseObject { - private LanguageCode _language; - private int _percentage; - /// [JsonPropertyName("language")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public LanguageCode Language - { - get - { - InitializeProperty("language", _language); - return _language; - } - set - { - _language = value; - } - } + public LanguageCode Language { get; set; } /// The percentage of the detected language [JsonPropertyName("percentage")] - public int Percentage - { - get - { - InitializeProperty("percentage", _percentage); - return _percentage; - } - set - { - _percentage = value; - } - } + public int Percentage { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/I18n/Result.cs b/src/WebExtensions.Net/Generated/I18n/Result.cs index e936978..5b4f228 100644 --- a/src/WebExtensions.Net/Generated/I18n/Result.cs +++ b/src/WebExtensions.Net/Generated/I18n/Result.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,40 +6,16 @@ namespace WebExtensions.Net.I18n { // Type Class /// LanguageDetectionResult object that holds detected langugae reliability and array of DetectedLanguage + [BindAllProperties] public partial class Result : BaseObject { - private bool _isReliable; - private IEnumerable _languages; - /// CLD detected language reliability [JsonPropertyName("isReliable")] - public bool IsReliable - { - get - { - InitializeProperty("isReliable", _isReliable); - return _isReliable; - } - set - { - _isReliable = value; - } - } + public bool IsReliable { get; set; } /// array of detectedLanguage [JsonPropertyName("languages")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Languages - { - get - { - InitializeProperty("languages", _languages); - return _languages; - } - set - { - _languages = value; - } - } + public IEnumerable Languages { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Identity/IdentityApi.cs b/src/WebExtensions.Net/Generated/Identity/IdentityApi.cs index a681570..a42544e 100644 --- a/src/WebExtensions.Net/Generated/Identity/IdentityApi.cs +++ b/src/WebExtensions.Net/Generated/Identity/IdentityApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Threading.Tasks; namespace WebExtensions.Net.Identity @@ -6,8 +7,9 @@ namespace WebExtensions.Net.Identity public partial class IdentityApi : BaseApi, IIdentityApi { /// Creates a new instance of . - /// Web Extension JS Runtime - public IdentityApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "identity") + /// The JS runtime adapter. + /// The base API access path. + public IdentityApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "identity")) { } diff --git a/src/WebExtensions.Net/Generated/Identity/LaunchWebAuthFlowDetails.cs b/src/WebExtensions.Net/Generated/Identity/LaunchWebAuthFlowDetails.cs index c9d2eb8..4858c68 100644 --- a/src/WebExtensions.Net/Generated/Identity/LaunchWebAuthFlowDetails.cs +++ b/src/WebExtensions.Net/Generated/Identity/LaunchWebAuthFlowDetails.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Text.Json.Serialization; using WebExtensions.Net.Manifest; @@ -5,41 +6,17 @@ namespace WebExtensions.Net.Identity { // Type Class /// + [BindAllProperties] public partial class LaunchWebAuthFlowDetails : BaseObject { - private bool? _interactive; - private HttpURL _url; - /// [JsonPropertyName("interactive")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Interactive - { - get - { - InitializeProperty("interactive", _interactive); - return _interactive; - } - set - { - _interactive = value; - } - } + public bool? Interactive { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpURL Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public HttpURL Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Idle/IdleApi.cs b/src/WebExtensions.Net/Generated/Idle/IdleApi.cs index ab7cc59..25599b5 100644 --- a/src/WebExtensions.Net/Generated/Idle/IdleApi.cs +++ b/src/WebExtensions.Net/Generated/Idle/IdleApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Threading.Tasks; namespace WebExtensions.Net.Idle @@ -8,8 +9,9 @@ public partial class IdleApi : BaseApi, IIdleApi private OnStateChangedEvent _onStateChanged; /// Creates a new instance of . - /// Web Extension JS Runtime - public IdleApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "idle") + /// The JS runtime adapter. + /// The base API access path. + public IdleApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "idle")) { } @@ -21,7 +23,7 @@ public OnStateChangedEvent OnStateChanged if (_onStateChanged is null) { _onStateChanged = new OnStateChangedEvent(); - InitializeProperty("onStateChanged", _onStateChanged); + _onStateChanged.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onStateChanged")); } return _onStateChanged; } diff --git a/src/WebExtensions.Net/Generated/Idle/OnStateChangedEvent.cs b/src/WebExtensions.Net/Generated/Idle/OnStateChangedEvent.cs index a934eca..af528f9 100644 --- a/src/WebExtensions.Net/Generated/Idle/OnStateChangedEvent.cs +++ b/src/WebExtensions.Net/Generated/Idle/OnStateChangedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Idle { // Type Class /// Fired when the system changes to an active or idle state. The event fires with "idle" if the the user has not generated any input for a specified number of seconds, and "active" when the user generates input on an idle system. + [BindAllProperties] public partial class OnStateChangedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Management/ExtensionInfo.cs b/src/WebExtensions.Net/Generated/Management/ExtensionInfo.cs index 08c41b6..946fc37 100644 --- a/src/WebExtensions.Net/Generated/Management/ExtensionInfo.cs +++ b/src/WebExtensions.Net/Generated/Management/ExtensionInfo.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,292 +6,88 @@ namespace WebExtensions.Net.Management { // Type Class /// Information about an installed extension. + [BindAllProperties] public partial class ExtensionInfo : BaseObject { - private string _description; - private ExtensionDisabledReason? _disabledReason; - private bool _enabled; - private string _homepageUrl; - private IEnumerable _hostPermissions; - private IEnumerable _icons; - private string _id; - private ExtensionInstallType _installType; - private bool _mayDisable; - private string _name; - private string _optionsUrl; - private IEnumerable _permissions; - private string _shortName; - private ExtensionType _type; - private string _updateUrl; - private string _version; - private string _versionName; - /// The description of this extension. [JsonPropertyName("description")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Description - { - get - { - InitializeProperty("description", _description); - return _description; - } - set - { - _description = value; - } - } + public string Description { get; set; } /// A reason the item is disabled. [JsonPropertyName("disabledReason")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ExtensionDisabledReason? DisabledReason - { - get - { - InitializeProperty("disabledReason", _disabledReason); - return _disabledReason; - } - set - { - _disabledReason = value; - } - } + public ExtensionDisabledReason? DisabledReason { get; set; } /// Whether it is currently enabled or disabled. [JsonPropertyName("enabled")] - public bool Enabled - { - get - { - InitializeProperty("enabled", _enabled); - return _enabled; - } - set - { - _enabled = value; - } - } + public bool Enabled { get; set; } /// The URL of the homepage of this extension. [JsonPropertyName("homepageUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string HomepageUrl - { - get - { - InitializeProperty("homepageUrl", _homepageUrl); - return _homepageUrl; - } - set - { - _homepageUrl = value; - } - } + public string HomepageUrl { get; set; } /// Returns a list of host based permissions. [JsonPropertyName("hostPermissions")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable HostPermissions - { - get - { - InitializeProperty("hostPermissions", _hostPermissions); - return _hostPermissions; - } - set - { - _hostPermissions = value; - } - } + public IEnumerable HostPermissions { get; set; } /// A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the manifest documentation on icons for more details. [JsonPropertyName("icons")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Icons - { - get - { - InitializeProperty("icons", _icons); - return _icons; - } - set - { - _icons = value; - } - } + public IEnumerable Icons { get; set; } /// The extension's unique identifier. [JsonPropertyName("id")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Id - { - get - { - InitializeProperty("id", _id); - return _id; - } - set - { - _id = value; - } - } + public string Id { get; set; } /// How the extension was installed. [JsonPropertyName("installType")] - public ExtensionInstallType InstallType - { - get - { - InitializeProperty("installType", _installType); - return _installType; - } - set - { - _installType = value; - } - } + public ExtensionInstallType InstallType { get; set; } /// Whether this extension can be disabled or uninstalled by the user. [JsonPropertyName("mayDisable")] - public bool MayDisable - { - get - { - InitializeProperty("mayDisable", _mayDisable); - return _mayDisable; - } - set - { - _mayDisable = value; - } - } + public bool MayDisable { get; set; } /// The name of this extension. [JsonPropertyName("name")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Name - { - get - { - InitializeProperty("name", _name); - return _name; - } - set - { - _name = value; - } - } + public string Name { get; set; } /// The url for the item's options page, if it has one. [JsonPropertyName("optionsUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OptionsUrl - { - get - { - InitializeProperty("optionsUrl", _optionsUrl); - return _optionsUrl; - } - set - { - _optionsUrl = value; - } - } + public string OptionsUrl { get; set; } /// Returns a list of API based permissions. [JsonPropertyName("permissions")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Permissions - { - get - { - InitializeProperty("permissions", _permissions); - return _permissions; - } - set - { - _permissions = value; - } - } + public IEnumerable Permissions { get; set; } /// A short version of the name of this extension. [JsonPropertyName("shortName")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string ShortName - { - get - { - InitializeProperty("shortName", _shortName); - return _shortName; - } - set - { - _shortName = value; - } - } + public string ShortName { get; set; } /// The type of this extension, 'extension' or 'theme'. [JsonPropertyName("type")] - public ExtensionType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ExtensionType Type { get; set; } /// The update URL of this extension. [JsonPropertyName("updateUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string UpdateUrl - { - get - { - InitializeProperty("updateUrl", _updateUrl); - return _updateUrl; - } - set - { - _updateUrl = value; - } - } + public string UpdateUrl { get; set; } /// The version of this extension. [JsonPropertyName("version")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Version - { - get - { - InitializeProperty("version", _version); - return _version; - } - set - { - _version = value; - } - } + public string Version { get; set; } /// The version name of this extension if the manifest specified one. [JsonPropertyName("versionName")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string VersionName - { - get - { - InitializeProperty("versionName", _versionName); - return _versionName; - } - set - { - _versionName = value; - } - } + public string VersionName { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Management/IconInfo.cs b/src/WebExtensions.Net/Generated/Management/IconInfo.cs index 8bd3185..7b704f2 100644 --- a/src/WebExtensions.Net/Generated/Management/IconInfo.cs +++ b/src/WebExtensions.Net/Generated/Management/IconInfo.cs @@ -1,43 +1,20 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Management { // Type Class /// Information about an icon belonging to an extension. + [BindAllProperties] public partial class IconInfo : BaseObject { - private int _size; - private string _url; - /// A number representing the width and height of the icon. Likely values include (but are not limited to) 128, 48, 24, and 16. [JsonPropertyName("size")] - public int Size - { - get - { - InitializeProperty("size", _size); - return _size; - } - set - { - _size = value; - } - } + public int Size { get; set; } /// The URL for this icon image. To display a grayscale version of the icon (to indicate that an extension is disabled, for example), append ?grayscale=true to the URL. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Management/InstallOptions.cs b/src/WebExtensions.Net/Generated/Management/InstallOptions.cs index c0356f5..0f08a1d 100644 --- a/src/WebExtensions.Net/Generated/Management/InstallOptions.cs +++ b/src/WebExtensions.Net/Generated/Management/InstallOptions.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Text.Json.Serialization; using WebExtensions.Net.Manifest; @@ -5,41 +6,17 @@ namespace WebExtensions.Net.Management { // Type Class /// + [BindAllProperties] public partial class InstallOptions : BaseObject { - private string _hash; - private HttpURL _url; - /// A hash of the XPI file, using sha256 or stronger. [JsonPropertyName("hash")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Hash - { - get - { - InitializeProperty("hash", _hash); - return _hash; - } - set - { - _hash = value; - } - } + public string Hash { get; set; } /// URL pointing to the XPI file on addons.mozilla.org or similar. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpURL Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public HttpURL Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Management/ManagementApi.cs b/src/WebExtensions.Net/Generated/Management/ManagementApi.cs index 695b860..4b41534 100644 --- a/src/WebExtensions.Net/Generated/Management/ManagementApi.cs +++ b/src/WebExtensions.Net/Generated/Management/ManagementApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Threading.Tasks; using WebExtensions.Net.Manifest; @@ -13,8 +14,9 @@ public partial class ManagementApi : BaseApi, IManagementApi private OnUninstalledEvent _onUninstalled; /// Creates a new instance of . - /// Web Extension JS Runtime - public ManagementApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "management") + /// The JS runtime adapter. + /// The base API access path. + public ManagementApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "management")) { } @@ -26,7 +28,7 @@ public OnDisabledEvent OnDisabled if (_onDisabled is null) { _onDisabled = new OnDisabledEvent(); - InitializeProperty("onDisabled", _onDisabled); + _onDisabled.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onDisabled")); } return _onDisabled; } @@ -40,7 +42,7 @@ public OnEnabledEvent OnEnabled if (_onEnabled is null) { _onEnabled = new OnEnabledEvent(); - InitializeProperty("onEnabled", _onEnabled); + _onEnabled.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onEnabled")); } return _onEnabled; } @@ -54,7 +56,7 @@ public OnInstalledEvent OnInstalled if (_onInstalled is null) { _onInstalled = new OnInstalledEvent(); - InitializeProperty("onInstalled", _onInstalled); + _onInstalled.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onInstalled")); } return _onInstalled; } @@ -68,7 +70,7 @@ public OnUninstalledEvent OnUninstalled if (_onUninstalled is null) { _onUninstalled = new OnUninstalledEvent(); - InitializeProperty("onUninstalled", _onUninstalled); + _onUninstalled.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onUninstalled")); } return _onUninstalled; } diff --git a/src/WebExtensions.Net/Generated/Management/OnDisabledEvent.cs b/src/WebExtensions.Net/Generated/Management/OnDisabledEvent.cs index f091b3d..c80d7a4 100644 --- a/src/WebExtensions.Net/Generated/Management/OnDisabledEvent.cs +++ b/src/WebExtensions.Net/Generated/Management/OnDisabledEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Management { // Type Class /// Fired when an addon has been disabled. + [BindAllProperties] public partial class OnDisabledEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Management/OnEnabledEvent.cs b/src/WebExtensions.Net/Generated/Management/OnEnabledEvent.cs index 2bd99c9..bf02fb4 100644 --- a/src/WebExtensions.Net/Generated/Management/OnEnabledEvent.cs +++ b/src/WebExtensions.Net/Generated/Management/OnEnabledEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Management { // Type Class /// Fired when an addon has been enabled. + [BindAllProperties] public partial class OnEnabledEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Management/OnInstalledEvent.cs b/src/WebExtensions.Net/Generated/Management/OnInstalledEvent.cs index e8f2db1..0079268 100644 --- a/src/WebExtensions.Net/Generated/Management/OnInstalledEvent.cs +++ b/src/WebExtensions.Net/Generated/Management/OnInstalledEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Management { // Type Class /// Fired when an addon has been installed. + [BindAllProperties] public partial class OnInstalledEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Management/OnUninstalledEvent.cs b/src/WebExtensions.Net/Generated/Management/OnUninstalledEvent.cs index 3d97159..5f98e93 100644 --- a/src/WebExtensions.Net/Generated/Management/OnUninstalledEvent.cs +++ b/src/WebExtensions.Net/Generated/Management/OnUninstalledEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Management { // Type Class /// Fired when an addon has been uninstalled. + [BindAllProperties] public partial class OnUninstalledEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Management/Result.cs b/src/WebExtensions.Net/Generated/Management/Result.cs index 707b182..90c5f2c 100644 --- a/src/WebExtensions.Net/Generated/Management/Result.cs +++ b/src/WebExtensions.Net/Generated/Management/Result.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Text.Json.Serialization; using WebExtensions.Net.Manifest; @@ -5,24 +6,12 @@ namespace WebExtensions.Net.Management { // Type Class /// + [BindAllProperties] public partial class Result : BaseObject { - private ExtensionID _id; - /// [JsonPropertyName("id")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ExtensionID Id - { - get - { - InitializeProperty("id", _id); - return _id; - } - set - { - _id = value; - } - } + public ExtensionID Id { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Management/UninstallSelfOptions.cs b/src/WebExtensions.Net/Generated/Management/UninstallSelfOptions.cs index b639e1d..307e351 100644 --- a/src/WebExtensions.Net/Generated/Management/UninstallSelfOptions.cs +++ b/src/WebExtensions.Net/Generated/Management/UninstallSelfOptions.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Management { // Type Class /// + [BindAllProperties] public partial class UninstallSelfOptions : BaseObject { - private string _dialogMessage; - private bool? _showConfirmDialog; - /// The message to display to a user when being asked to confirm removal of the extension. [JsonPropertyName("dialogMessage")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DialogMessage - { - get - { - InitializeProperty("dialogMessage", _dialogMessage); - return _dialogMessage; - } - set - { - _dialogMessage = value; - } - } + public string DialogMessage { get; set; } /// Whether or not a confirm-uninstall dialog should prompt the user. Defaults to false. [JsonPropertyName("showConfirmDialog")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? ShowConfirmDialog - { - get - { - InitializeProperty("showConfirmDialog", _showConfirmDialog); - return _showConfirmDialog; - } - set - { - _showConfirmDialog = value; - } - } + public bool? ShowConfirmDialog { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Menus/AddListenerCallbackInfo.cs b/src/WebExtensions.Net/Generated/Menus/AddListenerCallbackInfo.cs index 8f091b8..137bd7f 100644 --- a/src/WebExtensions.Net/Generated/Menus/AddListenerCallbackInfo.cs +++ b/src/WebExtensions.Net/Generated/Menus/AddListenerCallbackInfo.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; using WebExtensions.Net.Extension; @@ -6,210 +7,66 @@ namespace WebExtensions.Net.Menus { // Type Class /// Information about the context of the menu action and the created menu items. For more information about each property, see OnClickData. The following properties are only set if the extension has host permissions for the given context: linkUrl, linkText, srcUrl, pageUrl, frameUrl, selectionText. + [BindAllProperties] public partial class AddListenerCallbackInfo : BaseObject { - private IEnumerable _contexts; - private bool _editable; - private string _frameUrl; - private string _linkText; - private string _linkUrl; - private string _mediaType; - private IEnumerable _menuIds; - private string _pageUrl; - private string _selectionText; - private string _srcUrl; - private int? _targetElementId; - private ViewType? _viewType; - /// A list of all contexts that apply to the menu. [JsonPropertyName("contexts")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Contexts - { - get - { - InitializeProperty("contexts", _contexts); - return _contexts; - } - set - { - _contexts = value; - } - } + public IEnumerable Contexts { get; set; } /// [JsonPropertyName("editable")] - public bool Editable - { - get - { - InitializeProperty("editable", _editable); - return _editable; - } - set - { - _editable = value; - } - } + public bool Editable { get; set; } /// [JsonPropertyName("frameUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string FrameUrl - { - get - { - InitializeProperty("frameUrl", _frameUrl); - return _frameUrl; - } - set - { - _frameUrl = value; - } - } + public string FrameUrl { get; set; } /// [JsonPropertyName("linkText")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string LinkText - { - get - { - InitializeProperty("linkText", _linkText); - return _linkText; - } - set - { - _linkText = value; - } - } + public string LinkText { get; set; } /// [JsonPropertyName("linkUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string LinkUrl - { - get - { - InitializeProperty("linkUrl", _linkUrl); - return _linkUrl; - } - set - { - _linkUrl = value; - } - } + public string LinkUrl { get; set; } /// [JsonPropertyName("mediaType")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string MediaType - { - get - { - InitializeProperty("mediaType", _mediaType); - return _mediaType; - } - set - { - _mediaType = value; - } - } + public string MediaType { get; set; } /// A list of IDs of the menu items that were shown. [JsonPropertyName("menuIds")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable MenuIds - { - get - { - InitializeProperty("menuIds", _menuIds); - return _menuIds; - } - set - { - _menuIds = value; - } - } + public IEnumerable MenuIds { get; set; } /// [JsonPropertyName("pageUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string PageUrl - { - get - { - InitializeProperty("pageUrl", _pageUrl); - return _pageUrl; - } - set - { - _pageUrl = value; - } - } + public string PageUrl { get; set; } /// [JsonPropertyName("selectionText")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string SelectionText - { - get - { - InitializeProperty("selectionText", _selectionText); - return _selectionText; - } - set - { - _selectionText = value; - } - } + public string SelectionText { get; set; } /// [JsonPropertyName("srcUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string SrcUrl - { - get - { - InitializeProperty("srcUrl", _srcUrl); - return _srcUrl; - } - set - { - _srcUrl = value; - } - } + public string SrcUrl { get; set; } /// [JsonPropertyName("targetElementId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? TargetElementId - { - get - { - InitializeProperty("targetElementId", _targetElementId); - return _targetElementId; - } - set - { - _targetElementId = value; - } - } + public int? TargetElementId { get; set; } /// [JsonPropertyName("viewType")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ViewType? ViewType - { - get - { - InitializeProperty("viewType", _viewType); - return _viewType; - } - set - { - _viewType = value; - } - } + public ViewType? ViewType { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Menus/ContextOptions.cs b/src/WebExtensions.Net/Generated/Menus/ContextOptions.cs index 4598807..3b51ad7 100644 --- a/src/WebExtensions.Net/Generated/Menus/ContextOptions.cs +++ b/src/WebExtensions.Net/Generated/Menus/ContextOptions.cs @@ -1,78 +1,31 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Menus { // Type Class /// + [BindAllProperties] public partial class ContextOptions : BaseObject { - private string _bookmarkId; - private string _context; - private bool? _showDefaults; - private int? _tabId; - /// Required when context is 'bookmark'. Requires 'bookmark' permission. [JsonPropertyName("bookmarkId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string BookmarkId - { - get - { - InitializeProperty("bookmarkId", _bookmarkId); - return _bookmarkId; - } - set - { - _bookmarkId = value; - } - } + public string BookmarkId { get; set; } /// ContextType to override, to allow menu items from other extensions in the menu. Currently only 'bookmark' and 'tab' are supported. showDefaults cannot be used with this option. [JsonPropertyName("context")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Context - { - get - { - InitializeProperty("context", _context); - return _context; - } - set - { - _context = value; - } - } + public string Context { get; set; } /// Whether to also include default menu items in the menu. [JsonPropertyName("showDefaults")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? ShowDefaults - { - get - { - InitializeProperty("showDefaults", _showDefaults); - return _showDefaults; - } - set - { - _showDefaults = value; - } - } + public bool? ShowDefaults { get; set; } /// Required when context is 'tab'. Requires 'tabs' permission. [JsonPropertyName("tabId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int? TabId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Menus/CreateProperties.cs b/src/WebExtensions.Net/Generated/Menus/CreateProperties.cs index f692b76..fe48b22 100644 --- a/src/WebExtensions.Net/Generated/Menus/CreateProperties.cs +++ b/src/WebExtensions.Net/Generated/Menus/CreateProperties.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -8,245 +9,77 @@ namespace WebExtensions.Net.Menus { // Type Class /// + [BindAllProperties] public partial class CreateProperties : BaseObject { - private bool? _checked; - private string _command; - private IEnumerable _contexts; - private IEnumerable _documentUrlPatterns; - private bool? _enabled; - private object _icons; - private string _id; - private Action _onclick; - private CreatePropertiesParentId _parentId; - private IEnumerable _targetUrlPatterns; - private string _title; - private ItemType? _type; - private IEnumerable _viewTypes; - private bool? _visible; - /// The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items. [JsonPropertyName("checked")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Checked - { - get - { - InitializeProperty("checked", _checked); - return _checked; - } - set - { - _checked = value; - } - } + public bool? Checked { get; set; } /// Specifies a command to issue for the context click. Currently supports internal commands _execute_page_action, _execute_browser_action and _execute_sidebar_action. [JsonPropertyName("command")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Command - { - get - { - InitializeProperty("command", _command); - return _command; - } - set - { - _command = value; - } - } + public string Command { get; set; } /// List of contexts this menu item will appear in. Defaults to ['page'] if not specified. [JsonPropertyName("contexts")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Contexts - { - get - { - InitializeProperty("contexts", _contexts); - return _contexts; - } - set - { - _contexts = value; - } - } + public IEnumerable Contexts { get; set; } /// Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see $(topic:match_patterns)[Match Patterns]. [JsonPropertyName("documentUrlPatterns")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable DocumentUrlPatterns - { - get - { - InitializeProperty("documentUrlPatterns", _documentUrlPatterns); - return _documentUrlPatterns; - } - set - { - _documentUrlPatterns = value; - } - } + public IEnumerable DocumentUrlPatterns { get; set; } /// Whether this context menu item is enabled or disabled. Defaults to true. [JsonPropertyName("enabled")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Enabled - { - get - { - InitializeProperty("enabled", _enabled); - return _enabled; - } - set - { - _enabled = value; - } - } + public bool? Enabled { get; set; } /// [JsonPropertyName("icons")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public object Icons - { - get - { - InitializeProperty("icons", _icons); - return _icons; - } - set - { - _icons = value; - } - } + public object Icons { get; set; } /// The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension. [JsonPropertyName("id")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Id - { - get - { - InitializeProperty("id", _id); - return _id; - } - set - { - _id = value; - } - } + public string Id { get; set; } /// A function that will be called back when the menu item is clicked. Event pages cannot use this; instead, they should register a listener for $(ref:contextMenus.onClicked). [JsonPropertyName("onclick")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Action Onclick - { - get - { - InitializeProperty("onclick", _onclick); - return _onclick; - } - set - { - _onclick = value; - } - } + public Action Onclick { get; set; } /// The ID of a parent menu item; this makes the item a child of a previously added item. [JsonPropertyName("parentId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public CreatePropertiesParentId ParentId - { - get - { - InitializeProperty("parentId", _parentId); - return _parentId; - } - set - { - _parentId = value; - } - } + public CreatePropertiesParentId ParentId { get; set; } /// Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags. [JsonPropertyName("targetUrlPatterns")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable TargetUrlPatterns - { - get - { - InitializeProperty("targetUrlPatterns", _targetUrlPatterns); - return _targetUrlPatterns; - } - set - { - _targetUrlPatterns = value; - } - } + public IEnumerable TargetUrlPatterns { get; set; } /// The text to be displayed in the item; this is required unless type is 'separator'. When the context is 'selection', you can use %s within the string to show the selected text. For example, if this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", the context menu item for the selection is "Translate 'cool' to Pig Latin". [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// The type of menu item. Defaults to 'normal' if not specified. [JsonPropertyName("type")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ItemType? Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ItemType? Type { get; set; } /// List of view types where the menu item will be shown. Defaults to any view, including those without a viewType. [JsonPropertyName("viewTypes")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable ViewTypes - { - get - { - InitializeProperty("viewTypes", _viewTypes); - return _viewTypes; - } - set - { - _viewTypes = value; - } - } + public IEnumerable ViewTypes { get; set; } /// Whether the item is visible in the menu. [JsonPropertyName("visible")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Visible - { - get - { - InitializeProperty("visible", _visible); - return _visible; - } - set - { - _visible = value; - } - } + public bool? Visible { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Menus/HasListenerCallbackInfo.cs b/src/WebExtensions.Net/Generated/Menus/HasListenerCallbackInfo.cs index 586c295..02b5dfe 100644 --- a/src/WebExtensions.Net/Generated/Menus/HasListenerCallbackInfo.cs +++ b/src/WebExtensions.Net/Generated/Menus/HasListenerCallbackInfo.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; using WebExtensions.Net.Extension; @@ -6,210 +7,66 @@ namespace WebExtensions.Net.Menus { // Type Class /// Information about the context of the menu action and the created menu items. For more information about each property, see OnClickData. The following properties are only set if the extension has host permissions for the given context: linkUrl, linkText, srcUrl, pageUrl, frameUrl, selectionText. + [BindAllProperties] public partial class HasListenerCallbackInfo : BaseObject { - private IEnumerable _contexts; - private bool _editable; - private string _frameUrl; - private string _linkText; - private string _linkUrl; - private string _mediaType; - private IEnumerable _menuIds; - private string _pageUrl; - private string _selectionText; - private string _srcUrl; - private int? _targetElementId; - private ViewType? _viewType; - /// A list of all contexts that apply to the menu. [JsonPropertyName("contexts")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Contexts - { - get - { - InitializeProperty("contexts", _contexts); - return _contexts; - } - set - { - _contexts = value; - } - } + public IEnumerable Contexts { get; set; } /// [JsonPropertyName("editable")] - public bool Editable - { - get - { - InitializeProperty("editable", _editable); - return _editable; - } - set - { - _editable = value; - } - } + public bool Editable { get; set; } /// [JsonPropertyName("frameUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string FrameUrl - { - get - { - InitializeProperty("frameUrl", _frameUrl); - return _frameUrl; - } - set - { - _frameUrl = value; - } - } + public string FrameUrl { get; set; } /// [JsonPropertyName("linkText")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string LinkText - { - get - { - InitializeProperty("linkText", _linkText); - return _linkText; - } - set - { - _linkText = value; - } - } + public string LinkText { get; set; } /// [JsonPropertyName("linkUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string LinkUrl - { - get - { - InitializeProperty("linkUrl", _linkUrl); - return _linkUrl; - } - set - { - _linkUrl = value; - } - } + public string LinkUrl { get; set; } /// [JsonPropertyName("mediaType")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string MediaType - { - get - { - InitializeProperty("mediaType", _mediaType); - return _mediaType; - } - set - { - _mediaType = value; - } - } + public string MediaType { get; set; } /// A list of IDs of the menu items that were shown. [JsonPropertyName("menuIds")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable MenuIds - { - get - { - InitializeProperty("menuIds", _menuIds); - return _menuIds; - } - set - { - _menuIds = value; - } - } + public IEnumerable MenuIds { get; set; } /// [JsonPropertyName("pageUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string PageUrl - { - get - { - InitializeProperty("pageUrl", _pageUrl); - return _pageUrl; - } - set - { - _pageUrl = value; - } - } + public string PageUrl { get; set; } /// [JsonPropertyName("selectionText")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string SelectionText - { - get - { - InitializeProperty("selectionText", _selectionText); - return _selectionText; - } - set - { - _selectionText = value; - } - } + public string SelectionText { get; set; } /// [JsonPropertyName("srcUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string SrcUrl - { - get - { - InitializeProperty("srcUrl", _srcUrl); - return _srcUrl; - } - set - { - _srcUrl = value; - } - } + public string SrcUrl { get; set; } /// [JsonPropertyName("targetElementId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? TargetElementId - { - get - { - InitializeProperty("targetElementId", _targetElementId); - return _targetElementId; - } - set - { - _targetElementId = value; - } - } + public int? TargetElementId { get; set; } /// [JsonPropertyName("viewType")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ViewType? ViewType - { - get - { - InitializeProperty("viewType", _viewType); - return _viewType; - } - set - { - _viewType = value; - } - } + public ViewType? ViewType { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Menus/MenusApi.cs b/src/WebExtensions.Net/Generated/Menus/MenusApi.cs index bb8d946..86e875a 100644 --- a/src/WebExtensions.Net/Generated/Menus/MenusApi.cs +++ b/src/WebExtensions.Net/Generated/Menus/MenusApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Text.Json; using System.Threading.Tasks; @@ -13,8 +14,9 @@ public partial class MenusApi : BaseApi, IMenusApi private OnShownEvent _onShown; /// Creates a new instance of . - /// Web Extension JS Runtime - public MenusApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "menus") + /// The JS runtime adapter. + /// The base API access path. + public MenusApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "menus")) { } @@ -29,7 +31,7 @@ public OnClickedEvent OnClicked if (_onClicked is null) { _onClicked = new OnClickedEvent(); - InitializeProperty("onClicked", _onClicked); + _onClicked.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onClicked")); } return _onClicked; } @@ -43,7 +45,7 @@ public Event OnHidden if (_onHidden is null) { _onHidden = new Event(); - InitializeProperty("onHidden", _onHidden); + _onHidden.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onHidden")); } return _onHidden; } @@ -57,7 +59,7 @@ public OnShownEvent OnShown if (_onShown is null) { _onShown = new OnShownEvent(); - InitializeProperty("onShown", _onShown); + _onShown.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onShown")); } return _onShown; } diff --git a/src/WebExtensions.Net/Generated/Menus/OnClickData.cs b/src/WebExtensions.Net/Generated/Menus/OnClickData.cs index 8036ad8..195abfe 100644 --- a/src/WebExtensions.Net/Generated/Menus/OnClickData.cs +++ b/src/WebExtensions.Net/Generated/Menus/OnClickData.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; using WebExtensions.Net.Extension; @@ -6,312 +7,96 @@ namespace WebExtensions.Net.Menus { // Type Class /// Information sent when a context menu item is clicked. + [BindAllProperties] public partial class OnClickData : BaseObject { - private string _bookmarkId; - private int? _button; - private bool? _checked; - private bool _editable; - private int? _frameId; - private string _frameUrl; - private string _linkText; - private string _linkUrl; - private string _mediaType; - private OnClickDataMenuItemId _menuItemId; - private IEnumerable _modifiers; - private string _pageUrl; - private ParentMenuItemId _parentMenuItemId; - private string _selectionText; - private string _srcUrl; - private int? _targetElementId; - private ViewType? _viewType; - private bool? _wasChecked; - /// The id of the bookmark where the context menu was clicked, if it was on a bookmark. [JsonPropertyName("bookmarkId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string BookmarkId - { - get - { - InitializeProperty("bookmarkId", _bookmarkId); - return _bookmarkId; - } - set - { - _bookmarkId = value; - } - } + public string BookmarkId { get; set; } /// An integer value of button by which menu item was clicked. [JsonPropertyName("button")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Button - { - get - { - InitializeProperty("button", _button); - return _button; - } - set - { - _button = value; - } - } + public int? Button { get; set; } /// A flag indicating the state of a checkbox or radio item after it is clicked. [JsonPropertyName("checked")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Checked - { - get - { - InitializeProperty("checked", _checked); - return _checked; - } - set - { - _checked = value; - } - } + public bool? Checked { get; set; } /// A flag indicating whether the element is editable (text input, textarea, etc.). [JsonPropertyName("editable")] - public bool Editable - { - get - { - InitializeProperty("editable", _editable); - return _editable; - } - set - { - _editable = value; - } - } + public bool Editable { get; set; } /// The id of the frame of the element where the context menu was clicked. [JsonPropertyName("frameId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int? FrameId { get; set; } /// The URL of the frame of the element where the context menu was clicked, if it was in a frame. [JsonPropertyName("frameUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string FrameUrl - { - get - { - InitializeProperty("frameUrl", _frameUrl); - return _frameUrl; - } - set - { - _frameUrl = value; - } - } + public string FrameUrl { get; set; } /// If the element is a link, the text of that link. [JsonPropertyName("linkText")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string LinkText - { - get - { - InitializeProperty("linkText", _linkText); - return _linkText; - } - set - { - _linkText = value; - } - } + public string LinkText { get; set; } /// If the element is a link, the URL it points to. [JsonPropertyName("linkUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string LinkUrl - { - get - { - InitializeProperty("linkUrl", _linkUrl); - return _linkUrl; - } - set - { - _linkUrl = value; - } - } + public string LinkUrl { get; set; } /// One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements. [JsonPropertyName("mediaType")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string MediaType - { - get - { - InitializeProperty("mediaType", _mediaType); - return _mediaType; - } - set - { - _mediaType = value; - } - } + public string MediaType { get; set; } /// The ID of the menu item that was clicked. [JsonPropertyName("menuItemId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public OnClickDataMenuItemId MenuItemId - { - get - { - InitializeProperty("menuItemId", _menuItemId); - return _menuItemId; - } - set - { - _menuItemId = value; - } - } + public OnClickDataMenuItemId MenuItemId { get; set; } /// An array of keyboard modifiers that were held while the menu item was clicked. [JsonPropertyName("modifiers")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Modifiers - { - get - { - InitializeProperty("modifiers", _modifiers); - return _modifiers; - } - set - { - _modifiers = value; - } - } + public IEnumerable Modifiers { get; set; } /// The URL of the page where the menu item was clicked. This property is not set if the click occured in a context where there is no current page, such as in a launcher context menu. [JsonPropertyName("pageUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string PageUrl - { - get - { - InitializeProperty("pageUrl", _pageUrl); - return _pageUrl; - } - set - { - _pageUrl = value; - } - } + public string PageUrl { get; set; } /// The parent ID, if any, for the item clicked. [JsonPropertyName("parentMenuItemId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ParentMenuItemId ParentMenuItemId - { - get - { - InitializeProperty("parentMenuItemId", _parentMenuItemId); - return _parentMenuItemId; - } - set - { - _parentMenuItemId = value; - } - } + public ParentMenuItemId ParentMenuItemId { get; set; } /// The text for the context selection, if any. [JsonPropertyName("selectionText")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string SelectionText - { - get - { - InitializeProperty("selectionText", _selectionText); - return _selectionText; - } - set - { - _selectionText = value; - } - } + public string SelectionText { get; set; } /// Will be present for elements with a 'src' URL. [JsonPropertyName("srcUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string SrcUrl - { - get - { - InitializeProperty("srcUrl", _srcUrl); - return _srcUrl; - } - set - { - _srcUrl = value; - } - } + public string SrcUrl { get; set; } /// An identifier of the clicked element, if any. Use menus.getTargetElement in the page to find the corresponding element. [JsonPropertyName("targetElementId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? TargetElementId - { - get - { - InitializeProperty("targetElementId", _targetElementId); - return _targetElementId; - } - set - { - _targetElementId = value; - } - } + public int? TargetElementId { get; set; } /// The type of view where the menu is clicked. May be unset if the menu is not associated with a view. [JsonPropertyName("viewType")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ViewType? ViewType - { - get - { - InitializeProperty("viewType", _viewType); - return _viewType; - } - set - { - _viewType = value; - } - } + public ViewType? ViewType { get; set; } /// A flag indicating the state of a checkbox or radio item before it was clicked. [JsonPropertyName("wasChecked")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? WasChecked - { - get - { - InitializeProperty("wasChecked", _wasChecked); - return _wasChecked; - } - set - { - _wasChecked = value; - } - } + public bool? WasChecked { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Menus/OnClickedEvent.cs b/src/WebExtensions.Net/Generated/Menus/OnClickedEvent.cs index 5cd3aac..a435ad1 100644 --- a/src/WebExtensions.Net/Generated/Menus/OnClickedEvent.cs +++ b/src/WebExtensions.Net/Generated/Menus/OnClickedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -7,6 +8,7 @@ namespace WebExtensions.Net.Menus { // Type Class /// Fired when a context menu item is clicked. + [BindAllProperties] public partial class OnClickedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Menus/OnShownEvent.cs b/src/WebExtensions.Net/Generated/Menus/OnShownEvent.cs index b0c3eef..0344581 100644 --- a/src/WebExtensions.Net/Generated/Menus/OnShownEvent.cs +++ b/src/WebExtensions.Net/Generated/Menus/OnShownEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -7,6 +8,7 @@ namespace WebExtensions.Net.Menus { // Type Class /// Fired when a menu is shown. The extension can add, modify or remove menu items and call menus.refresh() to update the menu. + [BindAllProperties] public partial class OnShownEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Menus/RemoveListenerCallbackInfo.cs b/src/WebExtensions.Net/Generated/Menus/RemoveListenerCallbackInfo.cs index 12dd004..c4294db 100644 --- a/src/WebExtensions.Net/Generated/Menus/RemoveListenerCallbackInfo.cs +++ b/src/WebExtensions.Net/Generated/Menus/RemoveListenerCallbackInfo.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; using WebExtensions.Net.Extension; @@ -6,210 +7,66 @@ namespace WebExtensions.Net.Menus { // Type Class /// Information about the context of the menu action and the created menu items. For more information about each property, see OnClickData. The following properties are only set if the extension has host permissions for the given context: linkUrl, linkText, srcUrl, pageUrl, frameUrl, selectionText. + [BindAllProperties] public partial class RemoveListenerCallbackInfo : BaseObject { - private IEnumerable _contexts; - private bool _editable; - private string _frameUrl; - private string _linkText; - private string _linkUrl; - private string _mediaType; - private IEnumerable _menuIds; - private string _pageUrl; - private string _selectionText; - private string _srcUrl; - private int? _targetElementId; - private ViewType? _viewType; - /// A list of all contexts that apply to the menu. [JsonPropertyName("contexts")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Contexts - { - get - { - InitializeProperty("contexts", _contexts); - return _contexts; - } - set - { - _contexts = value; - } - } + public IEnumerable Contexts { get; set; } /// [JsonPropertyName("editable")] - public bool Editable - { - get - { - InitializeProperty("editable", _editable); - return _editable; - } - set - { - _editable = value; - } - } + public bool Editable { get; set; } /// [JsonPropertyName("frameUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string FrameUrl - { - get - { - InitializeProperty("frameUrl", _frameUrl); - return _frameUrl; - } - set - { - _frameUrl = value; - } - } + public string FrameUrl { get; set; } /// [JsonPropertyName("linkText")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string LinkText - { - get - { - InitializeProperty("linkText", _linkText); - return _linkText; - } - set - { - _linkText = value; - } - } + public string LinkText { get; set; } /// [JsonPropertyName("linkUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string LinkUrl - { - get - { - InitializeProperty("linkUrl", _linkUrl); - return _linkUrl; - } - set - { - _linkUrl = value; - } - } + public string LinkUrl { get; set; } /// [JsonPropertyName("mediaType")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string MediaType - { - get - { - InitializeProperty("mediaType", _mediaType); - return _mediaType; - } - set - { - _mediaType = value; - } - } + public string MediaType { get; set; } /// A list of IDs of the menu items that were shown. [JsonPropertyName("menuIds")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable MenuIds - { - get - { - InitializeProperty("menuIds", _menuIds); - return _menuIds; - } - set - { - _menuIds = value; - } - } + public IEnumerable MenuIds { get; set; } /// [JsonPropertyName("pageUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string PageUrl - { - get - { - InitializeProperty("pageUrl", _pageUrl); - return _pageUrl; - } - set - { - _pageUrl = value; - } - } + public string PageUrl { get; set; } /// [JsonPropertyName("selectionText")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string SelectionText - { - get - { - InitializeProperty("selectionText", _selectionText); - return _selectionText; - } - set - { - _selectionText = value; - } - } + public string SelectionText { get; set; } /// [JsonPropertyName("srcUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string SrcUrl - { - get - { - InitializeProperty("srcUrl", _srcUrl); - return _srcUrl; - } - set - { - _srcUrl = value; - } - } + public string SrcUrl { get; set; } /// [JsonPropertyName("targetElementId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? TargetElementId - { - get - { - InitializeProperty("targetElementId", _targetElementId); - return _targetElementId; - } - set - { - _targetElementId = value; - } - } + public int? TargetElementId { get; set; } /// [JsonPropertyName("viewType")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ViewType? ViewType - { - get - { - InitializeProperty("viewType", _viewType); - return _viewType; - } - set - { - _viewType = value; - } - } + public ViewType? ViewType { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Menus/UpdateProperties.cs b/src/WebExtensions.Net/Generated/Menus/UpdateProperties.cs index 60e1dd1..f40b2c3 100644 --- a/src/WebExtensions.Net/Generated/Menus/UpdateProperties.cs +++ b/src/WebExtensions.Net/Generated/Menus/UpdateProperties.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -8,211 +9,67 @@ namespace WebExtensions.Net.Menus { // Type Class /// The properties to update. Accepts the same values as the create function. + [BindAllProperties] public partial class UpdateProperties : BaseObject { - private bool? _checked; - private IEnumerable _contexts; - private IEnumerable _documentUrlPatterns; - private bool? _enabled; - private object _icons; - private Action _onclick; - private UpdatePropertiesParentId _parentId; - private IEnumerable _targetUrlPatterns; - private string _title; - private ItemType? _type; - private IEnumerable _viewTypes; - private bool? _visible; - /// [JsonPropertyName("checked")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Checked - { - get - { - InitializeProperty("checked", _checked); - return _checked; - } - set - { - _checked = value; - } - } + public bool? Checked { get; set; } /// [JsonPropertyName("contexts")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Contexts - { - get - { - InitializeProperty("contexts", _contexts); - return _contexts; - } - set - { - _contexts = value; - } - } + public IEnumerable Contexts { get; set; } /// [JsonPropertyName("documentUrlPatterns")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable DocumentUrlPatterns - { - get - { - InitializeProperty("documentUrlPatterns", _documentUrlPatterns); - return _documentUrlPatterns; - } - set - { - _documentUrlPatterns = value; - } - } + public IEnumerable DocumentUrlPatterns { get; set; } /// [JsonPropertyName("enabled")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Enabled - { - get - { - InitializeProperty("enabled", _enabled); - return _enabled; - } - set - { - _enabled = value; - } - } + public bool? Enabled { get; set; } /// [JsonPropertyName("icons")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public object Icons - { - get - { - InitializeProperty("icons", _icons); - return _icons; - } - set - { - _icons = value; - } - } + public object Icons { get; set; } /// [JsonPropertyName("onclick")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Action Onclick - { - get - { - InitializeProperty("onclick", _onclick); - return _onclick; - } - set - { - _onclick = value; - } - } + public Action Onclick { get; set; } /// Note: You cannot change an item to be a child of one of its own descendants. [JsonPropertyName("parentId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UpdatePropertiesParentId ParentId - { - get - { - InitializeProperty("parentId", _parentId); - return _parentId; - } - set - { - _parentId = value; - } - } + public UpdatePropertiesParentId ParentId { get; set; } /// [JsonPropertyName("targetUrlPatterns")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable TargetUrlPatterns - { - get - { - InitializeProperty("targetUrlPatterns", _targetUrlPatterns); - return _targetUrlPatterns; - } - set - { - _targetUrlPatterns = value; - } - } + public IEnumerable TargetUrlPatterns { get; set; } /// [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// [JsonPropertyName("type")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ItemType? Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ItemType? Type { get; set; } /// [JsonPropertyName("viewTypes")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable ViewTypes - { - get - { - InitializeProperty("viewTypes", _viewTypes); - return _viewTypes; - } - set - { - _viewTypes = value; - } - } + public IEnumerable ViewTypes { get; set; } /// Whether the item is visible in the menu. [JsonPropertyName("visible")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Visible - { - get - { - InitializeProperty("visible", _visible); - return _visible; - } - set - { - _visible = value; - } - } + public bool? Visible { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Notifications/CreateNotificationOptions.cs b/src/WebExtensions.Net/Generated/Notifications/CreateNotificationOptions.cs index c8d04ad..ece57dd 100644 --- a/src/WebExtensions.Net/Generated/Notifications/CreateNotificationOptions.cs +++ b/src/WebExtensions.Net/Generated/Notifications/CreateNotificationOptions.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,210 +6,66 @@ namespace WebExtensions.Net.Notifications { // Type Class /// + [BindAllProperties] public partial class CreateNotificationOptions : BaseObject { - private string _appIconMaskUrl; - private string _contextMessage; - private EpochTime? _eventTime; - private string _iconUrl; - private string _imageUrl; - private bool? _isClickable; - private IEnumerable _items; - private string _message; - private int? _priority; - private int? _progress; - private string _title; - private TemplateType _type; - /// A URL to the app icon mask. [JsonPropertyName("appIconMaskUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string AppIconMaskUrl - { - get - { - InitializeProperty("appIconMaskUrl", _appIconMaskUrl); - return _appIconMaskUrl; - } - set - { - _appIconMaskUrl = value; - } - } + public string AppIconMaskUrl { get; set; } /// Alternate notification content with a lower-weight font. [JsonPropertyName("contextMessage")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string ContextMessage - { - get - { - InitializeProperty("contextMessage", _contextMessage); - return _contextMessage; - } - set - { - _contextMessage = value; - } - } + public string ContextMessage { get; set; } /// A timestamp associated with the notification, in milliseconds past the epoch. [JsonPropertyName("eventTime")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public EpochTime? EventTime - { - get - { - InitializeProperty("eventTime", _eventTime); - return _eventTime; - } - set - { - _eventTime = value; - } - } + public EpochTime? EventTime { get; set; } /// A URL to the sender's avatar, app icon, or a thumbnail for image notifications. [JsonPropertyName("iconUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string IconUrl - { - get - { - InitializeProperty("iconUrl", _iconUrl); - return _iconUrl; - } - set - { - _iconUrl = value; - } - } + public string IconUrl { get; set; } /// A URL to the image thumbnail for image-type notifications. [JsonPropertyName("imageUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string ImageUrl - { - get - { - InitializeProperty("imageUrl", _imageUrl); - return _imageUrl; - } - set - { - _imageUrl = value; - } - } + public string ImageUrl { get; set; } /// Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification. [JsonPropertyName("isClickable")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? IsClickable - { - get - { - InitializeProperty("isClickable", _isClickable); - return _isClickable; - } - set - { - _isClickable = value; - } - } + public bool? IsClickable { get; set; } /// Items for multi-item notifications. [JsonPropertyName("items")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Items - { - get - { - InitializeProperty("items", _items); - return _items; - } - set - { - _items = value; - } - } + public IEnumerable Items { get; set; } /// Main notification content. [JsonPropertyName("message")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Message - { - get - { - InitializeProperty("message", _message); - return _message; - } - set - { - _message = value; - } - } + public string Message { get; set; } /// Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default. [JsonPropertyName("priority")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Priority - { - get - { - InitializeProperty("priority", _priority); - return _priority; - } - set - { - _priority = value; - } - } + public int? Priority { get; set; } /// Current progress ranges from 0 to 100. [JsonPropertyName("progress")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Progress - { - get - { - InitializeProperty("progress", _progress); - return _progress; - } - set - { - _progress = value; - } - } + public int? Progress { get; set; } /// Title of the notification (e.g. sender name for email). [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// Which type of notification to display. [JsonPropertyName("type")] - public TemplateType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public TemplateType Type { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Notifications/NotificationItem.cs b/src/WebExtensions.Net/Generated/Notifications/NotificationItem.cs index 6827821..eaa63f0 100644 --- a/src/WebExtensions.Net/Generated/Notifications/NotificationItem.cs +++ b/src/WebExtensions.Net/Generated/Notifications/NotificationItem.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Notifications { // Type Class /// + [BindAllProperties] public partial class NotificationItem : BaseObject { - private string _message; - private string _title; - /// Additional details about this item. [JsonPropertyName("message")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Message - { - get - { - InitializeProperty("message", _message); - return _message; - } - set - { - _message = value; - } - } + public string Message { get; set; } /// Title of one item of a list notification. [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Notifications/NotificationsApi.cs b/src/WebExtensions.Net/Generated/Notifications/NotificationsApi.cs index 618aa2d..4a826af 100644 --- a/src/WebExtensions.Net/Generated/Notifications/NotificationsApi.cs +++ b/src/WebExtensions.Net/Generated/Notifications/NotificationsApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Text.Json; using System.Threading.Tasks; @@ -12,8 +13,9 @@ public partial class NotificationsApi : BaseApi, INotificationsApi private OnShownEvent _onShown; /// Creates a new instance of . - /// Web Extension JS Runtime - public NotificationsApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "notifications") + /// The JS runtime adapter. + /// The base API access path. + public NotificationsApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "notifications")) { } @@ -25,7 +27,7 @@ public OnButtonClickedEvent OnButtonClicked if (_onButtonClicked is null) { _onButtonClicked = new OnButtonClickedEvent(); - InitializeProperty("onButtonClicked", _onButtonClicked); + _onButtonClicked.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onButtonClicked")); } return _onButtonClicked; } @@ -39,7 +41,7 @@ public OnClickedEvent OnClicked if (_onClicked is null) { _onClicked = new OnClickedEvent(); - InitializeProperty("onClicked", _onClicked); + _onClicked.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onClicked")); } return _onClicked; } @@ -53,7 +55,7 @@ public OnClosedEvent OnClosed if (_onClosed is null) { _onClosed = new OnClosedEvent(); - InitializeProperty("onClosed", _onClosed); + _onClosed.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onClosed")); } return _onClosed; } @@ -67,7 +69,7 @@ public OnShownEvent OnShown if (_onShown is null) { _onShown = new OnShownEvent(); - InitializeProperty("onShown", _onShown); + _onShown.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onShown")); } return _onShown; } diff --git a/src/WebExtensions.Net/Generated/Notifications/OnButtonClickedEvent.cs b/src/WebExtensions.Net/Generated/Notifications/OnButtonClickedEvent.cs index 1840b7d..d988fe9 100644 --- a/src/WebExtensions.Net/Generated/Notifications/OnButtonClickedEvent.cs +++ b/src/WebExtensions.Net/Generated/Notifications/OnButtonClickedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Notifications { // Type Class /// Fired when the user pressed a button in the notification. + [BindAllProperties] public partial class OnButtonClickedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Notifications/OnClickedEvent.cs b/src/WebExtensions.Net/Generated/Notifications/OnClickedEvent.cs index 18d70ea..4ecbafc 100644 --- a/src/WebExtensions.Net/Generated/Notifications/OnClickedEvent.cs +++ b/src/WebExtensions.Net/Generated/Notifications/OnClickedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Notifications { // Type Class /// Fired when the user clicked in a non-button area of the notification. + [BindAllProperties] public partial class OnClickedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Notifications/OnClosedEvent.cs b/src/WebExtensions.Net/Generated/Notifications/OnClosedEvent.cs index 146a2b7..50685ae 100644 --- a/src/WebExtensions.Net/Generated/Notifications/OnClosedEvent.cs +++ b/src/WebExtensions.Net/Generated/Notifications/OnClosedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Notifications { // Type Class /// Fired when the notification closed, either by the system or by user action. + [BindAllProperties] public partial class OnClosedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Notifications/OnShownEvent.cs b/src/WebExtensions.Net/Generated/Notifications/OnShownEvent.cs index 2f80480..35587e6 100644 --- a/src/WebExtensions.Net/Generated/Notifications/OnShownEvent.cs +++ b/src/WebExtensions.Net/Generated/Notifications/OnShownEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Notifications { // Type Class /// Fired when the notification is shown. + [BindAllProperties] public partial class OnShownEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Omnibox/DefaultSuggestResult.cs b/src/WebExtensions.Net/Generated/Omnibox/DefaultSuggestResult.cs index 6d18833..0912489 100644 --- a/src/WebExtensions.Net/Generated/Omnibox/DefaultSuggestResult.cs +++ b/src/WebExtensions.Net/Generated/Omnibox/DefaultSuggestResult.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Omnibox { // Type Class /// A suggest result. + [BindAllProperties] public partial class DefaultSuggestResult : BaseObject { - private string _description; - /// The text that is displayed in the URL dropdown. [JsonPropertyName("description")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Description - { - get - { - InitializeProperty("description", _description); - return _description; - } - set - { - _description = value; - } - } + public string Description { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Omnibox/OmniboxApi.cs b/src/WebExtensions.Net/Generated/Omnibox/OmniboxApi.cs index ce0746b..a28f83e 100644 --- a/src/WebExtensions.Net/Generated/Omnibox/OmniboxApi.cs +++ b/src/WebExtensions.Net/Generated/Omnibox/OmniboxApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -12,8 +13,9 @@ public partial class OmniboxApi : BaseApi, IOmniboxApi private Event _onInputStarted; /// Creates a new instance of . - /// Web Extension JS Runtime - public OmniboxApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "omnibox") + /// The JS runtime adapter. + /// The base API access path. + public OmniboxApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "omnibox")) { } @@ -25,7 +27,7 @@ public Event OnInputCancelled if (_onInputCancelled is null) { _onInputCancelled = new Event(); - InitializeProperty("onInputCancelled", _onInputCancelled); + _onInputCancelled.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onInputCancelled")); } return _onInputCancelled; } @@ -39,7 +41,7 @@ public OnInputChangedEvent OnInputChanged if (_onInputChanged is null) { _onInputChanged = new OnInputChangedEvent(); - InitializeProperty("onInputChanged", _onInputChanged); + _onInputChanged.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onInputChanged")); } return _onInputChanged; } @@ -53,7 +55,7 @@ public OnInputEnteredEvent OnInputEntered if (_onInputEntered is null) { _onInputEntered = new OnInputEnteredEvent(); - InitializeProperty("onInputEntered", _onInputEntered); + _onInputEntered.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onInputEntered")); } return _onInputEntered; } @@ -67,7 +69,7 @@ public Event OnInputStarted if (_onInputStarted is null) { _onInputStarted = new Event(); - InitializeProperty("onInputStarted", _onInputStarted); + _onInputStarted.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onInputStarted")); } return _onInputStarted; } diff --git a/src/WebExtensions.Net/Generated/Omnibox/OnInputChangedEvent.cs b/src/WebExtensions.Net/Generated/Omnibox/OnInputChangedEvent.cs index 1ec73b2..7e84538 100644 --- a/src/WebExtensions.Net/Generated/Omnibox/OnInputChangedEvent.cs +++ b/src/WebExtensions.Net/Generated/Omnibox/OnInputChangedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -7,6 +8,7 @@ namespace WebExtensions.Net.Omnibox { // Type Class /// User has changed what is typed into the omnibox. + [BindAllProperties] public partial class OnInputChangedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Omnibox/OnInputEnteredEvent.cs b/src/WebExtensions.Net/Generated/Omnibox/OnInputEnteredEvent.cs index ac11b73..b10c298 100644 --- a/src/WebExtensions.Net/Generated/Omnibox/OnInputEnteredEvent.cs +++ b/src/WebExtensions.Net/Generated/Omnibox/OnInputEnteredEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Omnibox { // Type Class /// User has accepted what is typed into the omnibox. + [BindAllProperties] public partial class OnInputEnteredEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Omnibox/SuggestResult.cs b/src/WebExtensions.Net/Generated/Omnibox/SuggestResult.cs index 0593b30..8c02aba 100644 --- a/src/WebExtensions.Net/Generated/Omnibox/SuggestResult.cs +++ b/src/WebExtensions.Net/Generated/Omnibox/SuggestResult.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Omnibox { // Type Class /// A suggest result. + [BindAllProperties] public partial class SuggestResult : BaseObject { - private string _content; - private string _description; - /// The text that is put into the URL bar, and that is sent to the extension when the user chooses this entry. [JsonPropertyName("content")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Content - { - get - { - InitializeProperty("content", _content); - return _content; - } - set - { - _content = value; - } - } + public string Content { get; set; } /// The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. 'dim''match'dimmed match'/match''/dim'. You must escape the five predefined entities to display them as text: stackoverflow.com/a/1091953/89484 [JsonPropertyName("description")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Description - { - get - { - InitializeProperty("description", _description); - return _description; - } - set - { - _description = value; - } - } + public string Description { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/PageAction/GetPopupDetails.cs b/src/WebExtensions.Net/Generated/PageAction/GetPopupDetails.cs index 9f92e8f..70d6ff3 100644 --- a/src/WebExtensions.Net/Generated/PageAction/GetPopupDetails.cs +++ b/src/WebExtensions.Net/Generated/PageAction/GetPopupDetails.cs @@ -1,26 +1,15 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.PageAction { // Type Class /// + [BindAllProperties] public partial class GetPopupDetails : BaseObject { - private int _tabId; - /// Specify the tab to get the popup from. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/PageAction/GetTitleDetails.cs b/src/WebExtensions.Net/Generated/PageAction/GetTitleDetails.cs index aec05cc..83f9797 100644 --- a/src/WebExtensions.Net/Generated/PageAction/GetTitleDetails.cs +++ b/src/WebExtensions.Net/Generated/PageAction/GetTitleDetails.cs @@ -1,26 +1,15 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.PageAction { // Type Class /// + [BindAllProperties] public partial class GetTitleDetails : BaseObject { - private int _tabId; - /// Specify the tab to get the title from. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/PageAction/ImageDataType.cs b/src/WebExtensions.Net/Generated/PageAction/ImageDataType.cs index ab260b5..d25ba46 100644 --- a/src/WebExtensions.Net/Generated/PageAction/ImageDataType.cs +++ b/src/WebExtensions.Net/Generated/PageAction/ImageDataType.cs @@ -1,7 +1,10 @@ +using JsBind.Net; + namespace WebExtensions.Net.PageAction { // Type Class /// Pixel data for an image. Must be an ImageData object (for example, from a canvas element). + [BindAllProperties] public partial class ImageDataType : BaseObject { } diff --git a/src/WebExtensions.Net/Generated/PageAction/IsShownDetails.cs b/src/WebExtensions.Net/Generated/PageAction/IsShownDetails.cs index 352d507..a60c309 100644 --- a/src/WebExtensions.Net/Generated/PageAction/IsShownDetails.cs +++ b/src/WebExtensions.Net/Generated/PageAction/IsShownDetails.cs @@ -1,26 +1,15 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.PageAction { // Type Class /// + [BindAllProperties] public partial class IsShownDetails : BaseObject { - private int _tabId; - /// Specify the tab to get the shownness from. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/PageAction/OnClickData.cs b/src/WebExtensions.Net/Generated/PageAction/OnClickData.cs index 403ac2b..ff22704 100644 --- a/src/WebExtensions.Net/Generated/PageAction/OnClickData.cs +++ b/src/WebExtensions.Net/Generated/PageAction/OnClickData.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,41 +6,17 @@ namespace WebExtensions.Net.PageAction { // Type Class /// Information sent when a page action is clicked. + [BindAllProperties] public partial class OnClickData : BaseObject { - private int? _button; - private IEnumerable _modifiers; - /// An integer value of button by which menu item was clicked. [JsonPropertyName("button")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Button - { - get - { - InitializeProperty("button", _button); - return _button; - } - set - { - _button = value; - } - } + public int? Button { get; set; } /// An array of keyboard modifiers that were held while the menu item was clicked. [JsonPropertyName("modifiers")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Modifiers - { - get - { - InitializeProperty("modifiers", _modifiers); - return _modifiers; - } - set - { - _modifiers = value; - } - } + public IEnumerable Modifiers { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/PageAction/OnClickedEvent.cs b/src/WebExtensions.Net/Generated/PageAction/OnClickedEvent.cs index 307e2e4..c8e4a8b 100644 --- a/src/WebExtensions.Net/Generated/PageAction/OnClickedEvent.cs +++ b/src/WebExtensions.Net/Generated/PageAction/OnClickedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -7,6 +8,7 @@ namespace WebExtensions.Net.PageAction { // Type Class /// Fired when a page action icon is clicked. This event will not fire if the page action has a popup. + [BindAllProperties] public partial class OnClickedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/PageAction/PageActionApi.cs b/src/WebExtensions.Net/Generated/PageAction/PageActionApi.cs index 0ee5c7a..95db2f3 100644 --- a/src/WebExtensions.Net/Generated/PageAction/PageActionApi.cs +++ b/src/WebExtensions.Net/Generated/PageAction/PageActionApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Threading.Tasks; namespace WebExtensions.Net.PageAction @@ -8,8 +9,9 @@ public partial class PageActionApi : BaseApi, IPageActionApi private OnClickedEvent _onClicked; /// Creates a new instance of . - /// Web Extension JS Runtime - public PageActionApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "pageAction") + /// The JS runtime adapter. + /// The base API access path. + public PageActionApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "pageAction")) { } @@ -21,7 +23,7 @@ public OnClickedEvent OnClicked if (_onClicked is null) { _onClicked = new OnClickedEvent(); - InitializeProperty("onClicked", _onClicked); + _onClicked.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onClicked")); } return _onClicked; } diff --git a/src/WebExtensions.Net/Generated/PageAction/SetIconDetails.cs b/src/WebExtensions.Net/Generated/PageAction/SetIconDetails.cs index 63cbc11..40b0a23 100644 --- a/src/WebExtensions.Net/Generated/PageAction/SetIconDetails.cs +++ b/src/WebExtensions.Net/Generated/PageAction/SetIconDetails.cs @@ -1,60 +1,25 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.PageAction { // Type Class /// + [BindAllProperties] public partial class SetIconDetails : BaseObject { - private ImageData _imageData; - private Path _path; - private int _tabId; - /// Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}' [JsonPropertyName("imageData")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ImageData ImageData - { - get - { - InitializeProperty("imageData", _imageData); - return _imageData; - } - set - { - _imageData = value; - } - } + public ImageData ImageData { get; set; } /// Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}' [JsonPropertyName("path")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Path Path - { - get - { - InitializeProperty("path", _path); - return _path; - } - set - { - _path = value; - } - } + public Path Path { get; set; } /// The id of the tab for which you want to modify the page action. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/PageAction/SetPopupDetails.cs b/src/WebExtensions.Net/Generated/PageAction/SetPopupDetails.cs index e63645a..6bac4ae 100644 --- a/src/WebExtensions.Net/Generated/PageAction/SetPopupDetails.cs +++ b/src/WebExtensions.Net/Generated/PageAction/SetPopupDetails.cs @@ -1,43 +1,20 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.PageAction { // Type Class /// + [BindAllProperties] public partial class SetPopupDetails : BaseObject { - private Popup _popup; - private int _tabId; - /// The html file to show in a popup. If set to the empty string (''), no popup is shown. [JsonPropertyName("popup")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Popup Popup - { - get - { - InitializeProperty("popup", _popup); - return _popup; - } - set - { - _popup = value; - } - } + public Popup Popup { get; set; } /// The id of the tab for which you want to modify the page action. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/PageAction/SetTitleDetails.cs b/src/WebExtensions.Net/Generated/PageAction/SetTitleDetails.cs index c279cc3..d4b6bf3 100644 --- a/src/WebExtensions.Net/Generated/PageAction/SetTitleDetails.cs +++ b/src/WebExtensions.Net/Generated/PageAction/SetTitleDetails.cs @@ -1,43 +1,20 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.PageAction { // Type Class /// + [BindAllProperties] public partial class SetTitleDetails : BaseObject { - private int _tabId; - private Title _title; - /// The id of the tab for which you want to modify the page action. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The tooltip string. [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Title Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public Title Title { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Permissions/AnyPermissions.cs b/src/WebExtensions.Net/Generated/Permissions/AnyPermissions.cs index e6ef11d..5331a60 100644 --- a/src/WebExtensions.Net/Generated/Permissions/AnyPermissions.cs +++ b/src/WebExtensions.Net/Generated/Permissions/AnyPermissions.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; using WebExtensions.Net.Manifest; @@ -6,41 +7,17 @@ namespace WebExtensions.Net.Permissions { // Type Class /// + [BindAllProperties] public partial class AnyPermissions : BaseObject { - private IEnumerable _origins; - private IEnumerable _permissions; - /// [JsonPropertyName("origins")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Origins - { - get - { - InitializeProperty("origins", _origins); - return _origins; - } - set - { - _origins = value; - } - } + public IEnumerable Origins { get; set; } /// [JsonPropertyName("permissions")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Permissions - { - get - { - InitializeProperty("permissions", _permissions); - return _permissions; - } - set - { - _permissions = value; - } - } + public IEnumerable Permissions { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Permissions/OnAddedEvent.cs b/src/WebExtensions.Net/Generated/Permissions/OnAddedEvent.cs index cfece7e..54f6e85 100644 --- a/src/WebExtensions.Net/Generated/Permissions/OnAddedEvent.cs +++ b/src/WebExtensions.Net/Generated/Permissions/OnAddedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Permissions { // Type Class /// Fired when the extension acquires new permissions. + [BindAllProperties] public partial class OnAddedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Permissions/OnRemovedEvent.cs b/src/WebExtensions.Net/Generated/Permissions/OnRemovedEvent.cs index 244cb6b..33b1980 100644 --- a/src/WebExtensions.Net/Generated/Permissions/OnRemovedEvent.cs +++ b/src/WebExtensions.Net/Generated/Permissions/OnRemovedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Permissions { // Type Class /// Fired when permissions are removed from the extension. + [BindAllProperties] public partial class OnRemovedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Permissions/PermissionsApi.cs b/src/WebExtensions.Net/Generated/Permissions/PermissionsApi.cs index 14a38b6..d372111 100644 --- a/src/WebExtensions.Net/Generated/Permissions/PermissionsApi.cs +++ b/src/WebExtensions.Net/Generated/Permissions/PermissionsApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Threading.Tasks; namespace WebExtensions.Net.Permissions @@ -9,8 +10,9 @@ public partial class PermissionsApi : BaseApi, IPermissionsApi private OnRemovedEvent _onRemoved; /// Creates a new instance of . - /// Web Extension JS Runtime - public PermissionsApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "permissions") + /// The JS runtime adapter. + /// The base API access path. + public PermissionsApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "permissions")) { } @@ -22,7 +24,7 @@ public OnAddedEvent OnAdded if (_onAdded is null) { _onAdded = new OnAddedEvent(); - InitializeProperty("onAdded", _onAdded); + _onAdded.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onAdded")); } return _onAdded; } @@ -36,7 +38,7 @@ public OnRemovedEvent OnRemoved if (_onRemoved is null) { _onRemoved = new OnRemovedEvent(); - InitializeProperty("onRemoved", _onRemoved); + _onRemoved.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onRemoved")); } return _onRemoved; } diff --git a/src/WebExtensions.Net/Generated/Permissions/PermissionsType.cs b/src/WebExtensions.Net/Generated/Permissions/PermissionsType.cs index 7cf5842..c462654 100644 --- a/src/WebExtensions.Net/Generated/Permissions/PermissionsType.cs +++ b/src/WebExtensions.Net/Generated/Permissions/PermissionsType.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; using WebExtensions.Net.Manifest; @@ -6,41 +7,17 @@ namespace WebExtensions.Net.Permissions { // Type Class /// + [BindAllProperties] public partial class PermissionsType : BaseObject { - private IEnumerable _origins; - private IEnumerable _permissions; - /// [JsonPropertyName("origins")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Origins - { - get - { - InitializeProperty("origins", _origins); - return _origins; - } - set - { - _origins = value; - } - } + public IEnumerable Origins { get; set; } /// [JsonPropertyName("permissions")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Permissions - { - get - { - InitializeProperty("permissions", _permissions); - return _permissions; - } - set - { - _permissions = value; - } - } + public IEnumerable Permissions { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Privacy/Network/NetworkApi.cs b/src/WebExtensions.Net/Generated/Privacy/Network/NetworkApi.cs index d2a34a6..6945756 100644 --- a/src/WebExtensions.Net/Generated/Privacy/Network/NetworkApi.cs +++ b/src/WebExtensions.Net/Generated/Privacy/Network/NetworkApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Threading.Tasks; using WebExtensions.Net.Types; @@ -7,8 +8,9 @@ namespace WebExtensions.Net.Privacy.Network public partial class NetworkApi : BaseApi, INetworkApi { /// Creates a new instance of . - /// Web Extension JS Runtime - public NetworkApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "privacy.network") + /// The JS runtime adapter. + /// The base API access path. + public NetworkApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "network")) { } diff --git a/src/WebExtensions.Net/Generated/Privacy/PrivacyApi.cs b/src/WebExtensions.Net/Generated/Privacy/PrivacyApi.cs index f133990..85e36c5 100644 --- a/src/WebExtensions.Net/Generated/Privacy/PrivacyApi.cs +++ b/src/WebExtensions.Net/Generated/Privacy/PrivacyApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using WebExtensions.Net.Privacy.Network; using WebExtensions.Net.Privacy.Services; using WebExtensions.Net.Privacy.Websites; @@ -12,8 +13,9 @@ public partial class PrivacyApi : BaseApi, IPrivacyApi private IWebsitesApi _websites; /// Creates a new instance of . - /// Web Extension JS Runtime - public PrivacyApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "privacy") + /// The JS runtime adapter. + /// The base API access path. + public PrivacyApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "privacy")) { } @@ -24,7 +26,7 @@ public INetworkApi Network { if (_network is null) { - _network = new NetworkApi(webExtensionsJSRuntime); + _network = new NetworkApi(JsRuntime, AccessPath); } return _network; } @@ -37,7 +39,7 @@ public IServicesApi Services { if (_services is null) { - _services = new ServicesApi(webExtensionsJSRuntime); + _services = new ServicesApi(JsRuntime, AccessPath); } return _services; } @@ -50,7 +52,7 @@ public IWebsitesApi Websites { if (_websites is null) { - _websites = new WebsitesApi(webExtensionsJSRuntime); + _websites = new WebsitesApi(JsRuntime, AccessPath); } return _websites; } diff --git a/src/WebExtensions.Net/Generated/Privacy/Services/ServicesApi.cs b/src/WebExtensions.Net/Generated/Privacy/Services/ServicesApi.cs index c625d5a..d200448 100644 --- a/src/WebExtensions.Net/Generated/Privacy/Services/ServicesApi.cs +++ b/src/WebExtensions.Net/Generated/Privacy/Services/ServicesApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Threading.Tasks; using WebExtensions.Net.Types; @@ -7,8 +8,9 @@ namespace WebExtensions.Net.Privacy.Services public partial class ServicesApi : BaseApi, IServicesApi { /// Creates a new instance of . - /// Web Extension JS Runtime - public ServicesApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "privacy.services") + /// The JS runtime adapter. + /// The base API access path. + public ServicesApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "services")) { } diff --git a/src/WebExtensions.Net/Generated/Privacy/Websites/WebsitesApi.cs b/src/WebExtensions.Net/Generated/Privacy/Websites/WebsitesApi.cs index 1b5d7b0..42f86c2 100644 --- a/src/WebExtensions.Net/Generated/Privacy/Websites/WebsitesApi.cs +++ b/src/WebExtensions.Net/Generated/Privacy/Websites/WebsitesApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Threading.Tasks; using WebExtensions.Net.Types; @@ -7,8 +8,9 @@ namespace WebExtensions.Net.Privacy.Websites public partial class WebsitesApi : BaseApi, IWebsitesApi { /// Creates a new instance of . - /// Web Extension JS Runtime - public WebsitesApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "privacy.websites") + /// The JS runtime adapter. + /// The base API access path. + public WebsitesApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "websites")) { } diff --git a/src/WebExtensions.Net/Generated/Proxy/AddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/Proxy/AddListenerCallbackDetails.cs index cd7d81a..8e8327a 100644 --- a/src/WebExtensions.Net/Generated/Proxy/AddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/Proxy/AddListenerCallbackDetails.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Text.Json.Serialization; using WebExtensions.Net.WebRequest; @@ -5,272 +6,80 @@ namespace WebExtensions.Net.Proxy { // Type Class /// + [BindAllProperties] public partial class AddListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool _fromCache; - private bool? _incognito; - private string _method; - private string _originUrl; - private int _parentFrameId; - private HttpHeaders _requestHeaders; - private string _requestId; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// Indicates if this response was fetched from disk cache. [JsonPropertyName("fromCache")] - public bool FromCache - { - get - { - InitializeProperty("fromCache", _fromCache); - return _fromCache; - } - set - { - _fromCache = value; - } - } + public bool FromCache { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The HTTP request headers that are going to be sent out with this request. [JsonPropertyName("requestHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders RequestHeaders - { - get - { - InitializeProperty("requestHeaders", _requestHeaders); - return _requestHeaders; - } - set - { - _requestHeaders = value; - } - } + public HttpHeaders RequestHeaders { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Url classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Proxy/HasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/Proxy/HasListenerCallbackDetails.cs index 2ddae50..3e22507 100644 --- a/src/WebExtensions.Net/Generated/Proxy/HasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/Proxy/HasListenerCallbackDetails.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Text.Json.Serialization; using WebExtensions.Net.WebRequest; @@ -5,272 +6,80 @@ namespace WebExtensions.Net.Proxy { // Type Class /// + [BindAllProperties] public partial class HasListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool _fromCache; - private bool? _incognito; - private string _method; - private string _originUrl; - private int _parentFrameId; - private HttpHeaders _requestHeaders; - private string _requestId; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// Indicates if this response was fetched from disk cache. [JsonPropertyName("fromCache")] - public bool FromCache - { - get - { - InitializeProperty("fromCache", _fromCache); - return _fromCache; - } - set - { - _fromCache = value; - } - } + public bool FromCache { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The HTTP request headers that are going to be sent out with this request. [JsonPropertyName("requestHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders RequestHeaders - { - get - { - InitializeProperty("requestHeaders", _requestHeaders); - return _requestHeaders; - } - set - { - _requestHeaders = value; - } - } + public HttpHeaders RequestHeaders { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Url classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Proxy/OnErrorEvent.cs b/src/WebExtensions.Net/Generated/Proxy/OnErrorEvent.cs index 52c79ef..0c297ef 100644 --- a/src/WebExtensions.Net/Generated/Proxy/OnErrorEvent.cs +++ b/src/WebExtensions.Net/Generated/Proxy/OnErrorEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Proxy { // Type Class /// Notifies about errors caused by the invalid use of the proxy API. + [BindAllProperties] public partial class OnErrorEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Proxy/OnRequestEvent.cs b/src/WebExtensions.Net/Generated/Proxy/OnRequestEvent.cs index c655f0b..1decbab 100644 --- a/src/WebExtensions.Net/Generated/Proxy/OnRequestEvent.cs +++ b/src/WebExtensions.Net/Generated/Proxy/OnRequestEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -8,6 +9,7 @@ namespace WebExtensions.Net.Proxy { // Type Class /// Fired when proxy data is needed for a request. + [BindAllProperties] public partial class OnRequestEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Proxy/ProxyApi.cs b/src/WebExtensions.Net/Generated/Proxy/ProxyApi.cs index 8444447..3eea540 100644 --- a/src/WebExtensions.Net/Generated/Proxy/ProxyApi.cs +++ b/src/WebExtensions.Net/Generated/Proxy/ProxyApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Threading.Tasks; using WebExtensions.Net.Types; @@ -10,8 +11,9 @@ public partial class ProxyApi : BaseApi, IProxyApi private OnRequestEvent _onRequest; /// Creates a new instance of . - /// Web Extension JS Runtime - public ProxyApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "proxy") + /// The JS runtime adapter. + /// The base API access path. + public ProxyApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "proxy")) { } @@ -23,7 +25,7 @@ public OnErrorEvent OnError if (_onError is null) { _onError = new OnErrorEvent(); - InitializeProperty("onError", _onError); + _onError.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onError")); } return _onError; } @@ -37,7 +39,7 @@ public OnRequestEvent OnRequest if (_onRequest is null) { _onRequest = new OnRequestEvent(); - InitializeProperty("onRequest", _onRequest); + _onRequest.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onRequest")); } return _onRequest; } diff --git a/src/WebExtensions.Net/Generated/Proxy/RemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/Proxy/RemoveListenerCallbackDetails.cs index 32aa19b..d6ba67c 100644 --- a/src/WebExtensions.Net/Generated/Proxy/RemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/Proxy/RemoveListenerCallbackDetails.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Text.Json.Serialization; using WebExtensions.Net.WebRequest; @@ -5,272 +6,80 @@ namespace WebExtensions.Net.Proxy { // Type Class /// + [BindAllProperties] public partial class RemoveListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool _fromCache; - private bool? _incognito; - private string _method; - private string _originUrl; - private int _parentFrameId; - private HttpHeaders _requestHeaders; - private string _requestId; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// Indicates if this response was fetched from disk cache. [JsonPropertyName("fromCache")] - public bool FromCache - { - get - { - InitializeProperty("fromCache", _fromCache); - return _fromCache; - } - set - { - _fromCache = value; - } - } + public bool FromCache { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The HTTP request headers that are going to be sent out with this request. [JsonPropertyName("requestHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders RequestHeaders - { - get - { - InitializeProperty("requestHeaders", _requestHeaders); - return _requestHeaders; - } - set - { - _requestHeaders = value; - } - } + public HttpHeaders RequestHeaders { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Url classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Runtime/BrowserInfo.cs b/src/WebExtensions.Net/Generated/Runtime/BrowserInfo.cs index fecc1cc..6dd60a4 100644 --- a/src/WebExtensions.Net/Generated/Runtime/BrowserInfo.cs +++ b/src/WebExtensions.Net/Generated/Runtime/BrowserInfo.cs @@ -1,78 +1,31 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Runtime { // Type Class /// An object containing information about the current browser. + [BindAllProperties] public partial class BrowserInfo : BaseObject { - private string _buildID; - private string _name; - private string _vendor; - private string _version; - /// The browser's build ID/date, for example '20160101'. [JsonPropertyName("buildID")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string BuildID - { - get - { - InitializeProperty("buildID", _buildID); - return _buildID; - } - set - { - _buildID = value; - } - } + public string BuildID { get; set; } /// The name of the browser, for example 'Firefox'. [JsonPropertyName("name")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Name - { - get - { - InitializeProperty("name", _name); - return _name; - } - set - { - _name = value; - } - } + public string Name { get; set; } /// The name of the browser vendor, for example 'Mozilla'. [JsonPropertyName("vendor")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Vendor - { - get - { - InitializeProperty("vendor", _vendor); - return _vendor; - } - set - { - _vendor = value; - } - } + public string Vendor { get; set; } /// The browser's version, for example '42.0.0' or '0.8.1pre'. [JsonPropertyName("version")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Version - { - get - { - InitializeProperty("version", _version); - return _version; - } - set - { - _version = value; - } - } + public string Version { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Runtime/ConnectInfo.cs b/src/WebExtensions.Net/Generated/Runtime/ConnectInfo.cs index e815102..c67d1de 100644 --- a/src/WebExtensions.Net/Generated/Runtime/ConnectInfo.cs +++ b/src/WebExtensions.Net/Generated/Runtime/ConnectInfo.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Runtime { // Type Class /// + [BindAllProperties] public partial class ConnectInfo : BaseObject { - private bool? _includeTlsChannelId; - private string _name; - /// Whether the TLS channel ID will be passed into onConnectExternal for processes that are listening for the connection event. [JsonPropertyName("includeTlsChannelId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? IncludeTlsChannelId - { - get - { - InitializeProperty("includeTlsChannelId", _includeTlsChannelId); - return _includeTlsChannelId; - } - set - { - _includeTlsChannelId = value; - } - } + public bool? IncludeTlsChannelId { get; set; } /// Will be passed into onConnect for processes that are listening for the connection event. [JsonPropertyName("name")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Name - { - get - { - InitializeProperty("name", _name); - return _name; - } - set - { - _name = value; - } - } + public string Name { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Runtime/LastError.cs b/src/WebExtensions.Net/Generated/Runtime/LastError.cs index b1cc295..4bde289 100644 --- a/src/WebExtensions.Net/Generated/Runtime/LastError.cs +++ b/src/WebExtensions.Net/Generated/Runtime/LastError.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Runtime { // Type Class /// This will be defined during an API method callback if there was an error + [BindAllProperties] public partial class LastError : BaseObject { - private string _message; - /// Details about the error which occurred. [JsonPropertyName("message")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Message - { - get - { - InitializeProperty("message", _message); - return _message; - } - set - { - _message = value; - } - } + public string Message { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Runtime/MessageSender.cs b/src/WebExtensions.Net/Generated/Runtime/MessageSender.cs index 9ffe27c..b160448 100644 --- a/src/WebExtensions.Net/Generated/Runtime/MessageSender.cs +++ b/src/WebExtensions.Net/Generated/Runtime/MessageSender.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Text.Json.Serialization; using WebExtensions.Net.Tabs; @@ -5,75 +6,27 @@ namespace WebExtensions.Net.Runtime { // Type Class /// An object containing information about the script context that sent a message or request. + [BindAllProperties] public partial class MessageSender : BaseObject { - private int? _frameId; - private string _id; - private Tab _tab; - private string _url; - /// The $(topic:frame_ids)[frame] that opened the connection. 0 for top-level frames, positive for child frames. This will only be set when tab is set. [JsonPropertyName("frameId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int? FrameId { get; set; } /// The ID of the extension or app that opened the connection, if any. [JsonPropertyName("id")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Id - { - get - { - InitializeProperty("id", _id); - return _id; - } - set - { - _id = value; - } - } + public string Id { get; set; } /// The $(ref:tabs.Tab) which opened the connection, if any. This property will 'strong'only'/strong' be present when the connection was opened from a tab (including content scripts), and 'strong'only'/strong' if the receiver is an extension, not an app. [JsonPropertyName("tab")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Tab Tab - { - get - { - InitializeProperty("tab", _tab); - return _tab; - } - set - { - _tab = value; - } - } + public Tab Tab { get; set; } /// The URL of the page or frame that opened the connection. If the sender is in an iframe, it will be iframe's URL not the URL of the page which hosts it. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Runtime/OnConnectEvent.cs b/src/WebExtensions.Net/Generated/Runtime/OnConnectEvent.cs index 2a06477..c037900 100644 --- a/src/WebExtensions.Net/Generated/Runtime/OnConnectEvent.cs +++ b/src/WebExtensions.Net/Generated/Runtime/OnConnectEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Runtime { // Type Class /// Fired when a connection is made from either an extension process or a content script. + [BindAllProperties] public partial class OnConnectEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Runtime/OnConnectExternalEvent.cs b/src/WebExtensions.Net/Generated/Runtime/OnConnectExternalEvent.cs index 493845e..f964b30 100644 --- a/src/WebExtensions.Net/Generated/Runtime/OnConnectExternalEvent.cs +++ b/src/WebExtensions.Net/Generated/Runtime/OnConnectExternalEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Runtime { // Type Class /// Fired when a connection is made from another extension. + [BindAllProperties] public partial class OnConnectExternalEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Runtime/OnInstalledEvent.cs b/src/WebExtensions.Net/Generated/Runtime/OnInstalledEvent.cs index b6df35c..ace38af 100644 --- a/src/WebExtensions.Net/Generated/Runtime/OnInstalledEvent.cs +++ b/src/WebExtensions.Net/Generated/Runtime/OnInstalledEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Runtime { // Type Class /// Fired when the extension is first installed, when the extension is updated to a new version, and when the browser is updated to a new version. + [BindAllProperties] public partial class OnInstalledEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Runtime/OnInstalledEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/Runtime/OnInstalledEventAddListenerCallbackDetails.cs index 1c70edc..ccc4bd1 100644 --- a/src/WebExtensions.Net/Generated/Runtime/OnInstalledEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/Runtime/OnInstalledEventAddListenerCallbackDetails.cs @@ -1,59 +1,24 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Runtime { // Type Class /// + [BindAllProperties] public partial class OnInstalledEventAddListenerCallbackDetails : BaseObject { - private string _previousVersion; - private OnInstalledReason _reason; - private bool _temporary; - /// Indicates the previous version of the extension, which has just been updated. This is present only if 'reason' is 'update'. [JsonPropertyName("previousVersion")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string PreviousVersion - { - get - { - InitializeProperty("previousVersion", _previousVersion); - return _previousVersion; - } - set - { - _previousVersion = value; - } - } + public string PreviousVersion { get; set; } /// The reason that this event is being dispatched. [JsonPropertyName("reason")] - public OnInstalledReason Reason - { - get - { - InitializeProperty("reason", _reason); - return _reason; - } - set - { - _reason = value; - } - } + public OnInstalledReason Reason { get; set; } /// Indicates whether the addon is installed as a temporary extension. [JsonPropertyName("temporary")] - public bool Temporary - { - get - { - InitializeProperty("temporary", _temporary); - return _temporary; - } - set - { - _temporary = value; - } - } + public bool Temporary { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Runtime/OnInstalledEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/Runtime/OnInstalledEventHasListenerCallbackDetails.cs index 388ac17..d847cca 100644 --- a/src/WebExtensions.Net/Generated/Runtime/OnInstalledEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/Runtime/OnInstalledEventHasListenerCallbackDetails.cs @@ -1,59 +1,24 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Runtime { // Type Class /// + [BindAllProperties] public partial class OnInstalledEventHasListenerCallbackDetails : BaseObject { - private string _previousVersion; - private OnInstalledReason _reason; - private bool _temporary; - /// Indicates the previous version of the extension, which has just been updated. This is present only if 'reason' is 'update'. [JsonPropertyName("previousVersion")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string PreviousVersion - { - get - { - InitializeProperty("previousVersion", _previousVersion); - return _previousVersion; - } - set - { - _previousVersion = value; - } - } + public string PreviousVersion { get; set; } /// The reason that this event is being dispatched. [JsonPropertyName("reason")] - public OnInstalledReason Reason - { - get - { - InitializeProperty("reason", _reason); - return _reason; - } - set - { - _reason = value; - } - } + public OnInstalledReason Reason { get; set; } /// Indicates whether the addon is installed as a temporary extension. [JsonPropertyName("temporary")] - public bool Temporary - { - get - { - InitializeProperty("temporary", _temporary); - return _temporary; - } - set - { - _temporary = value; - } - } + public bool Temporary { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Runtime/OnInstalledEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/Runtime/OnInstalledEventRemoveListenerCallbackDetails.cs index 209a8c3..10e20df 100644 --- a/src/WebExtensions.Net/Generated/Runtime/OnInstalledEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/Runtime/OnInstalledEventRemoveListenerCallbackDetails.cs @@ -1,59 +1,24 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Runtime { // Type Class /// + [BindAllProperties] public partial class OnInstalledEventRemoveListenerCallbackDetails : BaseObject { - private string _previousVersion; - private OnInstalledReason _reason; - private bool _temporary; - /// Indicates the previous version of the extension, which has just been updated. This is present only if 'reason' is 'update'. [JsonPropertyName("previousVersion")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string PreviousVersion - { - get - { - InitializeProperty("previousVersion", _previousVersion); - return _previousVersion; - } - set - { - _previousVersion = value; - } - } + public string PreviousVersion { get; set; } /// The reason that this event is being dispatched. [JsonPropertyName("reason")] - public OnInstalledReason Reason - { - get - { - InitializeProperty("reason", _reason); - return _reason; - } - set - { - _reason = value; - } - } + public OnInstalledReason Reason { get; set; } /// Indicates whether the addon is installed as a temporary extension. [JsonPropertyName("temporary")] - public bool Temporary - { - get - { - InitializeProperty("temporary", _temporary); - return _temporary; - } - set - { - _temporary = value; - } - } + public bool Temporary { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Runtime/OnMessageEvent.cs b/src/WebExtensions.Net/Generated/Runtime/OnMessageEvent.cs index 9eb6126..da9fe57 100644 --- a/src/WebExtensions.Net/Generated/Runtime/OnMessageEvent.cs +++ b/src/WebExtensions.Net/Generated/Runtime/OnMessageEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Runtime { // Type Class /// Fired when a message is sent from either an extension process or a content script. + [BindAllProperties] public partial class OnMessageEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Runtime/OnMessageExternalEvent.cs b/src/WebExtensions.Net/Generated/Runtime/OnMessageExternalEvent.cs index 93adfb5..83f0582 100644 --- a/src/WebExtensions.Net/Generated/Runtime/OnMessageExternalEvent.cs +++ b/src/WebExtensions.Net/Generated/Runtime/OnMessageExternalEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Runtime { // Type Class /// Fired when a message is sent from another extension/app. Cannot be used in a content script. + [BindAllProperties] public partial class OnMessageExternalEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Runtime/OnUpdateAvailableEvent.cs b/src/WebExtensions.Net/Generated/Runtime/OnUpdateAvailableEvent.cs index c8d5691..5cd69ac 100644 --- a/src/WebExtensions.Net/Generated/Runtime/OnUpdateAvailableEvent.cs +++ b/src/WebExtensions.Net/Generated/Runtime/OnUpdateAvailableEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Runtime { // Type Class /// Fired when an update is available, but isn't installed immediately because the app is currently running. If you do nothing, the update will be installed the next time the background page gets unloaded, if you want it to be installed sooner you can explicitly call $(ref:runtime.reload). If your extension is using a persistent background page, the background page of course never gets unloaded, so unless you call $(ref:runtime.reload) manually in response to this event the update will not get installed until the next time the browser itself restarts. If no handlers are listening for this event, and your extension has a persistent background page, it behaves as if $(ref:runtime.reload) is called in response to this event. + [BindAllProperties] public partial class OnUpdateAvailableEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Runtime/OnUpdateAvailableEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/Runtime/OnUpdateAvailableEventAddListenerCallbackDetails.cs index df39ba3..18984e5 100644 --- a/src/WebExtensions.Net/Generated/Runtime/OnUpdateAvailableEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/Runtime/OnUpdateAvailableEventAddListenerCallbackDetails.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Runtime { // Type Class /// The manifest details of the available update. + [BindAllProperties] public partial class OnUpdateAvailableEventAddListenerCallbackDetails : BaseObject { - private string _version; - /// The version number of the available update. [JsonPropertyName("version")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Version - { - get - { - InitializeProperty("version", _version); - return _version; - } - set - { - _version = value; - } - } + public string Version { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Runtime/OnUpdateAvailableEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/Runtime/OnUpdateAvailableEventHasListenerCallbackDetails.cs index a78e591..378aefc 100644 --- a/src/WebExtensions.Net/Generated/Runtime/OnUpdateAvailableEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/Runtime/OnUpdateAvailableEventHasListenerCallbackDetails.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Runtime { // Type Class /// The manifest details of the available update. + [BindAllProperties] public partial class OnUpdateAvailableEventHasListenerCallbackDetails : BaseObject { - private string _version; - /// The version number of the available update. [JsonPropertyName("version")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Version - { - get - { - InitializeProperty("version", _version); - return _version; - } - set - { - _version = value; - } - } + public string Version { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Runtime/OnUpdateAvailableEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/Runtime/OnUpdateAvailableEventRemoveListenerCallbackDetails.cs index 0eb8289..e1dddc0 100644 --- a/src/WebExtensions.Net/Generated/Runtime/OnUpdateAvailableEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/Runtime/OnUpdateAvailableEventRemoveListenerCallbackDetails.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Runtime { // Type Class /// The manifest details of the available update. + [BindAllProperties] public partial class OnUpdateAvailableEventRemoveListenerCallbackDetails : BaseObject { - private string _version; - /// The version number of the available update. [JsonPropertyName("version")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Version - { - get - { - InitializeProperty("version", _version); - return _version; - } - set - { - _version = value; - } - } + public string Version { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Runtime/PlatformInfo.cs b/src/WebExtensions.Net/Generated/Runtime/PlatformInfo.cs index b344b76..4ebbcc3 100644 --- a/src/WebExtensions.Net/Generated/Runtime/PlatformInfo.cs +++ b/src/WebExtensions.Net/Generated/Runtime/PlatformInfo.cs @@ -1,42 +1,19 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Runtime { // Type Class /// An object containing information about the current platform. + [BindAllProperties] public partial class PlatformInfo : BaseObject { - private PlatformArch _arch; - private PlatformOs _os; - /// The machine's processor architecture. [JsonPropertyName("arch")] - public PlatformArch Arch - { - get - { - InitializeProperty("arch", _arch); - return _arch; - } - set - { - _arch = value; - } - } + public PlatformArch Arch { get; set; } /// The operating system the browser is running on. [JsonPropertyName("os")] - public PlatformOs Os - { - get - { - InitializeProperty("os", _os); - return _os; - } - set - { - _os = value; - } - } + public PlatformOs Os { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Runtime/Port.cs b/src/WebExtensions.Net/Generated/Runtime/Port.cs index e248d68..6b3d25c 100644 --- a/src/WebExtensions.Net/Generated/Runtime/Port.cs +++ b/src/WebExtensions.Net/Generated/Runtime/Port.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Text.Json.Serialization; using WebExtensions.Net.Events; @@ -6,109 +7,37 @@ namespace WebExtensions.Net.Runtime { // Type Class /// An object which allows two way communication with other pages. + [BindAllProperties] public partial class Port : BaseObject { - private Action _disconnect; - private string _name; - private Event _onDisconnect; - private Event _onMessage; - private Action _postMessage; - private MessageSender _sender; - /// [JsonPropertyName("disconnect")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Action Disconnect - { - get - { - InitializeProperty("disconnect", _disconnect); - return _disconnect; - } - set - { - _disconnect = value; - } - } + public Action Disconnect { get; set; } /// [JsonPropertyName("name")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Name - { - get - { - InitializeProperty("name", _name); - return _name; - } - set - { - _name = value; - } - } + public string Name { get; set; } /// [JsonPropertyName("onDisconnect")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Event OnDisconnect - { - get - { - InitializeProperty("onDisconnect", _onDisconnect); - return _onDisconnect; - } - set - { - _onDisconnect = value; - } - } + public Event OnDisconnect { get; set; } /// [JsonPropertyName("onMessage")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Event OnMessage - { - get - { - InitializeProperty("onMessage", _onMessage); - return _onMessage; - } - set - { - _onMessage = value; - } - } + public Event OnMessage { get; set; } /// [JsonPropertyName("postMessage")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Action PostMessage - { - get - { - InitializeProperty("postMessage", _postMessage); - return _postMessage; - } - set - { - _postMessage = value; - } - } + public Action PostMessage { get; set; } /// This property will 'b'only'/b' be present on ports passed to onConnect/onConnectExternal listeners. [JsonPropertyName("sender")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public MessageSender Sender - { - get - { - InitializeProperty("sender", _sender); - return _sender; - } - set - { - _sender = value; - } - } + public MessageSender Sender { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Runtime/RuntimeApi.cs b/src/WebExtensions.Net/Generated/Runtime/RuntimeApi.cs index 4fbe769..17d927f 100644 --- a/src/WebExtensions.Net/Generated/Runtime/RuntimeApi.cs +++ b/src/WebExtensions.Net/Generated/Runtime/RuntimeApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Text.Json; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -16,8 +17,9 @@ public partial class RuntimeApi : BaseApi, IRuntimeApi private OnUpdateAvailableEvent _onUpdateAvailable; /// Creates a new instance of . - /// Web Extension JS Runtime - public RuntimeApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "runtime") + /// The JS runtime adapter. + /// The base API access path. + public RuntimeApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "runtime")) { } @@ -29,7 +31,7 @@ public OnConnectEvent OnConnect if (_onConnect is null) { _onConnect = new OnConnectEvent(); - InitializeProperty("onConnect", _onConnect); + _onConnect.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onConnect")); } return _onConnect; } @@ -43,7 +45,7 @@ public OnConnectExternalEvent OnConnectExternal if (_onConnectExternal is null) { _onConnectExternal = new OnConnectExternalEvent(); - InitializeProperty("onConnectExternal", _onConnectExternal); + _onConnectExternal.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onConnectExternal")); } return _onConnectExternal; } @@ -57,7 +59,7 @@ public OnInstalledEvent OnInstalled if (_onInstalled is null) { _onInstalled = new OnInstalledEvent(); - InitializeProperty("onInstalled", _onInstalled); + _onInstalled.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onInstalled")); } return _onInstalled; } @@ -71,7 +73,7 @@ public OnMessageEvent OnMessage if (_onMessage is null) { _onMessage = new OnMessageEvent(); - InitializeProperty("onMessage", _onMessage); + _onMessage.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onMessage")); } return _onMessage; } @@ -85,7 +87,7 @@ public OnMessageExternalEvent OnMessageExternal if (_onMessageExternal is null) { _onMessageExternal = new OnMessageExternalEvent(); - InitializeProperty("onMessageExternal", _onMessageExternal); + _onMessageExternal.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onMessageExternal")); } return _onMessageExternal; } @@ -99,7 +101,7 @@ public Event OnStartup if (_onStartup is null) { _onStartup = new Event(); - InitializeProperty("onStartup", _onStartup); + _onStartup.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onStartup")); } return _onStartup; } @@ -113,7 +115,7 @@ public OnUpdateAvailableEvent OnUpdateAvailable if (_onUpdateAvailable is null) { _onUpdateAvailable = new OnUpdateAvailableEvent(); - InitializeProperty("onUpdateAvailable", _onUpdateAvailable); + _onUpdateAvailable.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onUpdateAvailable")); } return _onUpdateAvailable; } diff --git a/src/WebExtensions.Net/Generated/Search/SearchApi.cs b/src/WebExtensions.Net/Generated/Search/SearchApi.cs index 1de96cb..e0d4b9f 100644 --- a/src/WebExtensions.Net/Generated/Search/SearchApi.cs +++ b/src/WebExtensions.Net/Generated/Search/SearchApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Threading.Tasks; namespace WebExtensions.Net.Search @@ -6,8 +7,9 @@ namespace WebExtensions.Net.Search public partial class SearchApi : BaseApi, ISearchApi { /// Creates a new instance of . - /// Web Extension JS Runtime - public SearchApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "search") + /// The JS runtime adapter. + /// The base API access path. + public SearchApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "search")) { } diff --git a/src/WebExtensions.Net/Generated/Search/SearchProperties.cs b/src/WebExtensions.Net/Generated/Search/SearchProperties.cs index b909aa4..c35fb0d 100644 --- a/src/WebExtensions.Net/Generated/Search/SearchProperties.cs +++ b/src/WebExtensions.Net/Generated/Search/SearchProperties.cs @@ -1,61 +1,26 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Search { // Type Class /// + [BindAllProperties] public partial class SearchProperties : BaseObject { - private string _engine; - private string _query; - private int? _tabId; - /// Search engine to use. Uses the default if not specified. [JsonPropertyName("engine")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Engine - { - get - { - InitializeProperty("engine", _engine); - return _engine; - } - set - { - _engine = value; - } - } + public string Engine { get; set; } /// Terms to search for. [JsonPropertyName("query")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Query - { - get - { - InitializeProperty("query", _query); - return _query; - } - set - { - _query = value; - } - } + public string Query { get; set; } /// The ID of the tab for the search results. If not specified, a new tab is created. [JsonPropertyName("tabId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int? TabId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Sessions/Filter.cs b/src/WebExtensions.Net/Generated/Sessions/Filter.cs index 5d678f0..0f17dd1 100644 --- a/src/WebExtensions.Net/Generated/Sessions/Filter.cs +++ b/src/WebExtensions.Net/Generated/Sessions/Filter.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Sessions { // Type Class /// + [BindAllProperties] public partial class Filter : BaseObject { - private int? _maxResults; - /// The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries ($(ref:sessions.MAX_SESSION_RESULTS)). [JsonPropertyName("maxResults")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? MaxResults - { - get - { - InitializeProperty("maxResults", _maxResults); - return _maxResults; - } - set - { - _maxResults = value; - } - } + public int? MaxResults { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Sessions/Session.cs b/src/WebExtensions.Net/Generated/Sessions/Session.cs index 79a5f00..db52476 100644 --- a/src/WebExtensions.Net/Generated/Sessions/Session.cs +++ b/src/WebExtensions.Net/Generated/Sessions/Session.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Text.Json.Serialization; using WebExtensions.Net.Tabs; using WebExtensions.Net.Windows; @@ -6,57 +7,21 @@ namespace WebExtensions.Net.Sessions { // Type Class /// + [BindAllProperties] public partial class Session : BaseObject { - private EpochTime _lastModified; - private Tab _tab; - private Window _window; - /// The time when the window or tab was closed or modified, represented in milliseconds since the epoch. [JsonPropertyName("lastModified")] - public EpochTime LastModified - { - get - { - InitializeProperty("lastModified", _lastModified); - return _lastModified; - } - set - { - _lastModified = value; - } - } + public EpochTime LastModified { get; set; } /// The $(ref:tabs.Tab), if this entry describes a tab. Either this or $(ref:sessions.Session.window) will be set. [JsonPropertyName("tab")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Tab Tab - { - get - { - InitializeProperty("tab", _tab); - return _tab; - } - set - { - _tab = value; - } - } + public Tab Tab { get; set; } /// The $(ref:windows.Window), if this entry describes a window. Either this or $(ref:sessions.Session.tab) will be set. [JsonPropertyName("window")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Window Window - { - get - { - InitializeProperty("window", _window); - return _window; - } - set - { - _window = value; - } - } + public Window Window { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Sessions/SessionsApi.cs b/src/WebExtensions.Net/Generated/Sessions/SessionsApi.cs index 9163688..c8f6811 100644 --- a/src/WebExtensions.Net/Generated/Sessions/SessionsApi.cs +++ b/src/WebExtensions.Net/Generated/Sessions/SessionsApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -10,8 +11,9 @@ public partial class SessionsApi : BaseApi, ISessionsApi private Event _onChanged; /// Creates a new instance of . - /// Web Extension JS Runtime - public SessionsApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "sessions") + /// The JS runtime adapter. + /// The base API access path. + public SessionsApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "sessions")) { } @@ -26,7 +28,7 @@ public Event OnChanged if (_onChanged is null) { _onChanged = new Event(); - InitializeProperty("onChanged", _onChanged); + _onChanged.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onChanged")); } return _onChanged; } diff --git a/src/WebExtensions.Net/Generated/Storage/OnChangedEvent.cs b/src/WebExtensions.Net/Generated/Storage/OnChangedEvent.cs index 49309bd..588b8fa 100644 --- a/src/WebExtensions.Net/Generated/Storage/OnChangedEvent.cs +++ b/src/WebExtensions.Net/Generated/Storage/OnChangedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Storage { // Type Class /// Fired when one or more items change. + [BindAllProperties] public partial class OnChangedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Storage/StorageApi.cs b/src/WebExtensions.Net/Generated/Storage/StorageApi.cs index 766b14b..6b7e041 100644 --- a/src/WebExtensions.Net/Generated/Storage/StorageApi.cs +++ b/src/WebExtensions.Net/Generated/Storage/StorageApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Threading.Tasks; namespace WebExtensions.Net.Storage @@ -8,8 +9,9 @@ public partial class StorageApi : BaseApi, IStorageApi private OnChangedEvent _onChanged; /// Creates a new instance of . - /// Web Extension JS Runtime - public StorageApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "storage") + /// The JS runtime adapter. + /// The base API access path. + public StorageApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "storage")) { } @@ -21,7 +23,7 @@ public OnChangedEvent OnChanged if (_onChanged is null) { _onChanged = new OnChangedEvent(); - InitializeProperty("onChanged", _onChanged); + _onChanged.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onChanged")); } return _onChanged; } diff --git a/src/WebExtensions.Net/Generated/Storage/StorageArea.cs b/src/WebExtensions.Net/Generated/Storage/StorageArea.cs index 61d68f7..214c8b7 100644 --- a/src/WebExtensions.Net/Generated/Storage/StorageArea.cs +++ b/src/WebExtensions.Net/Generated/Storage/StorageArea.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Text.Json; using System.Threading.Tasks; @@ -5,6 +6,7 @@ namespace WebExtensions.Net.Storage { // Type Class /// + [BindAllProperties] public partial class StorageArea : BaseObject { /// Removes all items from storage. diff --git a/src/WebExtensions.Net/Generated/Storage/StorageAreaSync.cs b/src/WebExtensions.Net/Generated/Storage/StorageAreaSync.cs index 72ef002..1b2bb65 100644 --- a/src/WebExtensions.Net/Generated/Storage/StorageAreaSync.cs +++ b/src/WebExtensions.Net/Generated/Storage/StorageAreaSync.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Text.Json; using System.Threading.Tasks; @@ -5,6 +6,7 @@ namespace WebExtensions.Net.Storage { // Type Class /// + [BindAllProperties] public partial class StorageAreaSync : BaseObject { /// Removes all items from storage. diff --git a/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackActiveInfo.cs b/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackActiveInfo.cs index 5dde237..8fbec37 100644 --- a/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackActiveInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackActiveInfo.cs @@ -1,59 +1,24 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class AddListenerCallbackActiveInfo : BaseObject { - private int? _previousTabId; - private int _tabId; - private int _windowId; - /// The ID of the tab that was previously active, if that tab is still open. [JsonPropertyName("previousTabId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? PreviousTabId - { - get - { - InitializeProperty("previousTabId", _previousTabId); - return _previousTabId; - } - set - { - _previousTabId = value; - } - } + public int? PreviousTabId { get; set; } /// The ID of the tab that has become active. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The ID of the window the active tab changed inside of. [JsonPropertyName("windowId")] - public int WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackAttachInfo.cs b/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackAttachInfo.cs index b945e3e..3131715 100644 --- a/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackAttachInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackAttachInfo.cs @@ -1,42 +1,19 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class AddListenerCallbackAttachInfo : BaseObject { - private int _newPosition; - private int _newWindowId; - /// [JsonPropertyName("newPosition")] - public int NewPosition - { - get - { - InitializeProperty("newPosition", _newPosition); - return _newPosition; - } - set - { - _newPosition = value; - } - } + public int NewPosition { get; set; } /// [JsonPropertyName("newWindowId")] - public int NewWindowId - { - get - { - InitializeProperty("newWindowId", _newWindowId); - return _newWindowId; - } - set - { - _newWindowId = value; - } - } + public int NewWindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackChangeInfo.cs b/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackChangeInfo.cs index 4c1d2f8..8fd0ae4 100644 --- a/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackChangeInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackChangeInfo.cs @@ -1,214 +1,71 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// Lists the changes to the state of the tab that was updated. + [BindAllProperties] public partial class AddListenerCallbackChangeInfo : BaseObject { - private bool? _attention; - private bool? _audible; - private bool? _discarded; - private string _favIconUrl; - private bool? _hidden; - private bool? _isArticle; - private MutedInfo _mutedInfo; - private bool? _pinned; - private SharingState _sharingState; - private string _status; - private string _title; - private string _url; - /// The tab's new attention state. [JsonPropertyName("attention")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Attention - { - get - { - InitializeProperty("attention", _attention); - return _attention; - } - set - { - _attention = value; - } - } + public bool? Attention { get; set; } /// The tab's new audible state. [JsonPropertyName("audible")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Audible - { - get - { - InitializeProperty("audible", _audible); - return _audible; - } - set - { - _audible = value; - } - } + public bool? Audible { get; set; } /// True while the tab is not loaded with content. [JsonPropertyName("discarded")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Discarded - { - get - { - InitializeProperty("discarded", _discarded); - return _discarded; - } - set - { - _discarded = value; - } - } + public bool? Discarded { get; set; } /// The tab's new favicon URL. This property is only present if the extension's manifest includes the "tabs" permission. [JsonPropertyName("favIconUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string FavIconUrl - { - get - { - InitializeProperty("favIconUrl", _favIconUrl); - return _favIconUrl; - } - set - { - _favIconUrl = value; - } - } + public string FavIconUrl { get; set; } /// The tab's new hidden state. [JsonPropertyName("hidden")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Hidden - { - get - { - InitializeProperty("hidden", _hidden); - return _hidden; - } - set - { - _hidden = value; - } - } + public bool? Hidden { get; set; } /// Whether the document in the tab can be rendered in reader mode. [JsonPropertyName("isArticle")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? IsArticle - { - get - { - InitializeProperty("isArticle", _isArticle); - return _isArticle; - } - set - { - _isArticle = value; - } - } + public bool? IsArticle { get; set; } /// The tab's new muted state and the reason for the change. [JsonPropertyName("mutedInfo")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public MutedInfo MutedInfo - { - get - { - InitializeProperty("mutedInfo", _mutedInfo); - return _mutedInfo; - } - set - { - _mutedInfo = value; - } - } + public MutedInfo MutedInfo { get; set; } /// The tab's new pinned state. [JsonPropertyName("pinned")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Pinned - { - get - { - InitializeProperty("pinned", _pinned); - return _pinned; - } - set - { - _pinned = value; - } - } + public bool? Pinned { get; set; } /// The tab's new sharing state for screen, microphone and camera. [JsonPropertyName("sharingState")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public SharingState SharingState - { - get - { - InitializeProperty("sharingState", _sharingState); - return _sharingState; - } - set - { - _sharingState = value; - } - } + public SharingState SharingState { get; set; } /// The status of the tab. Can be either loading or complete. [JsonPropertyName("status")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Status - { - get - { - InitializeProperty("status", _status); - return _status; - } - set - { - _status = value; - } - } + public string Status { get; set; } /// The title of the tab if it has changed. This property is only present if the extension's manifest includes the "tabs" permission. [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// The tab's URL if it has changed. This property is only present if the extension's manifest includes the "tabs" permission. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackDetachInfo.cs b/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackDetachInfo.cs index d51ecba..92b8b70 100644 --- a/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackDetachInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackDetachInfo.cs @@ -1,42 +1,19 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class AddListenerCallbackDetachInfo : BaseObject { - private int _oldPosition; - private int _oldWindowId; - /// [JsonPropertyName("oldPosition")] - public int OldPosition - { - get - { - InitializeProperty("oldPosition", _oldPosition); - return _oldPosition; - } - set - { - _oldPosition = value; - } - } + public int OldPosition { get; set; } /// [JsonPropertyName("oldWindowId")] - public int OldWindowId - { - get - { - InitializeProperty("oldWindowId", _oldWindowId); - return _oldWindowId; - } - set - { - _oldWindowId = value; - } - } + public int OldWindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackHighlightInfo.cs b/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackHighlightInfo.cs index b52db69..e030301 100644 --- a/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackHighlightInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackHighlightInfo.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,40 +6,16 @@ namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class AddListenerCallbackHighlightInfo : BaseObject { - private IEnumerable _tabIds; - private int _windowId; - /// All highlighted tabs in the window. [JsonPropertyName("tabIds")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable TabIds - { - get - { - InitializeProperty("tabIds", _tabIds); - return _tabIds; - } - set - { - _tabIds = value; - } - } + public IEnumerable TabIds { get; set; } /// The window whose tabs changed. [JsonPropertyName("windowId")] - public int WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackMoveInfo.cs b/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackMoveInfo.cs index 01f084c..533ebc8 100644 --- a/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackMoveInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackMoveInfo.cs @@ -1,58 +1,23 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class AddListenerCallbackMoveInfo : BaseObject { - private int _fromIndex; - private int _toIndex; - private int _windowId; - /// [JsonPropertyName("fromIndex")] - public int FromIndex - { - get - { - InitializeProperty("fromIndex", _fromIndex); - return _fromIndex; - } - set - { - _fromIndex = value; - } - } + public int FromIndex { get; set; } /// [JsonPropertyName("toIndex")] - public int ToIndex - { - get - { - InitializeProperty("toIndex", _toIndex); - return _toIndex; - } - set - { - _toIndex = value; - } - } + public int ToIndex { get; set; } /// [JsonPropertyName("windowId")] - public int WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackRemoveInfo.cs b/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackRemoveInfo.cs index 3821e75..8ff9ab4 100644 --- a/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackRemoveInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackRemoveInfo.cs @@ -1,42 +1,19 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class AddListenerCallbackRemoveInfo : BaseObject { - private bool _isWindowClosing; - private int _windowId; - /// True when the tab is being closed because its window is being closed. [JsonPropertyName("isWindowClosing")] - public bool IsWindowClosing - { - get - { - InitializeProperty("isWindowClosing", _isWindowClosing); - return _isWindowClosing; - } - set - { - _isWindowClosing = value; - } - } + public bool IsWindowClosing { get; set; } /// The window whose tab is closed. [JsonPropertyName("windowId")] - public int WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackZoomChangeInfo.cs b/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackZoomChangeInfo.cs index 806cffa..e16dbd0 100644 --- a/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackZoomChangeInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/AddListenerCallbackZoomChangeInfo.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class AddListenerCallbackZoomChangeInfo : BaseObject { - private double _newZoomFactor; - private double _oldZoomFactor; - private int _tabId; - private ZoomSettings _zoomSettings; - /// [JsonPropertyName("newZoomFactor")] - public double NewZoomFactor - { - get - { - InitializeProperty("newZoomFactor", _newZoomFactor); - return _newZoomFactor; - } - set - { - _newZoomFactor = value; - } - } + public double NewZoomFactor { get; set; } /// [JsonPropertyName("oldZoomFactor")] - public double OldZoomFactor - { - get - { - InitializeProperty("oldZoomFactor", _oldZoomFactor); - return _oldZoomFactor; - } - set - { - _oldZoomFactor = value; - } - } + public double OldZoomFactor { get; set; } /// [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// [JsonPropertyName("zoomSettings")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ZoomSettings ZoomSettings - { - get - { - InitializeProperty("zoomSettings", _zoomSettings); - return _zoomSettings; - } - set - { - _zoomSettings = value; - } - } + public ZoomSettings ZoomSettings { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/ConnectInfo.cs b/src/WebExtensions.Net/Generated/Tabs/ConnectInfo.cs index a20aab6..661389b 100644 --- a/src/WebExtensions.Net/Generated/Tabs/ConnectInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/ConnectInfo.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class ConnectInfo : BaseObject { - private int? _frameId; - private string _name; - /// Open a port to a specific $(topic:frame_ids)[frame] identified by frameId instead of all frames in the tab. [JsonPropertyName("frameId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int? FrameId { get; set; } /// Will be passed into onConnect for content scripts that are listening for the connection event. [JsonPropertyName("name")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Name - { - get - { - InitializeProperty("name", _name); - return _name; - } - set - { - _name = value; - } - } + public string Name { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/CreateProperties.cs b/src/WebExtensions.Net/Generated/Tabs/CreateProperties.cs index 87c8ab3..7f5463e 100644 --- a/src/WebExtensions.Net/Generated/Tabs/CreateProperties.cs +++ b/src/WebExtensions.Net/Generated/Tabs/CreateProperties.cs @@ -1,180 +1,61 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class CreateProperties : BaseObject { - private bool? _active; - private string _cookieStoreId; - private bool? _discarded; - private int? _index; - private int? _openerTabId; - private bool? _openInReaderMode; - private bool? _pinned; - private string _title; - private string _url; - private int? _windowId; - /// Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see $(ref:windows.update)). Defaults to true. [JsonPropertyName("active")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Active - { - get - { - InitializeProperty("active", _active); - return _active; - } - set - { - _active = value; - } - } + public bool? Active { get; set; } /// The CookieStoreId for the tab that opened this tab. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// Whether the tab is marked as 'discarded' when created. [JsonPropertyName("discarded")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Discarded - { - get - { - InitializeProperty("discarded", _discarded); - return _discarded; - } - set - { - _discarded = value; - } - } + public bool? Discarded { get; set; } /// The position the tab should take in the window. The provided value will be clamped to between zero and the number of tabs in the window. [JsonPropertyName("index")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Index - { - get - { - InitializeProperty("index", _index); - return _index; - } - set - { - _index = value; - } - } + public int? Index { get; set; } /// The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as the newly created tab. [JsonPropertyName("openerTabId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? OpenerTabId - { - get - { - InitializeProperty("openerTabId", _openerTabId); - return _openerTabId; - } - set - { - _openerTabId = value; - } - } + public int? OpenerTabId { get; set; } /// Whether the document in the tab should be opened in reader mode. [JsonPropertyName("openInReaderMode")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? OpenInReaderMode - { - get - { - InitializeProperty("openInReaderMode", _openInReaderMode); - return _openInReaderMode; - } - set - { - _openInReaderMode = value; - } - } + public bool? OpenInReaderMode { get; set; } /// Whether the tab should be pinned. Defaults to false [JsonPropertyName("pinned")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Pinned - { - get - { - InitializeProperty("pinned", _pinned); - return _pinned; - } - set - { - _pinned = value; - } - } + public bool? Pinned { get; set; } /// The title used for display if the tab is created in discarded mode. [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// The URL to navigate the tab to initially. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// The window to create the new tab in. Defaults to the $(topic:current-window)[current window]. [JsonPropertyName("windowId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int? WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/DuplicateProperties.cs b/src/WebExtensions.Net/Generated/Tabs/DuplicateProperties.cs index cfe4e7f..92dfea6 100644 --- a/src/WebExtensions.Net/Generated/Tabs/DuplicateProperties.cs +++ b/src/WebExtensions.Net/Generated/Tabs/DuplicateProperties.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class DuplicateProperties : BaseObject { - private bool? _active; - private int? _index; - /// Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see $(ref:windows.update)). Defaults to true. [JsonPropertyName("active")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Active - { - get - { - InitializeProperty("active", _active); - return _active; - } - set - { - _active = value; - } - } + public bool? Active { get; set; } /// The position the new tab should take in the window. The provided value will be clamped to between zero and the number of tabs in the window. [JsonPropertyName("index")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Index - { - get - { - InitializeProperty("index", _index); - return _index; - } - set - { - _index = value; - } - } + public int? Index { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackActiveInfo.cs b/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackActiveInfo.cs index fa25015..4eb8e60 100644 --- a/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackActiveInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackActiveInfo.cs @@ -1,59 +1,24 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class HasListenerCallbackActiveInfo : BaseObject { - private int? _previousTabId; - private int _tabId; - private int _windowId; - /// The ID of the tab that was previously active, if that tab is still open. [JsonPropertyName("previousTabId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? PreviousTabId - { - get - { - InitializeProperty("previousTabId", _previousTabId); - return _previousTabId; - } - set - { - _previousTabId = value; - } - } + public int? PreviousTabId { get; set; } /// The ID of the tab that has become active. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The ID of the window the active tab changed inside of. [JsonPropertyName("windowId")] - public int WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackAttachInfo.cs b/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackAttachInfo.cs index 371d179..e1ceaf5 100644 --- a/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackAttachInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackAttachInfo.cs @@ -1,42 +1,19 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class HasListenerCallbackAttachInfo : BaseObject { - private int _newPosition; - private int _newWindowId; - /// [JsonPropertyName("newPosition")] - public int NewPosition - { - get - { - InitializeProperty("newPosition", _newPosition); - return _newPosition; - } - set - { - _newPosition = value; - } - } + public int NewPosition { get; set; } /// [JsonPropertyName("newWindowId")] - public int NewWindowId - { - get - { - InitializeProperty("newWindowId", _newWindowId); - return _newWindowId; - } - set - { - _newWindowId = value; - } - } + public int NewWindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackChangeInfo.cs b/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackChangeInfo.cs index 5ab8822..9ab6ca6 100644 --- a/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackChangeInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackChangeInfo.cs @@ -1,214 +1,71 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// Lists the changes to the state of the tab that was updated. + [BindAllProperties] public partial class HasListenerCallbackChangeInfo : BaseObject { - private bool? _attention; - private bool? _audible; - private bool? _discarded; - private string _favIconUrl; - private bool? _hidden; - private bool? _isArticle; - private MutedInfo _mutedInfo; - private bool? _pinned; - private SharingState _sharingState; - private string _status; - private string _title; - private string _url; - /// The tab's new attention state. [JsonPropertyName("attention")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Attention - { - get - { - InitializeProperty("attention", _attention); - return _attention; - } - set - { - _attention = value; - } - } + public bool? Attention { get; set; } /// The tab's new audible state. [JsonPropertyName("audible")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Audible - { - get - { - InitializeProperty("audible", _audible); - return _audible; - } - set - { - _audible = value; - } - } + public bool? Audible { get; set; } /// True while the tab is not loaded with content. [JsonPropertyName("discarded")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Discarded - { - get - { - InitializeProperty("discarded", _discarded); - return _discarded; - } - set - { - _discarded = value; - } - } + public bool? Discarded { get; set; } /// The tab's new favicon URL. This property is only present if the extension's manifest includes the "tabs" permission. [JsonPropertyName("favIconUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string FavIconUrl - { - get - { - InitializeProperty("favIconUrl", _favIconUrl); - return _favIconUrl; - } - set - { - _favIconUrl = value; - } - } + public string FavIconUrl { get; set; } /// The tab's new hidden state. [JsonPropertyName("hidden")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Hidden - { - get - { - InitializeProperty("hidden", _hidden); - return _hidden; - } - set - { - _hidden = value; - } - } + public bool? Hidden { get; set; } /// Whether the document in the tab can be rendered in reader mode. [JsonPropertyName("isArticle")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? IsArticle - { - get - { - InitializeProperty("isArticle", _isArticle); - return _isArticle; - } - set - { - _isArticle = value; - } - } + public bool? IsArticle { get; set; } /// The tab's new muted state and the reason for the change. [JsonPropertyName("mutedInfo")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public MutedInfo MutedInfo - { - get - { - InitializeProperty("mutedInfo", _mutedInfo); - return _mutedInfo; - } - set - { - _mutedInfo = value; - } - } + public MutedInfo MutedInfo { get; set; } /// The tab's new pinned state. [JsonPropertyName("pinned")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Pinned - { - get - { - InitializeProperty("pinned", _pinned); - return _pinned; - } - set - { - _pinned = value; - } - } + public bool? Pinned { get; set; } /// The tab's new sharing state for screen, microphone and camera. [JsonPropertyName("sharingState")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public SharingState SharingState - { - get - { - InitializeProperty("sharingState", _sharingState); - return _sharingState; - } - set - { - _sharingState = value; - } - } + public SharingState SharingState { get; set; } /// The status of the tab. Can be either loading or complete. [JsonPropertyName("status")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Status - { - get - { - InitializeProperty("status", _status); - return _status; - } - set - { - _status = value; - } - } + public string Status { get; set; } /// The title of the tab if it has changed. This property is only present if the extension's manifest includes the "tabs" permission. [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// The tab's URL if it has changed. This property is only present if the extension's manifest includes the "tabs" permission. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackDetachInfo.cs b/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackDetachInfo.cs index 6050bf4..ef487cc 100644 --- a/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackDetachInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackDetachInfo.cs @@ -1,42 +1,19 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class HasListenerCallbackDetachInfo : BaseObject { - private int _oldPosition; - private int _oldWindowId; - /// [JsonPropertyName("oldPosition")] - public int OldPosition - { - get - { - InitializeProperty("oldPosition", _oldPosition); - return _oldPosition; - } - set - { - _oldPosition = value; - } - } + public int OldPosition { get; set; } /// [JsonPropertyName("oldWindowId")] - public int OldWindowId - { - get - { - InitializeProperty("oldWindowId", _oldWindowId); - return _oldWindowId; - } - set - { - _oldWindowId = value; - } - } + public int OldWindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackHighlightInfo.cs b/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackHighlightInfo.cs index 207bc82..eda06b2 100644 --- a/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackHighlightInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackHighlightInfo.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,40 +6,16 @@ namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class HasListenerCallbackHighlightInfo : BaseObject { - private IEnumerable _tabIds; - private int _windowId; - /// All highlighted tabs in the window. [JsonPropertyName("tabIds")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable TabIds - { - get - { - InitializeProperty("tabIds", _tabIds); - return _tabIds; - } - set - { - _tabIds = value; - } - } + public IEnumerable TabIds { get; set; } /// The window whose tabs changed. [JsonPropertyName("windowId")] - public int WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackMoveInfo.cs b/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackMoveInfo.cs index 8b2e387..af20a9c 100644 --- a/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackMoveInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackMoveInfo.cs @@ -1,58 +1,23 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class HasListenerCallbackMoveInfo : BaseObject { - private int _fromIndex; - private int _toIndex; - private int _windowId; - /// [JsonPropertyName("fromIndex")] - public int FromIndex - { - get - { - InitializeProperty("fromIndex", _fromIndex); - return _fromIndex; - } - set - { - _fromIndex = value; - } - } + public int FromIndex { get; set; } /// [JsonPropertyName("toIndex")] - public int ToIndex - { - get - { - InitializeProperty("toIndex", _toIndex); - return _toIndex; - } - set - { - _toIndex = value; - } - } + public int ToIndex { get; set; } /// [JsonPropertyName("windowId")] - public int WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackRemoveInfo.cs b/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackRemoveInfo.cs index ceefad6..4e6f81a 100644 --- a/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackRemoveInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackRemoveInfo.cs @@ -1,42 +1,19 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class HasListenerCallbackRemoveInfo : BaseObject { - private bool _isWindowClosing; - private int _windowId; - /// True when the tab is being closed because its window is being closed. [JsonPropertyName("isWindowClosing")] - public bool IsWindowClosing - { - get - { - InitializeProperty("isWindowClosing", _isWindowClosing); - return _isWindowClosing; - } - set - { - _isWindowClosing = value; - } - } + public bool IsWindowClosing { get; set; } /// The window whose tab is closed. [JsonPropertyName("windowId")] - public int WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackZoomChangeInfo.cs b/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackZoomChangeInfo.cs index 68074ab..500f274 100644 --- a/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackZoomChangeInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/HasListenerCallbackZoomChangeInfo.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class HasListenerCallbackZoomChangeInfo : BaseObject { - private double _newZoomFactor; - private double _oldZoomFactor; - private int _tabId; - private ZoomSettings _zoomSettings; - /// [JsonPropertyName("newZoomFactor")] - public double NewZoomFactor - { - get - { - InitializeProperty("newZoomFactor", _newZoomFactor); - return _newZoomFactor; - } - set - { - _newZoomFactor = value; - } - } + public double NewZoomFactor { get; set; } /// [JsonPropertyName("oldZoomFactor")] - public double OldZoomFactor - { - get - { - InitializeProperty("oldZoomFactor", _oldZoomFactor); - return _oldZoomFactor; - } - set - { - _oldZoomFactor = value; - } - } + public double OldZoomFactor { get; set; } /// [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// [JsonPropertyName("zoomSettings")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ZoomSettings ZoomSettings - { - get - { - InitializeProperty("zoomSettings", _zoomSettings); - return _zoomSettings; - } - set - { - _zoomSettings = value; - } - } + public ZoomSettings ZoomSettings { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/HighlightHighlightInfo.cs b/src/WebExtensions.Net/Generated/Tabs/HighlightHighlightInfo.cs index ff6c1e8..d645130 100644 --- a/src/WebExtensions.Net/Generated/Tabs/HighlightHighlightInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/HighlightHighlightInfo.cs @@ -1,61 +1,26 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class HighlightHighlightInfo : BaseObject { - private bool? _populate; - private HighlightInfoTabs _tabs; - private int? _windowId; - /// If true, the $(ref:windows.Window) returned will have a tabs property that contains a list of the $(ref:tabs.Tab) objects. The Tab objects only contain the url, title and favIconUrl properties if the extension's manifest file includes the "tabs" permission. If false, the $(ref:windows.Window) won't have the tabs property. [JsonPropertyName("populate")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Populate - { - get - { - InitializeProperty("populate", _populate); - return _populate; - } - set - { - _populate = value; - } - } + public bool? Populate { get; set; } /// One or more tab indices to highlight. [JsonPropertyName("tabs")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HighlightInfoTabs Tabs - { - get - { - InitializeProperty("tabs", _tabs); - return _tabs; - } - set - { - _tabs = value; - } - } + public HighlightInfoTabs Tabs { get; set; } /// The window that contains the tabs. [JsonPropertyName("windowId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int? WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/MoveInSuccessionOptions.cs b/src/WebExtensions.Net/Generated/Tabs/MoveInSuccessionOptions.cs index bc33488..a7afded 100644 --- a/src/WebExtensions.Net/Generated/Tabs/MoveInSuccessionOptions.cs +++ b/src/WebExtensions.Net/Generated/Tabs/MoveInSuccessionOptions.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class MoveInSuccessionOptions : BaseObject { - private bool? _append; - private bool? _insert; - /// Whether to move the tabs before (false) or after (true) tabId in the succession. Defaults to false. [JsonPropertyName("append")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Append - { - get - { - InitializeProperty("append", _append); - return _append; - } - set - { - _append = value; - } - } + public bool? Append { get; set; } /// Whether to link up the current predecessors or successor (depending on options.append) of tabId to the other side of the chain after it is prepended or appended. If true, one of the following happens: if options.append is false, the first tab in the array is set as the successor of any current predecessors of tabId; if options.append is true, the current successor of tabId is set as the successor of the last tab in the array. Defaults to false. [JsonPropertyName("insert")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Insert - { - get - { - InitializeProperty("insert", _insert); - return _insert; - } - set - { - _insert = value; - } - } + public bool? Insert { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/MoveProperties.cs b/src/WebExtensions.Net/Generated/Tabs/MoveProperties.cs index 4183ace..df523a6 100644 --- a/src/WebExtensions.Net/Generated/Tabs/MoveProperties.cs +++ b/src/WebExtensions.Net/Generated/Tabs/MoveProperties.cs @@ -1,43 +1,20 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class MoveProperties : BaseObject { - private int _index; - private int? _windowId; - /// The position to move the window to. -1 will place the tab at the end of the window. [JsonPropertyName("index")] - public int Index - { - get - { - InitializeProperty("index", _index); - return _index; - } - set - { - _index = value; - } - } + public int Index { get; set; } /// Defaults to the window the tab is currently in. [JsonPropertyName("windowId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int? WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/MutedInfo.cs b/src/WebExtensions.Net/Generated/Tabs/MutedInfo.cs index 75f3a7e..5fbc32d 100644 --- a/src/WebExtensions.Net/Generated/Tabs/MutedInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/MutedInfo.cs @@ -1,60 +1,25 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// Tab muted state and the reason for the last state change. + [BindAllProperties] public partial class MutedInfo : BaseObject { - private string _extensionId; - private bool _muted; - private MutedInfoReason? _reason; - /// The ID of the extension that changed the muted state. Not set if an extension was not the reason the muted state last changed. [JsonPropertyName("extensionId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string ExtensionId - { - get - { - InitializeProperty("extensionId", _extensionId); - return _extensionId; - } - set - { - _extensionId = value; - } - } + public string ExtensionId { get; set; } /// Whether the tab is prevented from playing sound (but hasn't necessarily recently produced sound). Equivalent to whether the muted audio indicator is showing. [JsonPropertyName("muted")] - public bool Muted - { - get - { - InitializeProperty("muted", _muted); - return _muted; - } - set - { - _muted = value; - } - } + public bool Muted { get; set; } /// The reason the tab was muted or unmuted. Not set if the tab's mute state has never been changed. [JsonPropertyName("reason")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public MutedInfoReason? Reason - { - get - { - InitializeProperty("reason", _reason); - return _reason; - } - set - { - _reason = value; - } - } + public MutedInfoReason? Reason { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/OnActivatedEvent.cs b/src/WebExtensions.Net/Generated/Tabs/OnActivatedEvent.cs index 4cd1439..8f394bc 100644 --- a/src/WebExtensions.Net/Generated/Tabs/OnActivatedEvent.cs +++ b/src/WebExtensions.Net/Generated/Tabs/OnActivatedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Tabs { // Type Class /// Fires when the active tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set. + [BindAllProperties] public partial class OnActivatedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Tabs/OnAttachedEvent.cs b/src/WebExtensions.Net/Generated/Tabs/OnAttachedEvent.cs index e94f2a2..2922b54 100644 --- a/src/WebExtensions.Net/Generated/Tabs/OnAttachedEvent.cs +++ b/src/WebExtensions.Net/Generated/Tabs/OnAttachedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Tabs { // Type Class /// Fired when a tab is attached to a window, for example because it was moved between windows. + [BindAllProperties] public partial class OnAttachedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Tabs/OnCreatedEvent.cs b/src/WebExtensions.Net/Generated/Tabs/OnCreatedEvent.cs index 25d04f9..d2180f1 100644 --- a/src/WebExtensions.Net/Generated/Tabs/OnCreatedEvent.cs +++ b/src/WebExtensions.Net/Generated/Tabs/OnCreatedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Tabs { // Type Class /// Fired when a tab is created. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set. + [BindAllProperties] public partial class OnCreatedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Tabs/OnDetachedEvent.cs b/src/WebExtensions.Net/Generated/Tabs/OnDetachedEvent.cs index 8e9c37b..a44af2f 100644 --- a/src/WebExtensions.Net/Generated/Tabs/OnDetachedEvent.cs +++ b/src/WebExtensions.Net/Generated/Tabs/OnDetachedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Tabs { // Type Class /// Fired when a tab is detached from a window, for example because it is being moved between windows. + [BindAllProperties] public partial class OnDetachedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Tabs/OnHighlightedEvent.cs b/src/WebExtensions.Net/Generated/Tabs/OnHighlightedEvent.cs index 1f18a75..e039573 100644 --- a/src/WebExtensions.Net/Generated/Tabs/OnHighlightedEvent.cs +++ b/src/WebExtensions.Net/Generated/Tabs/OnHighlightedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Tabs { // Type Class /// Fired when the highlighted or selected tabs in a window changes. + [BindAllProperties] public partial class OnHighlightedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Tabs/OnMovedEvent.cs b/src/WebExtensions.Net/Generated/Tabs/OnMovedEvent.cs index ed3b36c..3215886 100644 --- a/src/WebExtensions.Net/Generated/Tabs/OnMovedEvent.cs +++ b/src/WebExtensions.Net/Generated/Tabs/OnMovedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Tabs { // Type Class /// Fired when a tab is moved within a window. Only one move event is fired, representing the tab the user directly moved. Move events are not fired for the other tabs that must move in response. This event is not fired when a tab is moved between windows. For that, see $(ref:tabs.onDetached). + [BindAllProperties] public partial class OnMovedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Tabs/OnRemovedEvent.cs b/src/WebExtensions.Net/Generated/Tabs/OnRemovedEvent.cs index e0df709..2f9100f 100644 --- a/src/WebExtensions.Net/Generated/Tabs/OnRemovedEvent.cs +++ b/src/WebExtensions.Net/Generated/Tabs/OnRemovedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Tabs { // Type Class /// Fired when a tab is closed. + [BindAllProperties] public partial class OnRemovedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Tabs/OnReplacedEvent.cs b/src/WebExtensions.Net/Generated/Tabs/OnReplacedEvent.cs index 850eef6..fdcd58e 100644 --- a/src/WebExtensions.Net/Generated/Tabs/OnReplacedEvent.cs +++ b/src/WebExtensions.Net/Generated/Tabs/OnReplacedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Tabs { // Type Class /// Fired when a tab is replaced with another tab due to prerendering or instant. + [BindAllProperties] public partial class OnReplacedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Tabs/OnUpdatedEvent.cs b/src/WebExtensions.Net/Generated/Tabs/OnUpdatedEvent.cs index 7e3b878..3506e1c 100644 --- a/src/WebExtensions.Net/Generated/Tabs/OnUpdatedEvent.cs +++ b/src/WebExtensions.Net/Generated/Tabs/OnUpdatedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Tabs { // Type Class /// Fired when a tab is updated. + [BindAllProperties] public partial class OnUpdatedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Tabs/OnZoomChangeEvent.cs b/src/WebExtensions.Net/Generated/Tabs/OnZoomChangeEvent.cs index 98516b1..e068eb3 100644 --- a/src/WebExtensions.Net/Generated/Tabs/OnZoomChangeEvent.cs +++ b/src/WebExtensions.Net/Generated/Tabs/OnZoomChangeEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Tabs { // Type Class /// Fired when a tab is zoomed. + [BindAllProperties] public partial class OnZoomChangeEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Tabs/PageSettings.cs b/src/WebExtensions.Net/Generated/Tabs/PageSettings.cs index dd9bdcb..00c6719 100644 --- a/src/WebExtensions.Net/Generated/Tabs/PageSettings.cs +++ b/src/WebExtensions.Net/Generated/Tabs/PageSettings.cs @@ -1,401 +1,126 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// Defines the page settings to be used when saving a page as a pdf file. + [BindAllProperties] public partial class PageSettings : BaseObject { - private double? _edgeBottom; - private double? _edgeLeft; - private double? _edgeRight; - private double? _edgeTop; - private string _footerCenter; - private string _footerLeft; - private string _footerRight; - private string _headerCenter; - private string _headerLeft; - private string _headerRight; - private double? _marginBottom; - private double? _marginLeft; - private double? _marginRight; - private double? _marginTop; - private int? _orientation; - private double? _paperHeight; - private int? _paperSizeUnit; - private double? _paperWidth; - private double? _scaling; - private bool? _showBackgroundColors; - private bool? _showBackgroundImages; - private bool? _shrinkToFit; - private string _toFileName; - /// The spacing between the bottom of the footers and the bottom edge of the paper (inches). Default: 0. [JsonPropertyName("edgeBottom")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? EdgeBottom - { - get - { - InitializeProperty("edgeBottom", _edgeBottom); - return _edgeBottom; - } - set - { - _edgeBottom = value; - } - } + public double? EdgeBottom { get; set; } /// The spacing between the left header/footer and the left edge of the paper (inches). Default: 0. [JsonPropertyName("edgeLeft")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? EdgeLeft - { - get - { - InitializeProperty("edgeLeft", _edgeLeft); - return _edgeLeft; - } - set - { - _edgeLeft = value; - } - } + public double? EdgeLeft { get; set; } /// The spacing between the right header/footer and the right edge of the paper (inches). Default: 0. [JsonPropertyName("edgeRight")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? EdgeRight - { - get - { - InitializeProperty("edgeRight", _edgeRight); - return _edgeRight; - } - set - { - _edgeRight = value; - } - } + public double? EdgeRight { get; set; } /// The spacing between the top of the headers and the top edge of the paper (inches). Default: 0 [JsonPropertyName("edgeTop")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? EdgeTop - { - get - { - InitializeProperty("edgeTop", _edgeTop); - return _edgeTop; - } - set - { - _edgeTop = value; - } - } + public double? EdgeTop { get; set; } /// The text for the page's center footer. Default: ''. [JsonPropertyName("footerCenter")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string FooterCenter - { - get - { - InitializeProperty("footerCenter", _footerCenter); - return _footerCenter; - } - set - { - _footerCenter = value; - } - } + public string FooterCenter { get; set; } /// The text for the page's left footer. Default: '&PT'. [JsonPropertyName("footerLeft")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string FooterLeft - { - get - { - InitializeProperty("footerLeft", _footerLeft); - return _footerLeft; - } - set - { - _footerLeft = value; - } - } + public string FooterLeft { get; set; } /// The text for the page's right footer. Default: '&D'. [JsonPropertyName("footerRight")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string FooterRight - { - get - { - InitializeProperty("footerRight", _footerRight); - return _footerRight; - } - set - { - _footerRight = value; - } - } + public string FooterRight { get; set; } /// The text for the page's center header. Default: ''. [JsonPropertyName("headerCenter")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string HeaderCenter - { - get - { - InitializeProperty("headerCenter", _headerCenter); - return _headerCenter; - } - set - { - _headerCenter = value; - } - } + public string HeaderCenter { get; set; } /// The text for the page's left header. Default: '&T'. [JsonPropertyName("headerLeft")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string HeaderLeft - { - get - { - InitializeProperty("headerLeft", _headerLeft); - return _headerLeft; - } - set - { - _headerLeft = value; - } - } + public string HeaderLeft { get; set; } /// The text for the page's right header. Default: '&U'. [JsonPropertyName("headerRight")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string HeaderRight - { - get - { - InitializeProperty("headerRight", _headerRight); - return _headerRight; - } - set - { - _headerRight = value; - } - } + public string HeaderRight { get; set; } /// The margin between the page content and the bottom edge of the paper (inches). Default: 0.5. [JsonPropertyName("marginBottom")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? MarginBottom - { - get - { - InitializeProperty("marginBottom", _marginBottom); - return _marginBottom; - } - set - { - _marginBottom = value; - } - } + public double? MarginBottom { get; set; } /// The margin between the page content and the left edge of the paper (inches). Default: 0.5. [JsonPropertyName("marginLeft")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? MarginLeft - { - get - { - InitializeProperty("marginLeft", _marginLeft); - return _marginLeft; - } - set - { - _marginLeft = value; - } - } + public double? MarginLeft { get; set; } /// The margin between the page content and the right edge of the paper (inches). Default: 0.5. [JsonPropertyName("marginRight")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? MarginRight - { - get - { - InitializeProperty("marginRight", _marginRight); - return _marginRight; - } - set - { - _marginRight = value; - } - } + public double? MarginRight { get; set; } /// The margin between the page content and the top edge of the paper (inches). Default: 0.5. [JsonPropertyName("marginTop")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? MarginTop - { - get - { - InitializeProperty("marginTop", _marginTop); - return _marginTop; - } - set - { - _marginTop = value; - } - } + public double? MarginTop { get; set; } /// The page content orientation: 0 = portrait, 1 = landscape. Default: 0. [JsonPropertyName("orientation")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Orientation - { - get - { - InitializeProperty("orientation", _orientation); - return _orientation; - } - set - { - _orientation = value; - } - } + public int? Orientation { get; set; } /// The paper height in paper size units. Default: 11.0. [JsonPropertyName("paperHeight")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? PaperHeight - { - get - { - InitializeProperty("paperHeight", _paperHeight); - return _paperHeight; - } - set - { - _paperHeight = value; - } - } + public double? PaperHeight { get; set; } /// The page size unit: 0 = inches, 1 = millimeters. Default: 0. [JsonPropertyName("paperSizeUnit")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? PaperSizeUnit - { - get - { - InitializeProperty("paperSizeUnit", _paperSizeUnit); - return _paperSizeUnit; - } - set - { - _paperSizeUnit = value; - } - } + public int? PaperSizeUnit { get; set; } /// The paper width in paper size units. Default: 8.5. [JsonPropertyName("paperWidth")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? PaperWidth - { - get - { - InitializeProperty("paperWidth", _paperWidth); - return _paperWidth; - } - set - { - _paperWidth = value; - } - } + public double? PaperWidth { get; set; } /// The page content scaling factor: 1.0 = 100% = normal size. Default: 1.0. [JsonPropertyName("scaling")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? Scaling - { - get - { - InitializeProperty("scaling", _scaling); - return _scaling; - } - set - { - _scaling = value; - } - } + public double? Scaling { get; set; } /// Whether the page background colors should be shown. Default: false. [JsonPropertyName("showBackgroundColors")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? ShowBackgroundColors - { - get - { - InitializeProperty("showBackgroundColors", _showBackgroundColors); - return _showBackgroundColors; - } - set - { - _showBackgroundColors = value; - } - } + public bool? ShowBackgroundColors { get; set; } /// Whether the page background images should be shown. Default: false. [JsonPropertyName("showBackgroundImages")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? ShowBackgroundImages - { - get - { - InitializeProperty("showBackgroundImages", _showBackgroundImages); - return _showBackgroundImages; - } - set - { - _showBackgroundImages = value; - } - } + public bool? ShowBackgroundImages { get; set; } /// Whether the page content should shrink to fit the page width (overrides scaling). Default: true. [JsonPropertyName("shrinkToFit")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? ShrinkToFit - { - get - { - InitializeProperty("shrinkToFit", _shrinkToFit); - return _shrinkToFit; - } - set - { - _shrinkToFit = value; - } - } + public bool? ShrinkToFit { get; set; } /// The name of the file. May include optional .pdf extension. [JsonPropertyName("toFileName")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string ToFileName - { - get - { - InitializeProperty("toFileName", _toFileName); - return _toFileName; - } - set - { - _toFileName = value; - } - } + public string ToFileName { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/QueryInfo.cs b/src/WebExtensions.Net/Generated/Tabs/QueryInfo.cs index 548316a..1ae167f 100644 --- a/src/WebExtensions.Net/Generated/Tabs/QueryInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/QueryInfo.cs @@ -1,367 +1,116 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class QueryInfo : BaseObject { - private bool? _active; - private bool? _attention; - private bool? _audible; - private bool? _camera; - private string _cookieStoreId; - private bool? _currentWindow; - private bool? _discarded; - private bool? _hidden; - private bool? _highlighted; - private int? _index; - private bool? _lastFocusedWindow; - private bool? _microphone; - private bool? _muted; - private int? _openerTabId; - private bool? _pinned; - private Screen _screen; - private TabStatus? _status; - private string _title; - private Url _url; - private int? _windowId; - private WindowType? _windowType; - /// Whether the tabs are active in their windows. [JsonPropertyName("active")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Active - { - get - { - InitializeProperty("active", _active); - return _active; - } - set - { - _active = value; - } - } + public bool? Active { get; set; } /// Whether the tabs are drawing attention. [JsonPropertyName("attention")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Attention - { - get - { - InitializeProperty("attention", _attention); - return _attention; - } - set - { - _attention = value; - } - } + public bool? Attention { get; set; } /// Whether the tabs are audible. [JsonPropertyName("audible")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Audible - { - get - { - InitializeProperty("audible", _audible); - return _audible; - } - set - { - _audible = value; - } - } + public bool? Audible { get; set; } /// True if the tab is using the camera. [JsonPropertyName("camera")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Camera - { - get - { - InitializeProperty("camera", _camera); - return _camera; - } - set - { - _camera = value; - } - } + public bool? Camera { get; set; } /// The CookieStoreId used for the tab. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// Whether the tabs are in the $(topic:current-window)[current window]. [JsonPropertyName("currentWindow")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? CurrentWindow - { - get - { - InitializeProperty("currentWindow", _currentWindow); - return _currentWindow; - } - set - { - _currentWindow = value; - } - } + public bool? CurrentWindow { get; set; } /// True while the tabs are not loaded with content. [JsonPropertyName("discarded")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Discarded - { - get - { - InitializeProperty("discarded", _discarded); - return _discarded; - } - set - { - _discarded = value; - } - } + public bool? Discarded { get; set; } /// True while the tabs are hidden. [JsonPropertyName("hidden")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Hidden - { - get - { - InitializeProperty("hidden", _hidden); - return _hidden; - } - set - { - _hidden = value; - } - } + public bool? Hidden { get; set; } /// Whether the tabs are highlighted. Works as an alias of active. [JsonPropertyName("highlighted")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Highlighted - { - get - { - InitializeProperty("highlighted", _highlighted); - return _highlighted; - } - set - { - _highlighted = value; - } - } + public bool? Highlighted { get; set; } /// The position of the tabs within their windows. [JsonPropertyName("index")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Index - { - get - { - InitializeProperty("index", _index); - return _index; - } - set - { - _index = value; - } - } + public int? Index { get; set; } /// Whether the tabs are in the last focused window. [JsonPropertyName("lastFocusedWindow")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? LastFocusedWindow - { - get - { - InitializeProperty("lastFocusedWindow", _lastFocusedWindow); - return _lastFocusedWindow; - } - set - { - _lastFocusedWindow = value; - } - } + public bool? LastFocusedWindow { get; set; } /// True if the tab is using the microphone. [JsonPropertyName("microphone")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Microphone - { - get - { - InitializeProperty("microphone", _microphone); - return _microphone; - } - set - { - _microphone = value; - } - } + public bool? Microphone { get; set; } /// Whether the tabs are muted. [JsonPropertyName("muted")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Muted - { - get - { - InitializeProperty("muted", _muted); - return _muted; - } - set - { - _muted = value; - } - } + public bool? Muted { get; set; } /// The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab. [JsonPropertyName("openerTabId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? OpenerTabId - { - get - { - InitializeProperty("openerTabId", _openerTabId); - return _openerTabId; - } - set - { - _openerTabId = value; - } - } + public int? OpenerTabId { get; set; } /// Whether the tabs are pinned. [JsonPropertyName("pinned")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Pinned - { - get - { - InitializeProperty("pinned", _pinned); - return _pinned; - } - set - { - _pinned = value; - } - } + public bool? Pinned { get; set; } /// True for any screen sharing, or a string to specify type of screen sharing. [JsonPropertyName("screen")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Screen Screen - { - get - { - InitializeProperty("screen", _screen); - return _screen; - } - set - { - _screen = value; - } - } + public Screen Screen { get; set; } /// Whether the tabs have completed loading. [JsonPropertyName("status")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public TabStatus? Status - { - get - { - InitializeProperty("status", _status); - return _status; - } - set - { - _status = value; - } - } + public TabStatus? Status { get; set; } /// Match page titles against a pattern. [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// Match tabs against one or more $(topic:match_patterns)[URL patterns]. Note that fragment identifiers are not matched. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Url Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public Url Url { get; set; } /// The ID of the parent window, or $(ref:windows.WINDOW_ID_CURRENT) for the $(topic:current-window)[current window]. [JsonPropertyName("windowId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int? WindowId { get; set; } /// The type of window the tabs are in. [JsonPropertyName("windowType")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public WindowType? WindowType - { - get - { - InitializeProperty("windowType", _windowType); - return _windowType; - } - set - { - _windowType = value; - } - } + public WindowType? WindowType { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/ReloadProperties.cs b/src/WebExtensions.Net/Generated/Tabs/ReloadProperties.cs index 8c6e3f8..4198bf3 100644 --- a/src/WebExtensions.Net/Generated/Tabs/ReloadProperties.cs +++ b/src/WebExtensions.Net/Generated/Tabs/ReloadProperties.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class ReloadProperties : BaseObject { - private bool? _bypassCache; - /// Whether using any local cache. Default is false. [JsonPropertyName("bypassCache")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? BypassCache - { - get - { - InitializeProperty("bypassCache", _bypassCache); - return _bypassCache; - } - set - { - _bypassCache = value; - } - } + public bool? BypassCache { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackActiveInfo.cs b/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackActiveInfo.cs index b75951c..9b50afc 100644 --- a/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackActiveInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackActiveInfo.cs @@ -1,59 +1,24 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class RemoveListenerCallbackActiveInfo : BaseObject { - private int? _previousTabId; - private int _tabId; - private int _windowId; - /// The ID of the tab that was previously active, if that tab is still open. [JsonPropertyName("previousTabId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? PreviousTabId - { - get - { - InitializeProperty("previousTabId", _previousTabId); - return _previousTabId; - } - set - { - _previousTabId = value; - } - } + public int? PreviousTabId { get; set; } /// The ID of the tab that has become active. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The ID of the window the active tab changed inside of. [JsonPropertyName("windowId")] - public int WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackAttachInfo.cs b/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackAttachInfo.cs index 018f8c5..dd5f41c 100644 --- a/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackAttachInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackAttachInfo.cs @@ -1,42 +1,19 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class RemoveListenerCallbackAttachInfo : BaseObject { - private int _newPosition; - private int _newWindowId; - /// [JsonPropertyName("newPosition")] - public int NewPosition - { - get - { - InitializeProperty("newPosition", _newPosition); - return _newPosition; - } - set - { - _newPosition = value; - } - } + public int NewPosition { get; set; } /// [JsonPropertyName("newWindowId")] - public int NewWindowId - { - get - { - InitializeProperty("newWindowId", _newWindowId); - return _newWindowId; - } - set - { - _newWindowId = value; - } - } + public int NewWindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackChangeInfo.cs b/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackChangeInfo.cs index d143a7e..cb9c38f 100644 --- a/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackChangeInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackChangeInfo.cs @@ -1,214 +1,71 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// Lists the changes to the state of the tab that was updated. + [BindAllProperties] public partial class RemoveListenerCallbackChangeInfo : BaseObject { - private bool? _attention; - private bool? _audible; - private bool? _discarded; - private string _favIconUrl; - private bool? _hidden; - private bool? _isArticle; - private MutedInfo _mutedInfo; - private bool? _pinned; - private SharingState _sharingState; - private string _status; - private string _title; - private string _url; - /// The tab's new attention state. [JsonPropertyName("attention")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Attention - { - get - { - InitializeProperty("attention", _attention); - return _attention; - } - set - { - _attention = value; - } - } + public bool? Attention { get; set; } /// The tab's new audible state. [JsonPropertyName("audible")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Audible - { - get - { - InitializeProperty("audible", _audible); - return _audible; - } - set - { - _audible = value; - } - } + public bool? Audible { get; set; } /// True while the tab is not loaded with content. [JsonPropertyName("discarded")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Discarded - { - get - { - InitializeProperty("discarded", _discarded); - return _discarded; - } - set - { - _discarded = value; - } - } + public bool? Discarded { get; set; } /// The tab's new favicon URL. This property is only present if the extension's manifest includes the "tabs" permission. [JsonPropertyName("favIconUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string FavIconUrl - { - get - { - InitializeProperty("favIconUrl", _favIconUrl); - return _favIconUrl; - } - set - { - _favIconUrl = value; - } - } + public string FavIconUrl { get; set; } /// The tab's new hidden state. [JsonPropertyName("hidden")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Hidden - { - get - { - InitializeProperty("hidden", _hidden); - return _hidden; - } - set - { - _hidden = value; - } - } + public bool? Hidden { get; set; } /// Whether the document in the tab can be rendered in reader mode. [JsonPropertyName("isArticle")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? IsArticle - { - get - { - InitializeProperty("isArticle", _isArticle); - return _isArticle; - } - set - { - _isArticle = value; - } - } + public bool? IsArticle { get; set; } /// The tab's new muted state and the reason for the change. [JsonPropertyName("mutedInfo")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public MutedInfo MutedInfo - { - get - { - InitializeProperty("mutedInfo", _mutedInfo); - return _mutedInfo; - } - set - { - _mutedInfo = value; - } - } + public MutedInfo MutedInfo { get; set; } /// The tab's new pinned state. [JsonPropertyName("pinned")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Pinned - { - get - { - InitializeProperty("pinned", _pinned); - return _pinned; - } - set - { - _pinned = value; - } - } + public bool? Pinned { get; set; } /// The tab's new sharing state for screen, microphone and camera. [JsonPropertyName("sharingState")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public SharingState SharingState - { - get - { - InitializeProperty("sharingState", _sharingState); - return _sharingState; - } - set - { - _sharingState = value; - } - } + public SharingState SharingState { get; set; } /// The status of the tab. Can be either loading or complete. [JsonPropertyName("status")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Status - { - get - { - InitializeProperty("status", _status); - return _status; - } - set - { - _status = value; - } - } + public string Status { get; set; } /// The title of the tab if it has changed. This property is only present if the extension's manifest includes the "tabs" permission. [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// The tab's URL if it has changed. This property is only present if the extension's manifest includes the "tabs" permission. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackDetachInfo.cs b/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackDetachInfo.cs index 9ea898f..1d6e92a 100644 --- a/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackDetachInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackDetachInfo.cs @@ -1,42 +1,19 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class RemoveListenerCallbackDetachInfo : BaseObject { - private int _oldPosition; - private int _oldWindowId; - /// [JsonPropertyName("oldPosition")] - public int OldPosition - { - get - { - InitializeProperty("oldPosition", _oldPosition); - return _oldPosition; - } - set - { - _oldPosition = value; - } - } + public int OldPosition { get; set; } /// [JsonPropertyName("oldWindowId")] - public int OldWindowId - { - get - { - InitializeProperty("oldWindowId", _oldWindowId); - return _oldWindowId; - } - set - { - _oldWindowId = value; - } - } + public int OldWindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackHighlightInfo.cs b/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackHighlightInfo.cs index 1564314..5865445 100644 --- a/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackHighlightInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackHighlightInfo.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,40 +6,16 @@ namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class RemoveListenerCallbackHighlightInfo : BaseObject { - private IEnumerable _tabIds; - private int _windowId; - /// All highlighted tabs in the window. [JsonPropertyName("tabIds")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable TabIds - { - get - { - InitializeProperty("tabIds", _tabIds); - return _tabIds; - } - set - { - _tabIds = value; - } - } + public IEnumerable TabIds { get; set; } /// The window whose tabs changed. [JsonPropertyName("windowId")] - public int WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackMoveInfo.cs b/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackMoveInfo.cs index 06e70ab..41c935f 100644 --- a/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackMoveInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackMoveInfo.cs @@ -1,58 +1,23 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class RemoveListenerCallbackMoveInfo : BaseObject { - private int _fromIndex; - private int _toIndex; - private int _windowId; - /// [JsonPropertyName("fromIndex")] - public int FromIndex - { - get - { - InitializeProperty("fromIndex", _fromIndex); - return _fromIndex; - } - set - { - _fromIndex = value; - } - } + public int FromIndex { get; set; } /// [JsonPropertyName("toIndex")] - public int ToIndex - { - get - { - InitializeProperty("toIndex", _toIndex); - return _toIndex; - } - set - { - _toIndex = value; - } - } + public int ToIndex { get; set; } /// [JsonPropertyName("windowId")] - public int WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackRemoveInfo.cs b/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackRemoveInfo.cs index 2d6c6e7..baf193c 100644 --- a/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackRemoveInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackRemoveInfo.cs @@ -1,42 +1,19 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class RemoveListenerCallbackRemoveInfo : BaseObject { - private bool _isWindowClosing; - private int _windowId; - /// True when the tab is being closed because its window is being closed. [JsonPropertyName("isWindowClosing")] - public bool IsWindowClosing - { - get - { - InitializeProperty("isWindowClosing", _isWindowClosing); - return _isWindowClosing; - } - set - { - _isWindowClosing = value; - } - } + public bool IsWindowClosing { get; set; } /// The window whose tab is closed. [JsonPropertyName("windowId")] - public int WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackZoomChangeInfo.cs b/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackZoomChangeInfo.cs index a83b610..df0ecfb 100644 --- a/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackZoomChangeInfo.cs +++ b/src/WebExtensions.Net/Generated/Tabs/RemoveListenerCallbackZoomChangeInfo.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class RemoveListenerCallbackZoomChangeInfo : BaseObject { - private double _newZoomFactor; - private double _oldZoomFactor; - private int _tabId; - private ZoomSettings _zoomSettings; - /// [JsonPropertyName("newZoomFactor")] - public double NewZoomFactor - { - get - { - InitializeProperty("newZoomFactor", _newZoomFactor); - return _newZoomFactor; - } - set - { - _newZoomFactor = value; - } - } + public double NewZoomFactor { get; set; } /// [JsonPropertyName("oldZoomFactor")] - public double OldZoomFactor - { - get - { - InitializeProperty("oldZoomFactor", _oldZoomFactor); - return _oldZoomFactor; - } - set - { - _oldZoomFactor = value; - } - } + public double OldZoomFactor { get; set; } /// [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// [JsonPropertyName("zoomSettings")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ZoomSettings ZoomSettings - { - get - { - InitializeProperty("zoomSettings", _zoomSettings); - return _zoomSettings; - } - set - { - _zoomSettings = value; - } - } + public ZoomSettings ZoomSettings { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/SendMessageOptions.cs b/src/WebExtensions.Net/Generated/Tabs/SendMessageOptions.cs index 34ad888..3a75f98 100644 --- a/src/WebExtensions.Net/Generated/Tabs/SendMessageOptions.cs +++ b/src/WebExtensions.Net/Generated/Tabs/SendMessageOptions.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class SendMessageOptions : BaseObject { - private int? _frameId; - /// Send a message to a specific $(topic:frame_ids)[frame] identified by frameId instead of all frames in the tab. [JsonPropertyName("frameId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int? FrameId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/SharingState.cs b/src/WebExtensions.Net/Generated/Tabs/SharingState.cs index 95edd26..667bba4 100644 --- a/src/WebExtensions.Net/Generated/Tabs/SharingState.cs +++ b/src/WebExtensions.Net/Generated/Tabs/SharingState.cs @@ -1,59 +1,24 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// Tab sharing state for screen, microphone and camera. + [BindAllProperties] public partial class SharingState : BaseObject { - private bool _camera; - private bool _microphone; - private string _screen; - /// True if the tab is using the camera. [JsonPropertyName("camera")] - public bool Camera - { - get - { - InitializeProperty("camera", _camera); - return _camera; - } - set - { - _camera = value; - } - } + public bool Camera { get; set; } /// True if the tab is using the microphone. [JsonPropertyName("microphone")] - public bool Microphone - { - get - { - InitializeProperty("microphone", _microphone); - return _microphone; - } - set - { - _microphone = value; - } - } + public bool Microphone { get; set; } /// If the tab is sharing the screen the value will be one of "Screen", "Window", or "Application", or undefined if not screen sharing. [JsonPropertyName("screen")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Screen - { - get - { - InitializeProperty("screen", _screen); - return _screen; - } - set - { - _screen = value; - } - } + public string Screen { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/Tab.cs b/src/WebExtensions.Net/Generated/Tabs/Tab.cs index 5272fbe..d2c7b16 100644 --- a/src/WebExtensions.Net/Generated/Tabs/Tab.cs +++ b/src/WebExtensions.Net/Generated/Tabs/Tab.cs @@ -1,447 +1,136 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class Tab : BaseObject { - private bool _active; - private bool? _attention; - private bool? _audible; - private string _cookieStoreId; - private bool? _discarded; - private string _favIconUrl; - private int? _height; - private bool? _hidden; - private bool _highlighted; - private int? _id; - private bool _incognito; - private int _index; - private bool? _isArticle; - private bool? _isInReaderMode; - private EpochTime? _lastAccessed; - private MutedInfo _mutedInfo; - private int? _openerTabId; - private bool _pinned; - private string _sessionId; - private SharingState _sharingState; - private string _status; - private int? _successorTabId; - private string _title; - private string _url; - private int? _width; - private int? _windowId; - /// Whether the tab is active in its window. (Does not necessarily mean the window is focused.) [JsonPropertyName("active")] - public bool Active - { - get - { - InitializeProperty("active", _active); - return _active; - } - set - { - _active = value; - } - } + public bool Active { get; set; } /// Whether the tab is drawing attention. [JsonPropertyName("attention")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Attention - { - get - { - InitializeProperty("attention", _attention); - return _attention; - } - set - { - _attention = value; - } - } + public bool? Attention { get; set; } /// Whether the tab has produced sound over the past couple of seconds (but it might not be heard if also muted). Equivalent to whether the speaker audio indicator is showing. [JsonPropertyName("audible")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Audible - { - get - { - InitializeProperty("audible", _audible); - return _audible; - } - set - { - _audible = value; - } - } + public bool? Audible { get; set; } /// The CookieStoreId used for the tab. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// True while the tab is not loaded with content. [JsonPropertyName("discarded")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Discarded - { - get - { - InitializeProperty("discarded", _discarded); - return _discarded; - } - set - { - _discarded = value; - } - } + public bool? Discarded { get; set; } /// The URL of the tab's favicon. This property is only present if the extension's manifest includes the "tabs" permission. It may also be an empty string if the tab is loading. [JsonPropertyName("favIconUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string FavIconUrl - { - get - { - InitializeProperty("favIconUrl", _favIconUrl); - return _favIconUrl; - } - set - { - _favIconUrl = value; - } - } + public string FavIconUrl { get; set; } /// The height of the tab in pixels. [JsonPropertyName("height")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Height - { - get - { - InitializeProperty("height", _height); - return _height; - } - set - { - _height = value; - } - } + public int? Height { get; set; } /// True if the tab is hidden. [JsonPropertyName("hidden")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Hidden - { - get - { - InitializeProperty("hidden", _hidden); - return _hidden; - } - set - { - _hidden = value; - } - } + public bool? Hidden { get; set; } /// Whether the tab is highlighted. Works as an alias of active [JsonPropertyName("highlighted")] - public bool Highlighted - { - get - { - InitializeProperty("highlighted", _highlighted); - return _highlighted; - } - set - { - _highlighted = value; - } - } + public bool Highlighted { get; set; } /// The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a Tab may not be assigned an ID, for example when querying foreign tabs using the $(ref:sessions) API, in which case a session ID may be present. Tab ID can also be set to $(ref:tabs.TAB_ID_NONE) for apps and devtools windows. [JsonPropertyName("id")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Id - { - get - { - InitializeProperty("id", _id); - return _id; - } - set - { - _id = value; - } - } + public int? Id { get; set; } /// Whether the tab is in an incognito window. [JsonPropertyName("incognito")] - public bool Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool Incognito { get; set; } /// The zero-based index of the tab within its window. [JsonPropertyName("index")] - public int Index - { - get - { - InitializeProperty("index", _index); - return _index; - } - set - { - _index = value; - } - } + public int Index { get; set; } /// Whether the document in the tab can be rendered in reader mode. [JsonPropertyName("isArticle")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? IsArticle - { - get - { - InitializeProperty("isArticle", _isArticle); - return _isArticle; - } - set - { - _isArticle = value; - } - } + public bool? IsArticle { get; set; } /// Whether the document in the tab is being rendered in reader mode. [JsonPropertyName("isInReaderMode")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? IsInReaderMode - { - get - { - InitializeProperty("isInReaderMode", _isInReaderMode); - return _isInReaderMode; - } - set - { - _isInReaderMode = value; - } - } + public bool? IsInReaderMode { get; set; } /// The last time the tab was accessed as the number of milliseconds since epoch. [JsonPropertyName("lastAccessed")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public EpochTime? LastAccessed - { - get - { - InitializeProperty("lastAccessed", _lastAccessed); - return _lastAccessed; - } - set - { - _lastAccessed = value; - } - } + public EpochTime? LastAccessed { get; set; } /// Current tab muted state and the reason for the last state change. [JsonPropertyName("mutedInfo")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public MutedInfo MutedInfo - { - get - { - InitializeProperty("mutedInfo", _mutedInfo); - return _mutedInfo; - } - set - { - _mutedInfo = value; - } - } + public MutedInfo MutedInfo { get; set; } /// The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists. [JsonPropertyName("openerTabId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? OpenerTabId - { - get - { - InitializeProperty("openerTabId", _openerTabId); - return _openerTabId; - } - set - { - _openerTabId = value; - } - } + public int? OpenerTabId { get; set; } /// Whether the tab is pinned. [JsonPropertyName("pinned")] - public bool Pinned - { - get - { - InitializeProperty("pinned", _pinned); - return _pinned; - } - set - { - _pinned = value; - } - } + public bool Pinned { get; set; } /// The session ID used to uniquely identify a Tab obtained from the $(ref:sessions) API. [JsonPropertyName("sessionId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string SessionId - { - get - { - InitializeProperty("sessionId", _sessionId); - return _sessionId; - } - set - { - _sessionId = value; - } - } + public string SessionId { get; set; } /// Current tab sharing state for screen, microphone and camera. [JsonPropertyName("sharingState")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public SharingState SharingState - { - get - { - InitializeProperty("sharingState", _sharingState); - return _sharingState; - } - set - { - _sharingState = value; - } - } + public SharingState SharingState { get; set; } /// Either loading or complete. [JsonPropertyName("status")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Status - { - get - { - InitializeProperty("status", _status); - return _status; - } - set - { - _status = value; - } - } + public string Status { get; set; } /// The ID of this tab's successor, if any; $(ref:tabs.TAB_ID_NONE) otherwise. [JsonPropertyName("successorTabId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? SuccessorTabId - { - get - { - InitializeProperty("successorTabId", _successorTabId); - return _successorTabId; - } - set - { - _successorTabId = value; - } - } + public int? SuccessorTabId { get; set; } /// The title of the tab. This property is only present if the extension's manifest includes the "tabs" permission. [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// The URL the tab is displaying. This property is only present if the extension's manifest includes the "tabs" permission. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// The width of the tab in pixels. [JsonPropertyName("width")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Width - { - get - { - InitializeProperty("width", _width); - return _width; - } - set - { - _width = value; - } - } + public int? Width { get; set; } /// The ID of the window the tab is contained within. [JsonPropertyName("windowId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int? WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/TabsApi.cs b/src/WebExtensions.Net/Generated/Tabs/TabsApi.cs index f62861d..de71914 100644 --- a/src/WebExtensions.Net/Generated/Tabs/TabsApi.cs +++ b/src/WebExtensions.Net/Generated/Tabs/TabsApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json; using System.Threading.Tasks; @@ -22,8 +23,9 @@ public partial class TabsApi : BaseApi, ITabsApi private OnZoomChangeEvent _onZoomChange; /// Creates a new instance of . - /// Web Extension JS Runtime - public TabsApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "tabs") + /// The JS runtime adapter. + /// The base API access path. + public TabsApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "tabs")) { } @@ -35,7 +37,7 @@ public OnActivatedEvent OnActivated if (_onActivated is null) { _onActivated = new OnActivatedEvent(); - InitializeProperty("onActivated", _onActivated); + _onActivated.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onActivated")); } return _onActivated; } @@ -49,7 +51,7 @@ public OnAttachedEvent OnAttached if (_onAttached is null) { _onAttached = new OnAttachedEvent(); - InitializeProperty("onAttached", _onAttached); + _onAttached.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onAttached")); } return _onAttached; } @@ -63,7 +65,7 @@ public OnCreatedEvent OnCreated if (_onCreated is null) { _onCreated = new OnCreatedEvent(); - InitializeProperty("onCreated", _onCreated); + _onCreated.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onCreated")); } return _onCreated; } @@ -77,7 +79,7 @@ public OnDetachedEvent OnDetached if (_onDetached is null) { _onDetached = new OnDetachedEvent(); - InitializeProperty("onDetached", _onDetached); + _onDetached.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onDetached")); } return _onDetached; } @@ -91,7 +93,7 @@ public OnHighlightedEvent OnHighlighted if (_onHighlighted is null) { _onHighlighted = new OnHighlightedEvent(); - InitializeProperty("onHighlighted", _onHighlighted); + _onHighlighted.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onHighlighted")); } return _onHighlighted; } @@ -105,7 +107,7 @@ public OnMovedEvent OnMoved if (_onMoved is null) { _onMoved = new OnMovedEvent(); - InitializeProperty("onMoved", _onMoved); + _onMoved.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onMoved")); } return _onMoved; } @@ -119,7 +121,7 @@ public OnRemovedEvent OnRemoved if (_onRemoved is null) { _onRemoved = new OnRemovedEvent(); - InitializeProperty("onRemoved", _onRemoved); + _onRemoved.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onRemoved")); } return _onRemoved; } @@ -133,7 +135,7 @@ public OnReplacedEvent OnReplaced if (_onReplaced is null) { _onReplaced = new OnReplacedEvent(); - InitializeProperty("onReplaced", _onReplaced); + _onReplaced.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onReplaced")); } return _onReplaced; } @@ -147,7 +149,7 @@ public OnUpdatedEvent OnUpdated if (_onUpdated is null) { _onUpdated = new OnUpdatedEvent(); - InitializeProperty("onUpdated", _onUpdated); + _onUpdated.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onUpdated")); } return _onUpdated; } @@ -161,7 +163,7 @@ public OnZoomChangeEvent OnZoomChange if (_onZoomChange is null) { _onZoomChange = new OnZoomChangeEvent(); - InitializeProperty("onZoomChange", _onZoomChange); + _onZoomChange.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onZoomChange")); } return _onZoomChange; } diff --git a/src/WebExtensions.Net/Generated/Tabs/UpdateFilter.cs b/src/WebExtensions.Net/Generated/Tabs/UpdateFilter.cs index 78ee8de..20a118b 100644 --- a/src/WebExtensions.Net/Generated/Tabs/UpdateFilter.cs +++ b/src/WebExtensions.Net/Generated/Tabs/UpdateFilter.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,75 +6,27 @@ namespace WebExtensions.Net.Tabs { // Type Class /// An object describing filters to apply to tabs.onUpdated events. + [BindAllProperties] public partial class UpdateFilter : BaseObject { - private IEnumerable _properties; - private int? _tabId; - private IEnumerable _urls; - private int? _windowId; - /// A list of property names. Events that do not match any of the names will be filtered out. [JsonPropertyName("properties")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Properties - { - get - { - InitializeProperty("properties", _properties); - return _properties; - } - set - { - _properties = value; - } - } + public IEnumerable Properties { get; set; } /// [JsonPropertyName("tabId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int? TabId { get; set; } /// A list of URLs or URL patterns. Events that cannot match any of the URLs will be filtered out. Filtering with urls requires the "tabs" or "activeTab" permission. [JsonPropertyName("urls")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Urls - { - get - { - InitializeProperty("urls", _urls); - return _urls; - } - set - { - _urls = value; - } - } + public IEnumerable Urls { get; set; } /// [JsonPropertyName("windowId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int? WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/UpdateProperties.cs b/src/WebExtensions.Net/Generated/Tabs/UpdateProperties.cs index 27432b1..b2cc4f0 100644 --- a/src/WebExtensions.Net/Generated/Tabs/UpdateProperties.cs +++ b/src/WebExtensions.Net/Generated/Tabs/UpdateProperties.cs @@ -1,146 +1,51 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// + [BindAllProperties] public partial class UpdateProperties : BaseObject { - private bool? _active; - private bool? _highlighted; - private bool? _loadReplace; - private bool? _muted; - private int? _openerTabId; - private bool? _pinned; - private int? _successorTabId; - private string _url; - /// Whether the tab should be active. Does not affect whether the window is focused (see $(ref:windows.update)). [JsonPropertyName("active")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Active - { - get - { - InitializeProperty("active", _active); - return _active; - } - set - { - _active = value; - } - } + public bool? Active { get; set; } /// Adds or removes the tab from the current selection. [JsonPropertyName("highlighted")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Highlighted - { - get - { - InitializeProperty("highlighted", _highlighted); - return _highlighted; - } - set - { - _highlighted = value; - } - } + public bool? Highlighted { get; set; } /// Whether the load should replace the current history entry for the tab. [JsonPropertyName("loadReplace")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? LoadReplace - { - get - { - InitializeProperty("loadReplace", _loadReplace); - return _loadReplace; - } - set - { - _loadReplace = value; - } - } + public bool? LoadReplace { get; set; } /// Whether the tab should be muted. [JsonPropertyName("muted")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Muted - { - get - { - InitializeProperty("muted", _muted); - return _muted; - } - set - { - _muted = value; - } - } + public bool? Muted { get; set; } /// The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab. [JsonPropertyName("openerTabId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? OpenerTabId - { - get - { - InitializeProperty("openerTabId", _openerTabId); - return _openerTabId; - } - set - { - _openerTabId = value; - } - } + public int? OpenerTabId { get; set; } /// Whether the tab should be pinned. [JsonPropertyName("pinned")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Pinned - { - get - { - InitializeProperty("pinned", _pinned); - return _pinned; - } - set - { - _pinned = value; - } - } + public bool? Pinned { get; set; } /// The ID of this tab's successor. If specified, the successor tab must be in the same window as this tab. [JsonPropertyName("successorTabId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? SuccessorTabId - { - get - { - InitializeProperty("successorTabId", _successorTabId); - return _successorTabId; - } - set - { - _successorTabId = value; - } - } + public int? SuccessorTabId { get; set; } /// A URL to navigate the tab to. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Tabs/ZoomSettings.cs b/src/WebExtensions.Net/Generated/Tabs/ZoomSettings.cs index a8f6a3a..ee63248 100644 --- a/src/WebExtensions.Net/Generated/Tabs/ZoomSettings.cs +++ b/src/WebExtensions.Net/Generated/Tabs/ZoomSettings.cs @@ -1,61 +1,26 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Tabs { // Type Class /// Defines how zoom changes in a tab are handled and at what scope. + [BindAllProperties] public partial class ZoomSettings : BaseObject { - private double? _defaultZoomFactor; - private ZoomSettingsMode? _mode; - private ZoomSettingsScope? _scope; - /// Used to return the default zoom level for the current tab in calls to tabs.getZoomSettings. [JsonPropertyName("defaultZoomFactor")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public double? DefaultZoomFactor - { - get - { - InitializeProperty("defaultZoomFactor", _defaultZoomFactor); - return _defaultZoomFactor; - } - set - { - _defaultZoomFactor = value; - } - } + public double? DefaultZoomFactor { get; set; } /// Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to automatic. [JsonPropertyName("mode")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ZoomSettingsMode? Mode - { - get - { - InitializeProperty("mode", _mode); - return _mode; - } - set - { - _mode = value; - } - } + public ZoomSettingsMode? Mode { get; set; } /// Defines whether zoom changes will persist for the page's origin, or only take effect in this tab; defaults to per-origin when in automatic mode, and per-tab otherwise. [JsonPropertyName("scope")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public ZoomSettingsScope? Scope - { - get - { - InitializeProperty("scope", _scope); - return _scope; - } - set - { - _scope = value; - } - } + public ZoomSettingsScope? Scope { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/TopSites/MostVisitedURL.cs b/src/WebExtensions.Net/Generated/TopSites/MostVisitedURL.cs index 2e5dbc3..0f1941a 100644 --- a/src/WebExtensions.Net/Generated/TopSites/MostVisitedURL.cs +++ b/src/WebExtensions.Net/Generated/TopSites/MostVisitedURL.cs @@ -1,78 +1,31 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.TopSites { // Type Class /// An object encapsulating a most visited URL, such as the URLs on the new tab page. + [BindAllProperties] public partial class MostVisitedURL : BaseObject { - private string _favicon; - private string _title; - private string _type; - private string _url; - /// Data URL for the favicon, if available. [JsonPropertyName("favicon")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Favicon - { - get - { - InitializeProperty("favicon", _favicon); - return _favicon; - } - set - { - _favicon = value; - } - } + public string Favicon { get; set; } /// The title of the page. [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// The entry type, either url for a normal page link, or search for a search shortcut. [JsonPropertyName("type")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public string Type { get; set; } /// The most visited URL. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/TopSites/Options.cs b/src/WebExtensions.Net/Generated/TopSites/Options.cs index d14abf1..b2b6697 100644 --- a/src/WebExtensions.Net/Generated/TopSites/Options.cs +++ b/src/WebExtensions.Net/Generated/TopSites/Options.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -6,144 +7,48 @@ namespace WebExtensions.Net.TopSites { // Type Class /// + [BindAllProperties] public partial class Options : BaseObject { - private bool? _includeBlocked; - private bool? _includeFavicon; - private bool? _includePinned; - private bool? _includeSearchShortcuts; - private int? _limit; - private bool? _newtab; - private bool? _onePerDomain; - private IEnumerable _providers; - /// Include sites that the user has blocked from appearing on the Firefox new tab. [JsonPropertyName("includeBlocked")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? IncludeBlocked - { - get - { - InitializeProperty("includeBlocked", _includeBlocked); - return _includeBlocked; - } - set - { - _includeBlocked = value; - } - } + public bool? IncludeBlocked { get; set; } /// Include sites favicon if available. [JsonPropertyName("includeFavicon")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? IncludeFavicon - { - get - { - InitializeProperty("includeFavicon", _includeFavicon); - return _includeFavicon; - } - set - { - _includeFavicon = value; - } - } + public bool? IncludeFavicon { get; set; } /// Include sites that the user has pinned on the Firefox new tab. [JsonPropertyName("includePinned")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? IncludePinned - { - get - { - InitializeProperty("includePinned", _includePinned); - return _includePinned; - } - set - { - _includePinned = value; - } - } + public bool? IncludePinned { get; set; } /// Include search shortcuts appearing on the Firefox new tab. [JsonPropertyName("includeSearchShortcuts")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? IncludeSearchShortcuts - { - get - { - InitializeProperty("includeSearchShortcuts", _includeSearchShortcuts); - return _includeSearchShortcuts; - } - set - { - _includeSearchShortcuts = value; - } - } + public bool? IncludeSearchShortcuts { get; set; } /// The number of top sites to return, defaults to the value used by Firefox [JsonPropertyName("limit")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Limit - { - get - { - InitializeProperty("limit", _limit); - return _limit; - } - set - { - _limit = value; - } - } + public int? Limit { get; set; } /// Return the sites that exactly appear on the user's new-tab page. When true, all other options are ignored except limit and includeFavicon. If the user disabled newtab Top Sites, the newtab parameter will be ignored. [JsonPropertyName("newtab")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Newtab - { - get - { - InitializeProperty("newtab", _newtab); - return _newtab; - } - set - { - _newtab = value; - } - } + public bool? Newtab { get; set; } /// Limit the result to a single top site link per domain [JsonPropertyName("onePerDomain")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? OnePerDomain - { - get - { - InitializeProperty("onePerDomain", _onePerDomain); - return _onePerDomain; - } - set - { - _onePerDomain = value; - } - } + public bool? OnePerDomain { get; set; } /// [Obsolete("Please use the other options to tune the results received from topSites.")] [JsonPropertyName("providers")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Providers - { - get - { - InitializeProperty("providers", _providers); - return _providers; - } - set - { - _providers = value; - } - } + public IEnumerable Providers { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/TopSites/TopSitesApi.cs b/src/WebExtensions.Net/Generated/TopSites/TopSitesApi.cs index 2570790..f5fa805 100644 --- a/src/WebExtensions.Net/Generated/TopSites/TopSitesApi.cs +++ b/src/WebExtensions.Net/Generated/TopSites/TopSitesApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Threading.Tasks; @@ -7,8 +8,9 @@ namespace WebExtensions.Net.TopSites public partial class TopSitesApi : BaseApi, ITopSitesApi { /// Creates a new instance of . - /// Web Extension JS Runtime - public TopSitesApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "topSites") + /// The JS runtime adapter. + /// The base API access path. + public TopSitesApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "topSites")) { } diff --git a/src/WebExtensions.Net/Generated/Types/CallbackDetails.cs b/src/WebExtensions.Net/Generated/Types/CallbackDetails.cs index 8a799be..46e5941 100644 --- a/src/WebExtensions.Net/Generated/Types/CallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/Types/CallbackDetails.cs @@ -1,60 +1,25 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Types { // Type Class /// Details of the currently effective value. + [BindAllProperties] public partial class CallbackDetails : BaseObject { - private bool? _incognitoSpecific; - private LevelOfControl _levelOfControl; - private object _value; - /// Whether the effective value is specific to the incognito session.
This property will only be present if the incognito property in the details parameter of get() was true.
[JsonPropertyName("incognitoSpecific")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? IncognitoSpecific - { - get - { - InitializeProperty("incognitoSpecific", _incognitoSpecific); - return _incognitoSpecific; - } - set - { - _incognitoSpecific = value; - } - } + public bool? IncognitoSpecific { get; set; } /// The level of control of the setting. [JsonPropertyName("levelOfControl")] - public LevelOfControl LevelOfControl - { - get - { - InitializeProperty("levelOfControl", _levelOfControl); - return _levelOfControl; - } - set - { - _levelOfControl = value; - } - } + public LevelOfControl LevelOfControl { get; set; } /// The value of the setting. [JsonPropertyName("value")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public object Value - { - get - { - InitializeProperty("value", _value); - return _value; - } - set - { - _value = value; - } - } + public object Value { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Types/ClearDetails.cs b/src/WebExtensions.Net/Generated/Types/ClearDetails.cs index 80fb3f6..653a6cf 100644 --- a/src/WebExtensions.Net/Generated/Types/ClearDetails.cs +++ b/src/WebExtensions.Net/Generated/Types/ClearDetails.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Types { // Type Class /// Which setting to clear. + [BindAllProperties] public partial class ClearDetails : BaseObject { - private SettingScope? _scope; - /// Where to clear the setting (default: regular). [JsonPropertyName("scope")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public SettingScope? Scope - { - get - { - InitializeProperty("scope", _scope); - return _scope; - } - set - { - _scope = value; - } - } + public SettingScope? Scope { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Types/GetDetails.cs b/src/WebExtensions.Net/Generated/Types/GetDetails.cs index 4fcb3d4..c6a887b 100644 --- a/src/WebExtensions.Net/Generated/Types/GetDetails.cs +++ b/src/WebExtensions.Net/Generated/Types/GetDetails.cs @@ -1,27 +1,16 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Types { // Type Class /// Which setting to consider. + [BindAllProperties] public partial class GetDetails : BaseObject { - private bool? _incognito; - /// Whether to return the value that applies to the incognito session (default false). [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Types/SetDetails.cs b/src/WebExtensions.Net/Generated/Types/SetDetails.cs index be834f1..c1e90a1 100644 --- a/src/WebExtensions.Net/Generated/Types/SetDetails.cs +++ b/src/WebExtensions.Net/Generated/Types/SetDetails.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Types { // Type Class /// Which setting to change. + [BindAllProperties] public partial class SetDetails : BaseObject { - private SettingScope? _scope; - private object _value; - /// Where to set the setting (default: regular). [JsonPropertyName("scope")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public SettingScope? Scope - { - get - { - InitializeProperty("scope", _scope); - return _scope; - } - set - { - _scope = value; - } - } + public SettingScope? Scope { get; set; } /// The value of the setting.
Note that every setting has a specific value type, which is described together with the setting. An extension should not set a value of a different type.
[JsonPropertyName("value")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public object Value - { - get - { - InitializeProperty("value", _value); - return _value; - } - set - { - _value = value; - } - } + public object Value { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Types/Setting.cs b/src/WebExtensions.Net/Generated/Types/Setting.cs index a94d118..84639e2 100644 --- a/src/WebExtensions.Net/Generated/Types/Setting.cs +++ b/src/WebExtensions.Net/Generated/Types/Setting.cs @@ -1,9 +1,11 @@ +using JsBind.Net; using System.Threading.Tasks; namespace WebExtensions.Net.Types { // Type Class /// + [BindAllProperties] public partial class Setting : BaseObject { /// Clears the setting, restoring any default value. diff --git a/src/WebExtensions.Net/Generated/WebExtensionsApi.cs b/src/WebExtensions.Net/Generated/WebExtensionsApi.cs index a1170e3..b13f212 100644 --- a/src/WebExtensions.Net/Generated/WebExtensionsApi.cs +++ b/src/WebExtensions.Net/Generated/WebExtensionsApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using WebExtensions.Net.Alarms; using WebExtensions.Net.Bookmarks; using WebExtensions.Net.BrowserAction; @@ -35,9 +36,8 @@ namespace WebExtensions.Net { /// Web Extension Api - public partial class WebExtensionsApi : IWebExtensionsApi + public partial class WebExtensionsApi : BaseApi, IWebExtensionsApi { - private readonly IWebExtensionsJSRuntime webExtensionsJSRuntime; private IAlarmsApi _alarms; private IBookmarksApi _bookmarks; private IBrowserActionApi _browserAction; @@ -73,9 +73,9 @@ public partial class WebExtensionsApi : IWebExtensionsApi private IWindowsApi _windows; /// Creates a new instance of . - public WebExtensionsApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) + /// The JS runtime adapter. + public WebExtensionsApi(IJsRuntimeAdapter jsRuntime) : base(jsRuntime, "browser") { - this.webExtensionsJSRuntime = webExtensionsJSRuntime; } /// @@ -85,7 +85,7 @@ public IAlarmsApi Alarms { if (_alarms is null) { - _alarms = new AlarmsApi(webExtensionsJSRuntime); + _alarms = new AlarmsApi(JsRuntime, AccessPath); } return _alarms; } @@ -98,7 +98,7 @@ public IBookmarksApi Bookmarks { if (_bookmarks is null) { - _bookmarks = new BookmarksApi(webExtensionsJSRuntime); + _bookmarks = new BookmarksApi(JsRuntime, AccessPath); } return _bookmarks; } @@ -111,7 +111,7 @@ public IBrowserActionApi BrowserAction { if (_browserAction is null) { - _browserAction = new BrowserActionApi(webExtensionsJSRuntime); + _browserAction = new BrowserActionApi(JsRuntime, AccessPath); } return _browserAction; } @@ -124,7 +124,7 @@ public IBrowserSettingsApi BrowserSettings { if (_browserSettings is null) { - _browserSettings = new BrowserSettingsApi(webExtensionsJSRuntime); + _browserSettings = new BrowserSettingsApi(JsRuntime, AccessPath); } return _browserSettings; } @@ -137,7 +137,7 @@ public IBrowsingDataApi BrowsingData { if (_browsingData is null) { - _browsingData = new BrowsingDataApi(webExtensionsJSRuntime); + _browsingData = new BrowsingDataApi(JsRuntime, AccessPath); } return _browsingData; } @@ -150,7 +150,7 @@ public IClipboardApi Clipboard { if (_clipboard is null) { - _clipboard = new ClipboardApi(webExtensionsJSRuntime); + _clipboard = new ClipboardApi(JsRuntime, AccessPath); } return _clipboard; } @@ -163,7 +163,7 @@ public ICommandsApi Commands { if (_commands is null) { - _commands = new CommandsApi(webExtensionsJSRuntime); + _commands = new CommandsApi(JsRuntime, AccessPath); } return _commands; } @@ -176,7 +176,7 @@ public IContentScriptsApi ContentScripts { if (_contentScripts is null) { - _contentScripts = new ContentScriptsApi(webExtensionsJSRuntime); + _contentScripts = new ContentScriptsApi(JsRuntime, AccessPath); } return _contentScripts; } @@ -189,7 +189,7 @@ public ICookiesApi Cookies { if (_cookies is null) { - _cookies = new CookiesApi(webExtensionsJSRuntime); + _cookies = new CookiesApi(JsRuntime, AccessPath); } return _cookies; } @@ -202,7 +202,7 @@ public IDevtoolsApi Devtools { if (_devtools is null) { - _devtools = new DevtoolsApi(webExtensionsJSRuntime); + _devtools = new DevtoolsApi(JsRuntime, AccessPath); } return _devtools; } @@ -215,7 +215,7 @@ public IDownloadsApi Downloads { if (_downloads is null) { - _downloads = new DownloadsApi(webExtensionsJSRuntime); + _downloads = new DownloadsApi(JsRuntime, AccessPath); } return _downloads; } @@ -228,7 +228,7 @@ public IExtensionApi Extension { if (_extension is null) { - _extension = new ExtensionApi(webExtensionsJSRuntime); + _extension = new ExtensionApi(JsRuntime, AccessPath); } return _extension; } @@ -241,7 +241,7 @@ public IHistoryApi History { if (_history is null) { - _history = new HistoryApi(webExtensionsJSRuntime); + _history = new HistoryApi(JsRuntime, AccessPath); } return _history; } @@ -254,7 +254,7 @@ public II18nApi I18n { if (_i18n is null) { - _i18n = new I18nApi(webExtensionsJSRuntime); + _i18n = new I18nApi(JsRuntime, AccessPath); } return _i18n; } @@ -267,7 +267,7 @@ public IIdentityApi Identity { if (_identity is null) { - _identity = new IdentityApi(webExtensionsJSRuntime); + _identity = new IdentityApi(JsRuntime, AccessPath); } return _identity; } @@ -280,7 +280,7 @@ public IIdleApi Idle { if (_idle is null) { - _idle = new IdleApi(webExtensionsJSRuntime); + _idle = new IdleApi(JsRuntime, AccessPath); } return _idle; } @@ -293,7 +293,7 @@ public IManagementApi Management { if (_management is null) { - _management = new ManagementApi(webExtensionsJSRuntime); + _management = new ManagementApi(JsRuntime, AccessPath); } return _management; } @@ -306,7 +306,7 @@ public IMenusApi Menus { if (_menus is null) { - _menus = new MenusApi(webExtensionsJSRuntime); + _menus = new MenusApi(JsRuntime, AccessPath); } return _menus; } @@ -319,7 +319,7 @@ public INotificationsApi Notifications { if (_notifications is null) { - _notifications = new NotificationsApi(webExtensionsJSRuntime); + _notifications = new NotificationsApi(JsRuntime, AccessPath); } return _notifications; } @@ -332,7 +332,7 @@ public IOmniboxApi Omnibox { if (_omnibox is null) { - _omnibox = new OmniboxApi(webExtensionsJSRuntime); + _omnibox = new OmniboxApi(JsRuntime, AccessPath); } return _omnibox; } @@ -345,7 +345,7 @@ public IPageActionApi PageAction { if (_pageAction is null) { - _pageAction = new PageActionApi(webExtensionsJSRuntime); + _pageAction = new PageActionApi(JsRuntime, AccessPath); } return _pageAction; } @@ -358,7 +358,7 @@ public IPermissionsApi Permissions { if (_permissions is null) { - _permissions = new PermissionsApi(webExtensionsJSRuntime); + _permissions = new PermissionsApi(JsRuntime, AccessPath); } return _permissions; } @@ -371,7 +371,7 @@ public IPrivacyApi Privacy { if (_privacy is null) { - _privacy = new PrivacyApi(webExtensionsJSRuntime); + _privacy = new PrivacyApi(JsRuntime, AccessPath); } return _privacy; } @@ -384,7 +384,7 @@ public IProxyApi Proxy { if (_proxy is null) { - _proxy = new ProxyApi(webExtensionsJSRuntime); + _proxy = new ProxyApi(JsRuntime, AccessPath); } return _proxy; } @@ -397,7 +397,7 @@ public IRuntimeApi Runtime { if (_runtime is null) { - _runtime = new RuntimeApi(webExtensionsJSRuntime); + _runtime = new RuntimeApi(JsRuntime, AccessPath); } return _runtime; } @@ -410,7 +410,7 @@ public ISearchApi Search { if (_search is null) { - _search = new SearchApi(webExtensionsJSRuntime); + _search = new SearchApi(JsRuntime, AccessPath); } return _search; } @@ -423,7 +423,7 @@ public ISessionsApi Sessions { if (_sessions is null) { - _sessions = new SessionsApi(webExtensionsJSRuntime); + _sessions = new SessionsApi(JsRuntime, AccessPath); } return _sessions; } @@ -436,7 +436,7 @@ public IStorageApi Storage { if (_storage is null) { - _storage = new StorageApi(webExtensionsJSRuntime); + _storage = new StorageApi(JsRuntime, AccessPath); } return _storage; } @@ -449,7 +449,7 @@ public ITabsApi Tabs { if (_tabs is null) { - _tabs = new TabsApi(webExtensionsJSRuntime); + _tabs = new TabsApi(JsRuntime, AccessPath); } return _tabs; } @@ -462,7 +462,7 @@ public ITopSitesApi TopSites { if (_topSites is null) { - _topSites = new TopSitesApi(webExtensionsJSRuntime); + _topSites = new TopSitesApi(JsRuntime, AccessPath); } return _topSites; } @@ -475,7 +475,7 @@ public IWebNavigationApi WebNavigation { if (_webNavigation is null) { - _webNavigation = new WebNavigationApi(webExtensionsJSRuntime); + _webNavigation = new WebNavigationApi(JsRuntime, AccessPath); } return _webNavigation; } @@ -488,7 +488,7 @@ public IWebRequestApi WebRequest { if (_webRequest is null) { - _webRequest = new WebRequestApi(webExtensionsJSRuntime); + _webRequest = new WebRequestApi(JsRuntime, AccessPath); } return _webRequest; } @@ -501,7 +501,7 @@ public IWindowsApi Windows { if (_windows is null) { - _windows = new WindowsApi(webExtensionsJSRuntime); + _windows = new WindowsApi(JsRuntime, AccessPath); } return _windows; } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/DetailsArrayItem.cs b/src/WebExtensions.Net/Generated/WebNavigation/DetailsArrayItem.cs index 8f61578..51366df 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/DetailsArrayItem.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/DetailsArrayItem.cs @@ -1,92 +1,33 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class DetailsArrayItem : BaseObject { - private bool? _errorOccurred; - private int _frameId; - private int _parentFrameId; - private int _tabId; - private string _url; - /// True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired. [JsonPropertyName("errorOccurred")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? ErrorOccurred - { - get - { - InitializeProperty("errorOccurred", _errorOccurred); - return _errorOccurred; - } - set - { - _errorOccurred = value; - } - } + public bool? ErrorOccurred { get; set; } /// The ID of the frame. 0 indicates that this is the main frame; a positive value indicates the ID of a subframe. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// ID of frame that wraps the frame. Set to -1 of no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The ID of the tab in which the frame is. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The URL currently associated with this frame. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/EventUrlFilters.cs b/src/WebExtensions.Net/Generated/WebNavigation/EventUrlFilters.cs index 68a36d0..58bbe35 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/EventUrlFilters.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/EventUrlFilters.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; using WebExtensions.Net.Events; @@ -6,24 +7,12 @@ namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class EventUrlFilters : BaseObject { - private IEnumerable _url; - /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public IEnumerable Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/GetAllFramesDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/GetAllFramesDetails.cs index ecdb940..3224922 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/GetAllFramesDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/GetAllFramesDetails.cs @@ -1,26 +1,15 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// Information about the tab to retrieve all frames from. + [BindAllProperties] public partial class GetAllFramesDetails : BaseObject { - private int _tabId; - /// The ID of the tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/GetFrameCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/GetFrameCallbackDetails.cs index ac0d6bf..9ab6620 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/GetFrameCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/GetFrameCallbackDetails.cs @@ -1,92 +1,33 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// Information about the requested frame, null if the specified frame ID and/or tab ID are invalid. + [BindAllProperties] public partial class GetFrameCallbackDetails : BaseObject { - private bool? _errorOccurred; - private int _frameId; - private int _parentFrameId; - private int _tabId; - private string _url; - /// True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired. [JsonPropertyName("errorOccurred")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? ErrorOccurred - { - get - { - InitializeProperty("errorOccurred", _errorOccurred); - return _errorOccurred; - } - set - { - _errorOccurred = value; - } - } + public bool? ErrorOccurred { get; set; } /// The ID of the frame. 0 indicates that this is the main frame; a positive value indicates the ID of a subframe. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// ID of frame that wraps the frame. Set to -1 of no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The ID of the tab in which the frame is. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The URL currently associated with this frame, if the frame identified by the frameId existed at one point in the given tab. The fact that an URL is associated with a given frameId does not imply that the corresponding frame still exists. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/GetFrameDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/GetFrameDetails.cs index 3f0527f..64f8ced 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/GetFrameDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/GetFrameDetails.cs @@ -1,59 +1,24 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// Information about the frame to retrieve information about. + [BindAllProperties] public partial class GetFrameDetails : BaseObject { - private int _frameId; - private int? _processId; - private int _tabId; - /// The ID of the frame in the given tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the process runs the renderer for this tab. [JsonPropertyName("processId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? ProcessId - { - get - { - InitializeProperty("processId", _processId); - return _processId; - } - set - { - _processId = value; - } - } + public int? ProcessId { get; set; } /// The ID of the tab in which the frame is. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnBeforeNavigateEvent.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnBeforeNavigateEvent.cs index b3e0eea..77f6c57 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnBeforeNavigateEvent.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnBeforeNavigateEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.WebNavigation { // Type Class /// Fired when a navigation is about to occur. + [BindAllProperties] public partial class OnBeforeNavigateEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnBeforeNavigateEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnBeforeNavigateEventAddListenerCallbackDetails.cs index 68ed0ff..3d4a656 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnBeforeNavigateEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnBeforeNavigateEventAddListenerCallbackDetails.cs @@ -1,91 +1,32 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnBeforeNavigateEventAddListenerCallbackDetails : BaseObject { - private int _frameId; - private int _parentFrameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique for a given tab and process. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// ID of frame that wraps the frame. Set to -1 of no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The ID of the tab in which the navigation is about to occur. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the browser was about to start the navigation, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnBeforeNavigateEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnBeforeNavigateEventHasListenerCallbackDetails.cs index c173fd6..75456e2 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnBeforeNavigateEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnBeforeNavigateEventHasListenerCallbackDetails.cs @@ -1,91 +1,32 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnBeforeNavigateEventHasListenerCallbackDetails : BaseObject { - private int _frameId; - private int _parentFrameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique for a given tab and process. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// ID of frame that wraps the frame. Set to -1 of no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The ID of the tab in which the navigation is about to occur. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the browser was about to start the navigation, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnBeforeNavigateEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnBeforeNavigateEventRemoveListenerCallbackDetails.cs index 9855335..a553c71 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnBeforeNavigateEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnBeforeNavigateEventRemoveListenerCallbackDetails.cs @@ -1,91 +1,32 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnBeforeNavigateEventRemoveListenerCallbackDetails : BaseObject { - private int _frameId; - private int _parentFrameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique for a given tab and process. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// ID of frame that wraps the frame. Set to -1 of no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The ID of the tab in which the navigation is about to occur. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the browser was about to start the navigation, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnCommittedEvent.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnCommittedEvent.cs index 38f1b8e..3d33c52 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnCommittedEvent.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnCommittedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.WebNavigation { // Type Class /// Fired when a navigation is committed. The document (and the resources it refers to, such as images and subframes) might still be downloading, but at least part of the document has been received from the server and the browser has decided to switch to the new document. + [BindAllProperties] public partial class OnCommittedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnCommittedEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnCommittedEventAddListenerCallbackDetails.cs index 5d294f9..9ce5be2 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnCommittedEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnCommittedEventAddListenerCallbackDetails.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnCommittedEventAddListenerCallbackDetails : BaseObject { - private int _frameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the tab in which the navigation occurs. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the navigation was committed, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnCommittedEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnCommittedEventHasListenerCallbackDetails.cs index 01c9c20..0fa333e 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnCommittedEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnCommittedEventHasListenerCallbackDetails.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnCommittedEventHasListenerCallbackDetails : BaseObject { - private int _frameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the tab in which the navigation occurs. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the navigation was committed, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnCommittedEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnCommittedEventRemoveListenerCallbackDetails.cs index 918d006..93777d3 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnCommittedEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnCommittedEventRemoveListenerCallbackDetails.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnCommittedEventRemoveListenerCallbackDetails : BaseObject { - private int _frameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the tab in which the navigation occurs. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the navigation was committed, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnCompletedEvent.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnCompletedEvent.cs index cdce0cb..96086a2 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnCompletedEvent.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnCompletedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.WebNavigation { // Type Class /// Fired when a document, including the resources it refers to, is completely loaded and initialized. + [BindAllProperties] public partial class OnCompletedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnCompletedEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnCompletedEventAddListenerCallbackDetails.cs index c9d07f0..b42ec54 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnCompletedEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnCompletedEventAddListenerCallbackDetails.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnCompletedEventAddListenerCallbackDetails : BaseObject { - private int _frameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the tab in which the navigation occurs. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the document finished loading, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnCompletedEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnCompletedEventHasListenerCallbackDetails.cs index 2401788..e580f5e 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnCompletedEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnCompletedEventHasListenerCallbackDetails.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnCompletedEventHasListenerCallbackDetails : BaseObject { - private int _frameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the tab in which the navigation occurs. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the document finished loading, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnCompletedEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnCompletedEventRemoveListenerCallbackDetails.cs index 0913613..6ca8b93 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnCompletedEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnCompletedEventRemoveListenerCallbackDetails.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnCompletedEventRemoveListenerCallbackDetails : BaseObject { - private int _frameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the tab in which the navigation occurs. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the document finished loading, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnCreatedNavigationTargetEvent.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnCreatedNavigationTargetEvent.cs index 5c9bd77..85e53f0 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnCreatedNavigationTargetEvent.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnCreatedNavigationTargetEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.WebNavigation { // Type Class /// Fired when a new window, or a new tab in an existing window, is created to host a navigation. + [BindAllProperties] public partial class OnCreatedNavigationTargetEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnCreatedNavigationTargetEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnCreatedNavigationTargetEventAddListenerCallbackDetails.cs index e1ef432..f73c0e5 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnCreatedNavigationTargetEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnCreatedNavigationTargetEventAddListenerCallbackDetails.cs @@ -1,107 +1,36 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnCreatedNavigationTargetEventAddListenerCallbackDetails : BaseObject { - private int _sourceFrameId; - private int _sourceProcessId; - private int _sourceTabId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// The ID of the frame with sourceTabId in which the navigation is triggered. 0 indicates the main frame. [JsonPropertyName("sourceFrameId")] - public int SourceFrameId - { - get - { - InitializeProperty("sourceFrameId", _sourceFrameId); - return _sourceFrameId; - } - set - { - _sourceFrameId = value; - } - } + public int SourceFrameId { get; set; } /// The ID of the process runs the renderer for the source tab. [JsonPropertyName("sourceProcessId")] - public int SourceProcessId - { - get - { - InitializeProperty("sourceProcessId", _sourceProcessId); - return _sourceProcessId; - } - set - { - _sourceProcessId = value; - } - } + public int SourceProcessId { get; set; } /// The ID of the tab in which the navigation is triggered. [JsonPropertyName("sourceTabId")] - public int SourceTabId - { - get - { - InitializeProperty("sourceTabId", _sourceTabId); - return _sourceTabId; - } - set - { - _sourceTabId = value; - } - } + public int SourceTabId { get; set; } /// The ID of the tab in which the url is opened [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the browser was about to create a new view, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// The URL to be opened in the new window. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnCreatedNavigationTargetEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnCreatedNavigationTargetEventHasListenerCallbackDetails.cs index 7e6c346..d71a487 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnCreatedNavigationTargetEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnCreatedNavigationTargetEventHasListenerCallbackDetails.cs @@ -1,107 +1,36 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnCreatedNavigationTargetEventHasListenerCallbackDetails : BaseObject { - private int _sourceFrameId; - private int _sourceProcessId; - private int _sourceTabId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// The ID of the frame with sourceTabId in which the navigation is triggered. 0 indicates the main frame. [JsonPropertyName("sourceFrameId")] - public int SourceFrameId - { - get - { - InitializeProperty("sourceFrameId", _sourceFrameId); - return _sourceFrameId; - } - set - { - _sourceFrameId = value; - } - } + public int SourceFrameId { get; set; } /// The ID of the process runs the renderer for the source tab. [JsonPropertyName("sourceProcessId")] - public int SourceProcessId - { - get - { - InitializeProperty("sourceProcessId", _sourceProcessId); - return _sourceProcessId; - } - set - { - _sourceProcessId = value; - } - } + public int SourceProcessId { get; set; } /// The ID of the tab in which the navigation is triggered. [JsonPropertyName("sourceTabId")] - public int SourceTabId - { - get - { - InitializeProperty("sourceTabId", _sourceTabId); - return _sourceTabId; - } - set - { - _sourceTabId = value; - } - } + public int SourceTabId { get; set; } /// The ID of the tab in which the url is opened [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the browser was about to create a new view, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// The URL to be opened in the new window. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnCreatedNavigationTargetEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnCreatedNavigationTargetEventRemoveListenerCallbackDetails.cs index a8eee0f..89ee2c3 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnCreatedNavigationTargetEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnCreatedNavigationTargetEventRemoveListenerCallbackDetails.cs @@ -1,107 +1,36 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnCreatedNavigationTargetEventRemoveListenerCallbackDetails : BaseObject { - private int _sourceFrameId; - private int _sourceProcessId; - private int _sourceTabId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// The ID of the frame with sourceTabId in which the navigation is triggered. 0 indicates the main frame. [JsonPropertyName("sourceFrameId")] - public int SourceFrameId - { - get - { - InitializeProperty("sourceFrameId", _sourceFrameId); - return _sourceFrameId; - } - set - { - _sourceFrameId = value; - } - } + public int SourceFrameId { get; set; } /// The ID of the process runs the renderer for the source tab. [JsonPropertyName("sourceProcessId")] - public int SourceProcessId - { - get - { - InitializeProperty("sourceProcessId", _sourceProcessId); - return _sourceProcessId; - } - set - { - _sourceProcessId = value; - } - } + public int SourceProcessId { get; set; } /// The ID of the tab in which the navigation is triggered. [JsonPropertyName("sourceTabId")] - public int SourceTabId - { - get - { - InitializeProperty("sourceTabId", _sourceTabId); - return _sourceTabId; - } - set - { - _sourceTabId = value; - } - } + public int SourceTabId { get; set; } /// The ID of the tab in which the url is opened [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the browser was about to create a new view, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// The URL to be opened in the new window. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnDomContentLoadedEvent.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnDomContentLoadedEvent.cs index 484deb3..c41c3bc 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnDomContentLoadedEvent.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnDomContentLoadedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.WebNavigation { // Type Class /// Fired when the page's DOM is fully constructed, but the referenced resources may not finish loading. + [BindAllProperties] public partial class OnDomContentLoadedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnDomContentLoadedEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnDomContentLoadedEventAddListenerCallbackDetails.cs index 104d2be..2332218 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnDomContentLoadedEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnDomContentLoadedEventAddListenerCallbackDetails.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnDomContentLoadedEventAddListenerCallbackDetails : BaseObject { - private int _frameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the tab in which the navigation occurs. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the page's DOM was fully constructed, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnDomContentLoadedEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnDomContentLoadedEventHasListenerCallbackDetails.cs index 2ad7f7e..7ebf7a8 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnDomContentLoadedEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnDomContentLoadedEventHasListenerCallbackDetails.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnDomContentLoadedEventHasListenerCallbackDetails : BaseObject { - private int _frameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the tab in which the navigation occurs. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the page's DOM was fully constructed, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnDomContentLoadedEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnDomContentLoadedEventRemoveListenerCallbackDetails.cs index 037b7fa..0402806 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnDomContentLoadedEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnDomContentLoadedEventRemoveListenerCallbackDetails.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnDomContentLoadedEventRemoveListenerCallbackDetails : BaseObject { - private int _frameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the tab in which the navigation occurs. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the page's DOM was fully constructed, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnErrorOccurredEvent.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnErrorOccurredEvent.cs index 441e897..9bf97dd 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnErrorOccurredEvent.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnErrorOccurredEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.WebNavigation { // Type Class /// Fired when an error occurs and the navigation is aborted. This can happen if either a network error occurred, or the user aborted the navigation. + [BindAllProperties] public partial class OnErrorOccurredEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnErrorOccurredEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnErrorOccurredEventAddListenerCallbackDetails.cs index efc41ab..cb3a633 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnErrorOccurredEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnErrorOccurredEventAddListenerCallbackDetails.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnErrorOccurredEventAddListenerCallbackDetails : BaseObject { - private int _frameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the tab in which the navigation occurs. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the error occurred, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnErrorOccurredEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnErrorOccurredEventHasListenerCallbackDetails.cs index 5c96471..0752d23 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnErrorOccurredEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnErrorOccurredEventHasListenerCallbackDetails.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnErrorOccurredEventHasListenerCallbackDetails : BaseObject { - private int _frameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the tab in which the navigation occurs. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the error occurred, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnErrorOccurredEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnErrorOccurredEventRemoveListenerCallbackDetails.cs index 992354c..85955d0 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnErrorOccurredEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnErrorOccurredEventRemoveListenerCallbackDetails.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnErrorOccurredEventRemoveListenerCallbackDetails : BaseObject { - private int _frameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the tab in which the navigation occurs. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the error occurred, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnHistoryStateUpdatedEvent.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnHistoryStateUpdatedEvent.cs index e5dfb09..cc29fa0 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnHistoryStateUpdatedEvent.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnHistoryStateUpdatedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.WebNavigation { // Type Class /// Fired when the frame's history was updated to a new URL. All future events for that frame will use the updated URL. + [BindAllProperties] public partial class OnHistoryStateUpdatedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnHistoryStateUpdatedEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnHistoryStateUpdatedEventAddListenerCallbackDetails.cs index 66bde5e..391ebe4 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnHistoryStateUpdatedEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnHistoryStateUpdatedEventAddListenerCallbackDetails.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnHistoryStateUpdatedEventAddListenerCallbackDetails : BaseObject { - private int _frameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the tab in which the navigation occurs. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the navigation was committed, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnHistoryStateUpdatedEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnHistoryStateUpdatedEventHasListenerCallbackDetails.cs index e5eb9bf..a664123 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnHistoryStateUpdatedEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnHistoryStateUpdatedEventHasListenerCallbackDetails.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnHistoryStateUpdatedEventHasListenerCallbackDetails : BaseObject { - private int _frameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the tab in which the navigation occurs. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the navigation was committed, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnHistoryStateUpdatedEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnHistoryStateUpdatedEventRemoveListenerCallbackDetails.cs index 2ededd0..3a9bd0f 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnHistoryStateUpdatedEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnHistoryStateUpdatedEventRemoveListenerCallbackDetails.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnHistoryStateUpdatedEventRemoveListenerCallbackDetails : BaseObject { - private int _frameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the tab in which the navigation occurs. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the navigation was committed, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnReferenceFragmentUpdatedEvent.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnReferenceFragmentUpdatedEvent.cs index e5bb45f..dcfe52d 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnReferenceFragmentUpdatedEvent.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnReferenceFragmentUpdatedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.WebNavigation { // Type Class /// Fired when the reference fragment of a frame was updated. All future events for that frame will use the updated URL. + [BindAllProperties] public partial class OnReferenceFragmentUpdatedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnReferenceFragmentUpdatedEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnReferenceFragmentUpdatedEventAddListenerCallbackDetails.cs index 74a919b..05bda12 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnReferenceFragmentUpdatedEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnReferenceFragmentUpdatedEventAddListenerCallbackDetails.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnReferenceFragmentUpdatedEventAddListenerCallbackDetails : BaseObject { - private int _frameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the tab in which the navigation occurs. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the navigation was committed, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnReferenceFragmentUpdatedEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnReferenceFragmentUpdatedEventHasListenerCallbackDetails.cs index 652a567..e041352 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnReferenceFragmentUpdatedEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnReferenceFragmentUpdatedEventHasListenerCallbackDetails.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnReferenceFragmentUpdatedEventHasListenerCallbackDetails : BaseObject { - private int _frameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the tab in which the navigation occurs. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the navigation was committed, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnReferenceFragmentUpdatedEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnReferenceFragmentUpdatedEventRemoveListenerCallbackDetails.cs index 3b1dd8e..b538739 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnReferenceFragmentUpdatedEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnReferenceFragmentUpdatedEventRemoveListenerCallbackDetails.cs @@ -1,75 +1,28 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnReferenceFragmentUpdatedEventRemoveListenerCallbackDetails : BaseObject { - private int _frameId; - private int _tabId; - private EpochTime _timeStamp; - private string _url; - /// 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// The ID of the tab in which the navigation occurs. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the navigation was committed, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnTabReplacedEvent.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnTabReplacedEvent.cs index 037b06f..44d1207 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnTabReplacedEvent.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnTabReplacedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.WebNavigation { // Type Class /// Fired when the contents of the tab is replaced by a different (usually previously pre-rendered) tab. + [BindAllProperties] public partial class OnTabReplacedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnTabReplacedEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnTabReplacedEventAddListenerCallbackDetails.cs index 008d903..0c8d092 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnTabReplacedEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnTabReplacedEventAddListenerCallbackDetails.cs @@ -1,58 +1,23 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnTabReplacedEventAddListenerCallbackDetails : BaseObject { - private int _replacedTabId; - private int _tabId; - private EpochTime _timeStamp; - /// The ID of the tab that was replaced. [JsonPropertyName("replacedTabId")] - public int ReplacedTabId - { - get - { - InitializeProperty("replacedTabId", _replacedTabId); - return _replacedTabId; - } - set - { - _replacedTabId = value; - } - } + public int ReplacedTabId { get; set; } /// The ID of the tab that replaced the old tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the replacement happened, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnTabReplacedEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnTabReplacedEventHasListenerCallbackDetails.cs index ea69289..b7b27d9 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnTabReplacedEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnTabReplacedEventHasListenerCallbackDetails.cs @@ -1,58 +1,23 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnTabReplacedEventHasListenerCallbackDetails : BaseObject { - private int _replacedTabId; - private int _tabId; - private EpochTime _timeStamp; - /// The ID of the tab that was replaced. [JsonPropertyName("replacedTabId")] - public int ReplacedTabId - { - get - { - InitializeProperty("replacedTabId", _replacedTabId); - return _replacedTabId; - } - set - { - _replacedTabId = value; - } - } + public int ReplacedTabId { get; set; } /// The ID of the tab that replaced the old tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the replacement happened, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/OnTabReplacedEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebNavigation/OnTabReplacedEventRemoveListenerCallbackDetails.cs index cb7f016..972c8b6 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/OnTabReplacedEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/OnTabReplacedEventRemoveListenerCallbackDetails.cs @@ -1,58 +1,23 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebNavigation { // Type Class /// + [BindAllProperties] public partial class OnTabReplacedEventRemoveListenerCallbackDetails : BaseObject { - private int _replacedTabId; - private int _tabId; - private EpochTime _timeStamp; - /// The ID of the tab that was replaced. [JsonPropertyName("replacedTabId")] - public int ReplacedTabId - { - get - { - InitializeProperty("replacedTabId", _replacedTabId); - return _replacedTabId; - } - set - { - _replacedTabId = value; - } - } + public int ReplacedTabId { get; set; } /// The ID of the tab that replaced the old tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// The time when the replacement happened, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebNavigation/WebNavigationApi.cs b/src/WebExtensions.Net/Generated/WebNavigation/WebNavigationApi.cs index 20240a5..daa8011 100644 --- a/src/WebExtensions.Net/Generated/WebNavigation/WebNavigationApi.cs +++ b/src/WebExtensions.Net/Generated/WebNavigation/WebNavigationApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Threading.Tasks; @@ -17,8 +18,9 @@ public partial class WebNavigationApi : BaseApi, IWebNavigationApi private OnTabReplacedEvent _onTabReplaced; /// Creates a new instance of . - /// Web Extension JS Runtime - public WebNavigationApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "webNavigation") + /// The JS runtime adapter. + /// The base API access path. + public WebNavigationApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "webNavigation")) { } @@ -30,7 +32,7 @@ public OnBeforeNavigateEvent OnBeforeNavigate if (_onBeforeNavigate is null) { _onBeforeNavigate = new OnBeforeNavigateEvent(); - InitializeProperty("onBeforeNavigate", _onBeforeNavigate); + _onBeforeNavigate.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onBeforeNavigate")); } return _onBeforeNavigate; } @@ -44,7 +46,7 @@ public OnCommittedEvent OnCommitted if (_onCommitted is null) { _onCommitted = new OnCommittedEvent(); - InitializeProperty("onCommitted", _onCommitted); + _onCommitted.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onCommitted")); } return _onCommitted; } @@ -58,7 +60,7 @@ public OnCompletedEvent OnCompleted if (_onCompleted is null) { _onCompleted = new OnCompletedEvent(); - InitializeProperty("onCompleted", _onCompleted); + _onCompleted.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onCompleted")); } return _onCompleted; } @@ -72,7 +74,7 @@ public OnCreatedNavigationTargetEvent OnCreatedNavigationTarget if (_onCreatedNavigationTarget is null) { _onCreatedNavigationTarget = new OnCreatedNavigationTargetEvent(); - InitializeProperty("onCreatedNavigationTarget", _onCreatedNavigationTarget); + _onCreatedNavigationTarget.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onCreatedNavigationTarget")); } return _onCreatedNavigationTarget; } @@ -86,7 +88,7 @@ public OnDomContentLoadedEvent OnDOMContentLoaded if (_onDOMContentLoaded is null) { _onDOMContentLoaded = new OnDomContentLoadedEvent(); - InitializeProperty("onDOMContentLoaded", _onDOMContentLoaded); + _onDOMContentLoaded.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onDOMContentLoaded")); } return _onDOMContentLoaded; } @@ -100,7 +102,7 @@ public OnErrorOccurredEvent OnErrorOccurred if (_onErrorOccurred is null) { _onErrorOccurred = new OnErrorOccurredEvent(); - InitializeProperty("onErrorOccurred", _onErrorOccurred); + _onErrorOccurred.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onErrorOccurred")); } return _onErrorOccurred; } @@ -114,7 +116,7 @@ public OnHistoryStateUpdatedEvent OnHistoryStateUpdated if (_onHistoryStateUpdated is null) { _onHistoryStateUpdated = new OnHistoryStateUpdatedEvent(); - InitializeProperty("onHistoryStateUpdated", _onHistoryStateUpdated); + _onHistoryStateUpdated.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onHistoryStateUpdated")); } return _onHistoryStateUpdated; } @@ -128,7 +130,7 @@ public OnReferenceFragmentUpdatedEvent OnReferenceFragmentUpdated if (_onReferenceFragmentUpdated is null) { _onReferenceFragmentUpdated = new OnReferenceFragmentUpdatedEvent(); - InitializeProperty("onReferenceFragmentUpdated", _onReferenceFragmentUpdated); + _onReferenceFragmentUpdated.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onReferenceFragmentUpdated")); } return _onReferenceFragmentUpdated; } @@ -142,7 +144,7 @@ public OnTabReplacedEvent OnTabReplaced if (_onTabReplaced is null) { _onTabReplaced = new OnTabReplacedEvent(); - InitializeProperty("onTabReplaced", _onTabReplaced); + _onTabReplaced.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onTabReplaced")); } return _onTabReplaced; } diff --git a/src/WebExtensions.Net/Generated/WebRequest/AddListenerCallbackDetailsChallenger.cs b/src/WebExtensions.Net/Generated/WebRequest/AddListenerCallbackDetailsChallenger.cs index eeb5780..7b90081 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/AddListenerCallbackDetailsChallenger.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/AddListenerCallbackDetailsChallenger.cs @@ -1,43 +1,20 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// The server requesting authentication. + [BindAllProperties] public partial class AddListenerCallbackDetailsChallenger : BaseObject { - private string _host; - private int _port; - /// [JsonPropertyName("host")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Host - { - get - { - InitializeProperty("host", _host); - return _host; - } - set - { - _host = value; - } - } + public string Host { get; set; } /// [JsonPropertyName("port")] - public int Port - { - get - { - InitializeProperty("port", _port); - return _port; - } - set - { - _port = value; - } - } + public int Port { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/AddListenerCallbackDetailsRequestBody.cs b/src/WebExtensions.Net/Generated/WebRequest/AddListenerCallbackDetailsRequestBody.cs index b13119f..7a5083b 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/AddListenerCallbackDetailsRequestBody.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/AddListenerCallbackDetailsRequestBody.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,58 +6,22 @@ namespace WebExtensions.Net.WebRequest { // Type Class /// Contains the HTTP request body data. Only provided if extraInfoSpec contains 'requestBody'. + [BindAllProperties] public partial class AddListenerCallbackDetailsRequestBody : BaseObject { - private string _error; - private object _formData; - private IEnumerable _raw; - /// Errors when obtaining request body data. [JsonPropertyName("error")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Error - { - get - { - InitializeProperty("error", _error); - return _error; - } - set - { - _error = value; - } - } + public string Error { get; set; } /// If the request method is POST and the body is a sequence of key-value pairs encoded in UTF8, encoded as either multipart/form-data, or application/x-www-form-urlencoded, this dictionary is present and for each key contains the list of all values for that key. If the data is of another media type, or if it is malformed, the dictionary is not present. An example value of this dictionary is {'key': ['value1', 'value2']}. [JsonPropertyName("formData")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public object FormData - { - get - { - InitializeProperty("formData", _formData); - return _formData; - } - set - { - _formData = value; - } - } + public object FormData { get; set; } /// If the request method is PUT or POST, and the body is not already parsed in formData, then the unparsed request body elements are contained in this array. [JsonPropertyName("raw")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Raw - { - get - { - InitializeProperty("raw", _raw); - return _raw; - } - set - { - _raw = value; - } - } + public IEnumerable Raw { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/AuthCredentials.cs b/src/WebExtensions.Net/Generated/WebRequest/AuthCredentials.cs index 4f73d6e..66ab6f2 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/AuthCredentials.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/AuthCredentials.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// Only used as a response to the onAuthRequired event. If set, the request is made using the supplied credentials. + [BindAllProperties] public partial class AuthCredentials : BaseObject { - private string _password; - private string _username; - /// [JsonPropertyName("password")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Password - { - get - { - InitializeProperty("password", _password); - return _password; - } - set - { - _password = value; - } - } + public string Password { get; set; } /// [JsonPropertyName("username")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Username - { - get - { - InitializeProperty("username", _username); - return _username; - } - set - { - _username = value; - } - } + public string Username { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/BlockingResponse.cs b/src/WebExtensions.Net/Generated/WebRequest/BlockingResponse.cs index 3ae4046..53301c5 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/BlockingResponse.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/BlockingResponse.cs @@ -1,112 +1,41 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// Returns value for event handlers that have the 'blocking' extraInfoSpec applied. Allows the event handler to modify network requests. + [BindAllProperties] public partial class BlockingResponse : BaseObject { - private AuthCredentials _authCredentials; - private bool? _cancel; - private string _redirectUrl; - private HttpHeaders _requestHeaders; - private HttpHeaders _responseHeaders; - private bool? _upgradeToSecure; - /// Only used as a response to the onAuthRequired event. If set, the request is made using the supplied credentials. [JsonPropertyName("authCredentials")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public AuthCredentials AuthCredentials - { - get - { - InitializeProperty("authCredentials", _authCredentials); - return _authCredentials; - } - set - { - _authCredentials = value; - } - } + public AuthCredentials AuthCredentials { get; set; } /// If true, the request is cancelled. Used in onBeforeRequest, this prevents the request from being sent. [JsonPropertyName("cancel")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Cancel - { - get - { - InitializeProperty("cancel", _cancel); - return _cancel; - } - set - { - _cancel = value; - } - } + public bool? Cancel { get; set; } /// Only used as a response to the onBeforeRequest and onHeadersReceived events. If set, the original request is prevented from being sent/completed and is instead redirected to the given URL. Redirections to non-HTTP schemes such as data: are allowed. Redirects initiated by a redirect action use the original request method for the redirect, with one exception: If the redirect is initiated at the onHeadersReceived stage, then the redirect will be issued using the GET method. [JsonPropertyName("redirectUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RedirectUrl - { - get - { - InitializeProperty("redirectUrl", _redirectUrl); - return _redirectUrl; - } - set - { - _redirectUrl = value; - } - } + public string RedirectUrl { get; set; } /// Only used as a response to the onBeforeSendHeaders event. If set, the request is made with these request headers instead. [JsonPropertyName("requestHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders RequestHeaders - { - get - { - InitializeProperty("requestHeaders", _requestHeaders); - return _requestHeaders; - } - set - { - _requestHeaders = value; - } - } + public HttpHeaders RequestHeaders { get; set; } /// Only used as a response to the onHeadersReceived event. If set, the server is assumed to have responded with these response headers instead. Only return responseHeaders if you really want to modify the headers in order to limit the number of conflicts (only one extension may modify responseHeaders for each request). [JsonPropertyName("responseHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders ResponseHeaders - { - get - { - InitializeProperty("responseHeaders", _responseHeaders); - return _responseHeaders; - } - set - { - _responseHeaders = value; - } - } + public HttpHeaders ResponseHeaders { get; set; } /// Only used as a response to the onBeforeRequest event. If set, the original request is prevented from being sent/completed and is instead upgraded to a secure request. If any extension returns redirectUrl during onBeforeRequest, upgradeToSecure will have no affect. [JsonPropertyName("upgradeToSecure")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? UpgradeToSecure - { - get - { - InitializeProperty("upgradeToSecure", _upgradeToSecure); - return _upgradeToSecure; - } - set - { - _upgradeToSecure = value; - } - } + public bool? UpgradeToSecure { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/HasListenerCallbackDetailsChallenger.cs b/src/WebExtensions.Net/Generated/WebRequest/HasListenerCallbackDetailsChallenger.cs index 1f60ac8..57f2e6d 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/HasListenerCallbackDetailsChallenger.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/HasListenerCallbackDetailsChallenger.cs @@ -1,43 +1,20 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// The server requesting authentication. + [BindAllProperties] public partial class HasListenerCallbackDetailsChallenger : BaseObject { - private string _host; - private int _port; - /// [JsonPropertyName("host")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Host - { - get - { - InitializeProperty("host", _host); - return _host; - } - set - { - _host = value; - } - } + public string Host { get; set; } /// [JsonPropertyName("port")] - public int Port - { - get - { - InitializeProperty("port", _port); - return _port; - } - set - { - _port = value; - } - } + public int Port { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/HasListenerCallbackDetailsRequestBody.cs b/src/WebExtensions.Net/Generated/WebRequest/HasListenerCallbackDetailsRequestBody.cs index c53e76f..1c5f756 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/HasListenerCallbackDetailsRequestBody.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/HasListenerCallbackDetailsRequestBody.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,58 +6,22 @@ namespace WebExtensions.Net.WebRequest { // Type Class /// Contains the HTTP request body data. Only provided if extraInfoSpec contains 'requestBody'. + [BindAllProperties] public partial class HasListenerCallbackDetailsRequestBody : BaseObject { - private string _error; - private object _formData; - private IEnumerable _raw; - /// Errors when obtaining request body data. [JsonPropertyName("error")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Error - { - get - { - InitializeProperty("error", _error); - return _error; - } - set - { - _error = value; - } - } + public string Error { get; set; } /// If the request method is POST and the body is a sequence of key-value pairs encoded in UTF8, encoded as either multipart/form-data, or application/x-www-form-urlencoded, this dictionary is present and for each key contains the list of all values for that key. If the data is of another media type, or if it is malformed, the dictionary is not present. An example value of this dictionary is {'key': ['value1', 'value2']}. [JsonPropertyName("formData")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public object FormData - { - get - { - InitializeProperty("formData", _formData); - return _formData; - } - set - { - _formData = value; - } - } + public object FormData { get; set; } /// If the request method is PUT or POST, and the body is not already parsed in formData, then the unparsed request body elements are contained in this array. [JsonPropertyName("raw")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Raw - { - get - { - InitializeProperty("raw", _raw); - return _raw; - } - set - { - _raw = value; - } - } + public IEnumerable Raw { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/HttpHeadersArrayItem.cs b/src/WebExtensions.Net/Generated/WebRequest/HttpHeadersArrayItem.cs index 1b2a2c9..7a2a4ee 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/HttpHeadersArrayItem.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/HttpHeadersArrayItem.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,58 +6,22 @@ namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class HttpHeadersArrayItem : BaseObject { - private IEnumerable _binaryValue; - private string _name; - private string _value; - /// Value of the HTTP header if it cannot be represented by UTF-8, stored as individual byte values (0..255). [JsonPropertyName("binaryValue")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable BinaryValue - { - get - { - InitializeProperty("binaryValue", _binaryValue); - return _binaryValue; - } - set - { - _binaryValue = value; - } - } + public IEnumerable BinaryValue { get; set; } /// Name of the HTTP header. [JsonPropertyName("name")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Name - { - get - { - InitializeProperty("name", _name); - return _name; - } - set - { - _name = value; - } - } + public string Name { get; set; } /// Value of the HTTP header if it can be represented by UTF-8. [JsonPropertyName("value")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Value - { - get - { - InitializeProperty("value", _value); - return _value; - } - set - { - _value = value; - } - } + public string Value { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnAuthRequiredEvent.cs b/src/WebExtensions.Net/Generated/WebRequest/OnAuthRequiredEvent.cs index 1941bb4..8041f16 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnAuthRequiredEvent.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnAuthRequiredEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -7,6 +8,7 @@ namespace WebExtensions.Net.WebRequest { // Type Class /// Fired when an authentication failure is received. The listener has three options: it can provide authentication credentials, it can cancel the request and display the error page, or it can take no action on the challenge. If bad user credentials are provided, this may be called multiple times for the same request. + [BindAllProperties] public partial class OnAuthRequiredEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnAuthRequiredEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnAuthRequiredEventAddListenerCallbackDetails.cs index ae754e4..b07ae2d 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnAuthRequiredEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnAuthRequiredEventAddListenerCallbackDetails.cs @@ -1,359 +1,108 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnAuthRequiredEventAddListenerCallbackDetails : BaseObject { - private AddListenerCallbackDetailsChallenger _challenger; - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool? _incognito; - private bool _isProxy; - private string _method; - private string _originUrl; - private int _parentFrameId; - private string _realm; - private string _requestId; - private HttpHeaders _responseHeaders; - private string _scheme; - private int _statusCode; - private string _statusLine; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The server requesting authentication. [JsonPropertyName("challenger")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public AddListenerCallbackDetailsChallenger Challenger - { - get - { - InitializeProperty("challenger", _challenger); - return _challenger; - } - set - { - _challenger = value; - } - } + public AddListenerCallbackDetailsChallenger Challenger { get; set; } /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// True for Proxy-Authenticate, false for WWW-Authenticate. [JsonPropertyName("isProxy")] - public bool IsProxy - { - get - { - InitializeProperty("isProxy", _isProxy); - return _isProxy; - } - set - { - _isProxy = value; - } - } + public bool IsProxy { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The authentication realm provided by the server, if there is one. [JsonPropertyName("realm")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Realm - { - get - { - InitializeProperty("realm", _realm); - return _realm; - } - set - { - _realm = value; - } - } + public string Realm { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The HTTP response headers that were received along with this response. [JsonPropertyName("responseHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders ResponseHeaders - { - get - { - InitializeProperty("responseHeaders", _responseHeaders); - return _responseHeaders; - } - set - { - _responseHeaders = value; - } - } + public HttpHeaders ResponseHeaders { get; set; } /// The authentication scheme, e.g. Basic or Digest. [JsonPropertyName("scheme")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Scheme - { - get - { - InitializeProperty("scheme", _scheme); - return _scheme; - } - set - { - _scheme = value; - } - } + public string Scheme { get; set; } /// Standard HTTP status code returned by the server. [JsonPropertyName("statusCode")] - public int StatusCode - { - get - { - InitializeProperty("statusCode", _statusCode); - return _statusCode; - } - set - { - _statusCode = value; - } - } + public int StatusCode { get; set; } /// HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers. [JsonPropertyName("statusLine")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StatusLine - { - get - { - InitializeProperty("statusLine", _statusLine); - return _statusLine; - } - set - { - _statusLine = value; - } - } + public string StatusLine { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnAuthRequiredEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnAuthRequiredEventHasListenerCallbackDetails.cs index ca93e51..3572042 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnAuthRequiredEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnAuthRequiredEventHasListenerCallbackDetails.cs @@ -1,359 +1,108 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnAuthRequiredEventHasListenerCallbackDetails : BaseObject { - private HasListenerCallbackDetailsChallenger _challenger; - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool? _incognito; - private bool _isProxy; - private string _method; - private string _originUrl; - private int _parentFrameId; - private string _realm; - private string _requestId; - private HttpHeaders _responseHeaders; - private string _scheme; - private int _statusCode; - private string _statusLine; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The server requesting authentication. [JsonPropertyName("challenger")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HasListenerCallbackDetailsChallenger Challenger - { - get - { - InitializeProperty("challenger", _challenger); - return _challenger; - } - set - { - _challenger = value; - } - } + public HasListenerCallbackDetailsChallenger Challenger { get; set; } /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// True for Proxy-Authenticate, false for WWW-Authenticate. [JsonPropertyName("isProxy")] - public bool IsProxy - { - get - { - InitializeProperty("isProxy", _isProxy); - return _isProxy; - } - set - { - _isProxy = value; - } - } + public bool IsProxy { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The authentication realm provided by the server, if there is one. [JsonPropertyName("realm")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Realm - { - get - { - InitializeProperty("realm", _realm); - return _realm; - } - set - { - _realm = value; - } - } + public string Realm { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The HTTP response headers that were received along with this response. [JsonPropertyName("responseHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders ResponseHeaders - { - get - { - InitializeProperty("responseHeaders", _responseHeaders); - return _responseHeaders; - } - set - { - _responseHeaders = value; - } - } + public HttpHeaders ResponseHeaders { get; set; } /// The authentication scheme, e.g. Basic or Digest. [JsonPropertyName("scheme")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Scheme - { - get - { - InitializeProperty("scheme", _scheme); - return _scheme; - } - set - { - _scheme = value; - } - } + public string Scheme { get; set; } /// Standard HTTP status code returned by the server. [JsonPropertyName("statusCode")] - public int StatusCode - { - get - { - InitializeProperty("statusCode", _statusCode); - return _statusCode; - } - set - { - _statusCode = value; - } - } + public int StatusCode { get; set; } /// HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers. [JsonPropertyName("statusLine")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StatusLine - { - get - { - InitializeProperty("statusLine", _statusLine); - return _statusLine; - } - set - { - _statusLine = value; - } - } + public string StatusLine { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnAuthRequiredEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnAuthRequiredEventRemoveListenerCallbackDetails.cs index 7f05598..7222b62 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnAuthRequiredEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnAuthRequiredEventRemoveListenerCallbackDetails.cs @@ -1,359 +1,108 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnAuthRequiredEventRemoveListenerCallbackDetails : BaseObject { - private RemoveListenerCallbackDetailsChallenger _challenger; - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool? _incognito; - private bool _isProxy; - private string _method; - private string _originUrl; - private int _parentFrameId; - private string _realm; - private string _requestId; - private HttpHeaders _responseHeaders; - private string _scheme; - private int _statusCode; - private string _statusLine; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The server requesting authentication. [JsonPropertyName("challenger")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public RemoveListenerCallbackDetailsChallenger Challenger - { - get - { - InitializeProperty("challenger", _challenger); - return _challenger; - } - set - { - _challenger = value; - } - } + public RemoveListenerCallbackDetailsChallenger Challenger { get; set; } /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// True for Proxy-Authenticate, false for WWW-Authenticate. [JsonPropertyName("isProxy")] - public bool IsProxy - { - get - { - InitializeProperty("isProxy", _isProxy); - return _isProxy; - } - set - { - _isProxy = value; - } - } + public bool IsProxy { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The authentication realm provided by the server, if there is one. [JsonPropertyName("realm")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Realm - { - get - { - InitializeProperty("realm", _realm); - return _realm; - } - set - { - _realm = value; - } - } + public string Realm { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The HTTP response headers that were received along with this response. [JsonPropertyName("responseHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders ResponseHeaders - { - get - { - InitializeProperty("responseHeaders", _responseHeaders); - return _responseHeaders; - } - set - { - _responseHeaders = value; - } - } + public HttpHeaders ResponseHeaders { get; set; } /// The authentication scheme, e.g. Basic or Digest. [JsonPropertyName("scheme")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Scheme - { - get - { - InitializeProperty("scheme", _scheme); - return _scheme; - } - set - { - _scheme = value; - } - } + public string Scheme { get; set; } /// Standard HTTP status code returned by the server. [JsonPropertyName("statusCode")] - public int StatusCode - { - get - { - InitializeProperty("statusCode", _statusCode); - return _statusCode; - } - set - { - _statusCode = value; - } - } + public int StatusCode { get; set; } /// HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers. [JsonPropertyName("statusLine")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StatusLine - { - get - { - InitializeProperty("statusLine", _statusLine); - return _statusLine; - } - set - { - _statusLine = value; - } - } + public string StatusLine { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRedirectEvent.cs b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRedirectEvent.cs index abd4886..7b2aa67 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRedirectEvent.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRedirectEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -7,6 +8,7 @@ namespace WebExtensions.Net.WebRequest { // Type Class /// Fired when a server-initiated redirect is about to occur. + [BindAllProperties] public partial class OnBeforeRedirectEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRedirectEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRedirectEventAddListenerCallbackDetails.cs index 3ee184d..599c6f1 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRedirectEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRedirectEventAddListenerCallbackDetails.cs @@ -1,342 +1,103 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnBeforeRedirectEventAddListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool _fromCache; - private bool? _incognito; - private string _ip; - private string _method; - private string _originUrl; - private int _parentFrameId; - private string _redirectUrl; - private string _requestId; - private HttpHeaders _responseHeaders; - private int _statusCode; - private string _statusLine; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// Indicates if this response was fetched from disk cache. [JsonPropertyName("fromCache")] - public bool FromCache - { - get - { - InitializeProperty("fromCache", _fromCache); - return _fromCache; - } - set - { - _fromCache = value; - } - } + public bool FromCache { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address. [JsonPropertyName("ip")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Ip - { - get - { - InitializeProperty("ip", _ip); - return _ip; - } - set - { - _ip = value; - } - } + public string Ip { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The new URL. [JsonPropertyName("redirectUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RedirectUrl - { - get - { - InitializeProperty("redirectUrl", _redirectUrl); - return _redirectUrl; - } - set - { - _redirectUrl = value; - } - } + public string RedirectUrl { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The HTTP response headers that were received along with this redirect. [JsonPropertyName("responseHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders ResponseHeaders - { - get - { - InitializeProperty("responseHeaders", _responseHeaders); - return _responseHeaders; - } - set - { - _responseHeaders = value; - } - } + public HttpHeaders ResponseHeaders { get; set; } /// Standard HTTP status code returned by the server. [JsonPropertyName("statusCode")] - public int StatusCode - { - get - { - InitializeProperty("statusCode", _statusCode); - return _statusCode; - } - set - { - _statusCode = value; - } - } + public int StatusCode { get; set; } /// HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers. [JsonPropertyName("statusLine")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StatusLine - { - get - { - InitializeProperty("statusLine", _statusLine); - return _statusLine; - } - set - { - _statusLine = value; - } - } + public string StatusLine { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRedirectEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRedirectEventHasListenerCallbackDetails.cs index 52029d5..d8de7ff 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRedirectEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRedirectEventHasListenerCallbackDetails.cs @@ -1,342 +1,103 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnBeforeRedirectEventHasListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool _fromCache; - private bool? _incognito; - private string _ip; - private string _method; - private string _originUrl; - private int _parentFrameId; - private string _redirectUrl; - private string _requestId; - private HttpHeaders _responseHeaders; - private int _statusCode; - private string _statusLine; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// Indicates if this response was fetched from disk cache. [JsonPropertyName("fromCache")] - public bool FromCache - { - get - { - InitializeProperty("fromCache", _fromCache); - return _fromCache; - } - set - { - _fromCache = value; - } - } + public bool FromCache { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address. [JsonPropertyName("ip")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Ip - { - get - { - InitializeProperty("ip", _ip); - return _ip; - } - set - { - _ip = value; - } - } + public string Ip { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The new URL. [JsonPropertyName("redirectUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RedirectUrl - { - get - { - InitializeProperty("redirectUrl", _redirectUrl); - return _redirectUrl; - } - set - { - _redirectUrl = value; - } - } + public string RedirectUrl { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The HTTP response headers that were received along with this redirect. [JsonPropertyName("responseHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders ResponseHeaders - { - get - { - InitializeProperty("responseHeaders", _responseHeaders); - return _responseHeaders; - } - set - { - _responseHeaders = value; - } - } + public HttpHeaders ResponseHeaders { get; set; } /// Standard HTTP status code returned by the server. [JsonPropertyName("statusCode")] - public int StatusCode - { - get - { - InitializeProperty("statusCode", _statusCode); - return _statusCode; - } - set - { - _statusCode = value; - } - } + public int StatusCode { get; set; } /// HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers. [JsonPropertyName("statusLine")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StatusLine - { - get - { - InitializeProperty("statusLine", _statusLine); - return _statusLine; - } - set - { - _statusLine = value; - } - } + public string StatusLine { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRedirectEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRedirectEventRemoveListenerCallbackDetails.cs index 691be38..c92e0f8 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRedirectEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRedirectEventRemoveListenerCallbackDetails.cs @@ -1,342 +1,103 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnBeforeRedirectEventRemoveListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool _fromCache; - private bool? _incognito; - private string _ip; - private string _method; - private string _originUrl; - private int _parentFrameId; - private string _redirectUrl; - private string _requestId; - private HttpHeaders _responseHeaders; - private int _statusCode; - private string _statusLine; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// Indicates if this response was fetched from disk cache. [JsonPropertyName("fromCache")] - public bool FromCache - { - get - { - InitializeProperty("fromCache", _fromCache); - return _fromCache; - } - set - { - _fromCache = value; - } - } + public bool FromCache { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address. [JsonPropertyName("ip")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Ip - { - get - { - InitializeProperty("ip", _ip); - return _ip; - } - set - { - _ip = value; - } - } + public string Ip { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The new URL. [JsonPropertyName("redirectUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RedirectUrl - { - get - { - InitializeProperty("redirectUrl", _redirectUrl); - return _redirectUrl; - } - set - { - _redirectUrl = value; - } - } + public string RedirectUrl { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The HTTP response headers that were received along with this redirect. [JsonPropertyName("responseHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders ResponseHeaders - { - get - { - InitializeProperty("responseHeaders", _responseHeaders); - return _responseHeaders; - } - set - { - _responseHeaders = value; - } - } + public HttpHeaders ResponseHeaders { get; set; } /// Standard HTTP status code returned by the server. [JsonPropertyName("statusCode")] - public int StatusCode - { - get - { - InitializeProperty("statusCode", _statusCode); - return _statusCode; - } - set - { - _statusCode = value; - } - } + public int StatusCode { get; set; } /// HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers. [JsonPropertyName("statusLine")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StatusLine - { - get - { - InitializeProperty("statusLine", _statusLine); - return _statusLine; - } - set - { - _statusLine = value; - } - } + public string StatusLine { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRequestEvent.cs b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRequestEvent.cs index 6891146..ac6073d 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRequestEvent.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRequestEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -7,6 +8,7 @@ namespace WebExtensions.Net.WebRequest { // Type Class /// Fired when a request is about to occur. + [BindAllProperties] public partial class OnBeforeRequestEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRequestEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRequestEventAddListenerCallbackDetails.cs index ae6eaee..dea4eaa 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRequestEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRequestEventAddListenerCallbackDetails.cs @@ -1,259 +1,80 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnBeforeRequestEventAddListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool? _incognito; - private string _method; - private string _originUrl; - private int _parentFrameId; - private AddListenerCallbackDetailsRequestBody _requestBody; - private string _requestId; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// Contains the HTTP request body data. Only provided if extraInfoSpec contains 'requestBody'. [JsonPropertyName("requestBody")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public AddListenerCallbackDetailsRequestBody RequestBody - { - get - { - InitializeProperty("requestBody", _requestBody); - return _requestBody; - } - set - { - _requestBody = value; - } - } + public AddListenerCallbackDetailsRequestBody RequestBody { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRequestEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRequestEventHasListenerCallbackDetails.cs index bd0b4b6..15829fd 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRequestEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRequestEventHasListenerCallbackDetails.cs @@ -1,259 +1,80 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnBeforeRequestEventHasListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool? _incognito; - private string _method; - private string _originUrl; - private int _parentFrameId; - private HasListenerCallbackDetailsRequestBody _requestBody; - private string _requestId; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// Contains the HTTP request body data. Only provided if extraInfoSpec contains 'requestBody'. [JsonPropertyName("requestBody")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HasListenerCallbackDetailsRequestBody RequestBody - { - get - { - InitializeProperty("requestBody", _requestBody); - return _requestBody; - } - set - { - _requestBody = value; - } - } + public HasListenerCallbackDetailsRequestBody RequestBody { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRequestEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRequestEventRemoveListenerCallbackDetails.cs index 82c9f9b..aede3b9 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRequestEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeRequestEventRemoveListenerCallbackDetails.cs @@ -1,259 +1,80 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnBeforeRequestEventRemoveListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool? _incognito; - private string _method; - private string _originUrl; - private int _parentFrameId; - private RemoveListenerCallbackDetailsRequestBody _requestBody; - private string _requestId; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// Contains the HTTP request body data. Only provided if extraInfoSpec contains 'requestBody'. [JsonPropertyName("requestBody")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public RemoveListenerCallbackDetailsRequestBody RequestBody - { - get - { - InitializeProperty("requestBody", _requestBody); - return _requestBody; - } - set - { - _requestBody = value; - } - } + public RemoveListenerCallbackDetailsRequestBody RequestBody { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeSendHeadersEvent.cs b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeSendHeadersEvent.cs index 96dc4aa..564984a 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeSendHeadersEvent.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeSendHeadersEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -7,6 +8,7 @@ namespace WebExtensions.Net.WebRequest { // Type Class /// Fired before sending an HTTP request, once the request headers are available. This may occur after a TCP connection is made to the server, but before any HTTP data is sent. + [BindAllProperties] public partial class OnBeforeSendHeadersEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeSendHeadersEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeSendHeadersEventAddListenerCallbackDetails.cs index f44837f..09af480 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeSendHeadersEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeSendHeadersEventAddListenerCallbackDetails.cs @@ -1,259 +1,80 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnBeforeSendHeadersEventAddListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool? _incognito; - private string _method; - private string _originUrl; - private int _parentFrameId; - private HttpHeaders _requestHeaders; - private string _requestId; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The HTTP request headers that are going to be sent out with this request. [JsonPropertyName("requestHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders RequestHeaders - { - get - { - InitializeProperty("requestHeaders", _requestHeaders); - return _requestHeaders; - } - set - { - _requestHeaders = value; - } - } + public HttpHeaders RequestHeaders { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeSendHeadersEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeSendHeadersEventHasListenerCallbackDetails.cs index 27da2b0..8d3e86d 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeSendHeadersEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeSendHeadersEventHasListenerCallbackDetails.cs @@ -1,259 +1,80 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnBeforeSendHeadersEventHasListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool? _incognito; - private string _method; - private string _originUrl; - private int _parentFrameId; - private HttpHeaders _requestHeaders; - private string _requestId; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The HTTP request headers that are going to be sent out with this request. [JsonPropertyName("requestHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders RequestHeaders - { - get - { - InitializeProperty("requestHeaders", _requestHeaders); - return _requestHeaders; - } - set - { - _requestHeaders = value; - } - } + public HttpHeaders RequestHeaders { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeSendHeadersEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeSendHeadersEventRemoveListenerCallbackDetails.cs index c8503c0..fc1e13c 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnBeforeSendHeadersEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnBeforeSendHeadersEventRemoveListenerCallbackDetails.cs @@ -1,259 +1,80 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnBeforeSendHeadersEventRemoveListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool? _incognito; - private string _method; - private string _originUrl; - private int _parentFrameId; - private HttpHeaders _requestHeaders; - private string _requestId; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The HTTP request headers that are going to be sent out with this request. [JsonPropertyName("requestHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders RequestHeaders - { - get - { - InitializeProperty("requestHeaders", _requestHeaders); - return _requestHeaders; - } - set - { - _requestHeaders = value; - } - } + public HttpHeaders RequestHeaders { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnCompletedEvent.cs b/src/WebExtensions.Net/Generated/WebRequest/OnCompletedEvent.cs index 057ec12..9acc181 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnCompletedEvent.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnCompletedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -7,6 +8,7 @@ namespace WebExtensions.Net.WebRequest { // Type Class /// Fired when a request is completed. + [BindAllProperties] public partial class OnCompletedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnCompletedEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnCompletedEventAddListenerCallbackDetails.cs index 5eaafc8..6dc6924 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnCompletedEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnCompletedEventAddListenerCallbackDetails.cs @@ -1,357 +1,106 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnCompletedEventAddListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool _fromCache; - private bool? _incognito; - private string _ip; - private string _method; - private string _originUrl; - private int _parentFrameId; - private string _requestId; - private int _requestSize; - private HttpHeaders _responseHeaders; - private int _responseSize; - private int _statusCode; - private string _statusLine; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// Indicates if this response was fetched from disk cache. [JsonPropertyName("fromCache")] - public bool FromCache - { - get - { - InitializeProperty("fromCache", _fromCache); - return _fromCache; - } - set - { - _fromCache = value; - } - } + public bool FromCache { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address. [JsonPropertyName("ip")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Ip - { - get - { - InitializeProperty("ip", _ip); - return _ip; - } - set - { - _ip = value; - } - } + public string Ip { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// For http requests, the bytes transferred in the request. Only available in onCompleted. [JsonPropertyName("requestSize")] - public int RequestSize - { - get - { - InitializeProperty("requestSize", _requestSize); - return _requestSize; - } - set - { - _requestSize = value; - } - } + public int RequestSize { get; set; } /// The HTTP response headers that were received along with this response. [JsonPropertyName("responseHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders ResponseHeaders - { - get - { - InitializeProperty("responseHeaders", _responseHeaders); - return _responseHeaders; - } - set - { - _responseHeaders = value; - } - } + public HttpHeaders ResponseHeaders { get; set; } /// For http requests, the bytes received in the request. Only available in onCompleted. [JsonPropertyName("responseSize")] - public int ResponseSize - { - get - { - InitializeProperty("responseSize", _responseSize); - return _responseSize; - } - set - { - _responseSize = value; - } - } + public int ResponseSize { get; set; } /// Standard HTTP status code returned by the server. [JsonPropertyName("statusCode")] - public int StatusCode - { - get - { - InitializeProperty("statusCode", _statusCode); - return _statusCode; - } - set - { - _statusCode = value; - } - } + public int StatusCode { get; set; } /// HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers. [JsonPropertyName("statusLine")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StatusLine - { - get - { - InitializeProperty("statusLine", _statusLine); - return _statusLine; - } - set - { - _statusLine = value; - } - } + public string StatusLine { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnCompletedEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnCompletedEventHasListenerCallbackDetails.cs index 629c870..16a72f4 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnCompletedEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnCompletedEventHasListenerCallbackDetails.cs @@ -1,357 +1,106 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnCompletedEventHasListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool _fromCache; - private bool? _incognito; - private string _ip; - private string _method; - private string _originUrl; - private int _parentFrameId; - private string _requestId; - private int _requestSize; - private HttpHeaders _responseHeaders; - private int _responseSize; - private int _statusCode; - private string _statusLine; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// Indicates if this response was fetched from disk cache. [JsonPropertyName("fromCache")] - public bool FromCache - { - get - { - InitializeProperty("fromCache", _fromCache); - return _fromCache; - } - set - { - _fromCache = value; - } - } + public bool FromCache { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address. [JsonPropertyName("ip")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Ip - { - get - { - InitializeProperty("ip", _ip); - return _ip; - } - set - { - _ip = value; - } - } + public string Ip { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// For http requests, the bytes transferred in the request. Only available in onCompleted. [JsonPropertyName("requestSize")] - public int RequestSize - { - get - { - InitializeProperty("requestSize", _requestSize); - return _requestSize; - } - set - { - _requestSize = value; - } - } + public int RequestSize { get; set; } /// The HTTP response headers that were received along with this response. [JsonPropertyName("responseHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders ResponseHeaders - { - get - { - InitializeProperty("responseHeaders", _responseHeaders); - return _responseHeaders; - } - set - { - _responseHeaders = value; - } - } + public HttpHeaders ResponseHeaders { get; set; } /// For http requests, the bytes received in the request. Only available in onCompleted. [JsonPropertyName("responseSize")] - public int ResponseSize - { - get - { - InitializeProperty("responseSize", _responseSize); - return _responseSize; - } - set - { - _responseSize = value; - } - } + public int ResponseSize { get; set; } /// Standard HTTP status code returned by the server. [JsonPropertyName("statusCode")] - public int StatusCode - { - get - { - InitializeProperty("statusCode", _statusCode); - return _statusCode; - } - set - { - _statusCode = value; - } - } + public int StatusCode { get; set; } /// HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers. [JsonPropertyName("statusLine")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StatusLine - { - get - { - InitializeProperty("statusLine", _statusLine); - return _statusLine; - } - set - { - _statusLine = value; - } - } + public string StatusLine { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnCompletedEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnCompletedEventRemoveListenerCallbackDetails.cs index 27bb3f2..7c813b5 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnCompletedEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnCompletedEventRemoveListenerCallbackDetails.cs @@ -1,357 +1,106 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnCompletedEventRemoveListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool _fromCache; - private bool? _incognito; - private string _ip; - private string _method; - private string _originUrl; - private int _parentFrameId; - private string _requestId; - private int _requestSize; - private HttpHeaders _responseHeaders; - private int _responseSize; - private int _statusCode; - private string _statusLine; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// Indicates if this response was fetched from disk cache. [JsonPropertyName("fromCache")] - public bool FromCache - { - get - { - InitializeProperty("fromCache", _fromCache); - return _fromCache; - } - set - { - _fromCache = value; - } - } + public bool FromCache { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address. [JsonPropertyName("ip")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Ip - { - get - { - InitializeProperty("ip", _ip); - return _ip; - } - set - { - _ip = value; - } - } + public string Ip { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// For http requests, the bytes transferred in the request. Only available in onCompleted. [JsonPropertyName("requestSize")] - public int RequestSize - { - get - { - InitializeProperty("requestSize", _requestSize); - return _requestSize; - } - set - { - _requestSize = value; - } - } + public int RequestSize { get; set; } /// The HTTP response headers that were received along with this response. [JsonPropertyName("responseHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders ResponseHeaders - { - get - { - InitializeProperty("responseHeaders", _responseHeaders); - return _responseHeaders; - } - set - { - _responseHeaders = value; - } - } + public HttpHeaders ResponseHeaders { get; set; } /// For http requests, the bytes received in the request. Only available in onCompleted. [JsonPropertyName("responseSize")] - public int ResponseSize - { - get - { - InitializeProperty("responseSize", _responseSize); - return _responseSize; - } - set - { - _responseSize = value; - } - } + public int ResponseSize { get; set; } /// Standard HTTP status code returned by the server. [JsonPropertyName("statusCode")] - public int StatusCode - { - get - { - InitializeProperty("statusCode", _statusCode); - return _statusCode; - } - set - { - _statusCode = value; - } - } + public int StatusCode { get; set; } /// HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers. [JsonPropertyName("statusLine")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StatusLine - { - get - { - InitializeProperty("statusLine", _statusLine); - return _statusLine; - } - set - { - _statusLine = value; - } - } + public string StatusLine { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnErrorOccurredEvent.cs b/src/WebExtensions.Net/Generated/WebRequest/OnErrorOccurredEvent.cs index eb3d138..d357ab9 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnErrorOccurredEvent.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnErrorOccurredEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.WebRequest { // Type Class /// Fired when an error occurs. + [BindAllProperties] public partial class OnErrorOccurredEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnErrorOccurredEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnErrorOccurredEventAddListenerCallbackDetails.cs index 16ebae4..8954cbd 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnErrorOccurredEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnErrorOccurredEventAddListenerCallbackDetails.cs @@ -1,292 +1,89 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnErrorOccurredEventAddListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private string _error; - private int _frameId; - private bool _fromCache; - private bool? _incognito; - private string _ip; - private string _method; - private string _originUrl; - private int _parentFrameId; - private string _requestId; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The error description. This string is not guaranteed to remain backwards compatible between releases. You must not parse and act based upon its content. [JsonPropertyName("error")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Error - { - get - { - InitializeProperty("error", _error); - return _error; - } - set - { - _error = value; - } - } + public string Error { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// Indicates if this response was fetched from disk cache. [JsonPropertyName("fromCache")] - public bool FromCache - { - get - { - InitializeProperty("fromCache", _fromCache); - return _fromCache; - } - set - { - _fromCache = value; - } - } + public bool FromCache { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address. [JsonPropertyName("ip")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Ip - { - get - { - InitializeProperty("ip", _ip); - return _ip; - } - set - { - _ip = value; - } - } + public string Ip { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnErrorOccurredEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnErrorOccurredEventHasListenerCallbackDetails.cs index 48d5665..0e2f661 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnErrorOccurredEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnErrorOccurredEventHasListenerCallbackDetails.cs @@ -1,292 +1,89 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnErrorOccurredEventHasListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private string _error; - private int _frameId; - private bool _fromCache; - private bool? _incognito; - private string _ip; - private string _method; - private string _originUrl; - private int _parentFrameId; - private string _requestId; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The error description. This string is not guaranteed to remain backwards compatible between releases. You must not parse and act based upon its content. [JsonPropertyName("error")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Error - { - get - { - InitializeProperty("error", _error); - return _error; - } - set - { - _error = value; - } - } + public string Error { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// Indicates if this response was fetched from disk cache. [JsonPropertyName("fromCache")] - public bool FromCache - { - get - { - InitializeProperty("fromCache", _fromCache); - return _fromCache; - } - set - { - _fromCache = value; - } - } + public bool FromCache { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address. [JsonPropertyName("ip")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Ip - { - get - { - InitializeProperty("ip", _ip); - return _ip; - } - set - { - _ip = value; - } - } + public string Ip { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnErrorOccurredEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnErrorOccurredEventRemoveListenerCallbackDetails.cs index a39e0bf..98b9ca4 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnErrorOccurredEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnErrorOccurredEventRemoveListenerCallbackDetails.cs @@ -1,292 +1,89 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnErrorOccurredEventRemoveListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private string _error; - private int _frameId; - private bool _fromCache; - private bool? _incognito; - private string _ip; - private string _method; - private string _originUrl; - private int _parentFrameId; - private string _requestId; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The error description. This string is not guaranteed to remain backwards compatible between releases. You must not parse and act based upon its content. [JsonPropertyName("error")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Error - { - get - { - InitializeProperty("error", _error); - return _error; - } - set - { - _error = value; - } - } + public string Error { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// Indicates if this response was fetched from disk cache. [JsonPropertyName("fromCache")] - public bool FromCache - { - get - { - InitializeProperty("fromCache", _fromCache); - return _fromCache; - } - set - { - _fromCache = value; - } - } + public bool FromCache { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address. [JsonPropertyName("ip")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Ip - { - get - { - InitializeProperty("ip", _ip); - return _ip; - } - set - { - _ip = value; - } - } + public string Ip { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnHeadersReceivedEvent.cs b/src/WebExtensions.Net/Generated/WebRequest/OnHeadersReceivedEvent.cs index 503e81d..219ff4d 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnHeadersReceivedEvent.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnHeadersReceivedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -7,6 +8,7 @@ namespace WebExtensions.Net.WebRequest { // Type Class /// Fired when HTTP response headers of a request have been received. + [BindAllProperties] public partial class OnHeadersReceivedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnHeadersReceivedEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnHeadersReceivedEventAddListenerCallbackDetails.cs index d4ace92..09115b3 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnHeadersReceivedEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnHeadersReceivedEventAddListenerCallbackDetails.cs @@ -1,292 +1,89 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnHeadersReceivedEventAddListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool? _incognito; - private string _method; - private string _originUrl; - private int _parentFrameId; - private string _requestId; - private HttpHeaders _responseHeaders; - private int _statusCode; - private string _statusLine; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The HTTP response headers that have been received with this response. [JsonPropertyName("responseHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders ResponseHeaders - { - get - { - InitializeProperty("responseHeaders", _responseHeaders); - return _responseHeaders; - } - set - { - _responseHeaders = value; - } - } + public HttpHeaders ResponseHeaders { get; set; } /// Standard HTTP status code returned by the server. [JsonPropertyName("statusCode")] - public int StatusCode - { - get - { - InitializeProperty("statusCode", _statusCode); - return _statusCode; - } - set - { - _statusCode = value; - } - } + public int StatusCode { get; set; } /// HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line). [JsonPropertyName("statusLine")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StatusLine - { - get - { - InitializeProperty("statusLine", _statusLine); - return _statusLine; - } - set - { - _statusLine = value; - } - } + public string StatusLine { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnHeadersReceivedEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnHeadersReceivedEventHasListenerCallbackDetails.cs index daa1d96..10b8889 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnHeadersReceivedEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnHeadersReceivedEventHasListenerCallbackDetails.cs @@ -1,292 +1,89 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnHeadersReceivedEventHasListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool? _incognito; - private string _method; - private string _originUrl; - private int _parentFrameId; - private string _requestId; - private HttpHeaders _responseHeaders; - private int _statusCode; - private string _statusLine; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The HTTP response headers that have been received with this response. [JsonPropertyName("responseHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders ResponseHeaders - { - get - { - InitializeProperty("responseHeaders", _responseHeaders); - return _responseHeaders; - } - set - { - _responseHeaders = value; - } - } + public HttpHeaders ResponseHeaders { get; set; } /// Standard HTTP status code returned by the server. [JsonPropertyName("statusCode")] - public int StatusCode - { - get - { - InitializeProperty("statusCode", _statusCode); - return _statusCode; - } - set - { - _statusCode = value; - } - } + public int StatusCode { get; set; } /// HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line). [JsonPropertyName("statusLine")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StatusLine - { - get - { - InitializeProperty("statusLine", _statusLine); - return _statusLine; - } - set - { - _statusLine = value; - } - } + public string StatusLine { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnHeadersReceivedEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnHeadersReceivedEventRemoveListenerCallbackDetails.cs index 7f37b6d..2822199 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnHeadersReceivedEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnHeadersReceivedEventRemoveListenerCallbackDetails.cs @@ -1,292 +1,89 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnHeadersReceivedEventRemoveListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool? _incognito; - private string _method; - private string _originUrl; - private int _parentFrameId; - private string _requestId; - private HttpHeaders _responseHeaders; - private int _statusCode; - private string _statusLine; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The HTTP response headers that have been received with this response. [JsonPropertyName("responseHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders ResponseHeaders - { - get - { - InitializeProperty("responseHeaders", _responseHeaders); - return _responseHeaders; - } - set - { - _responseHeaders = value; - } - } + public HttpHeaders ResponseHeaders { get; set; } /// Standard HTTP status code returned by the server. [JsonPropertyName("statusCode")] - public int StatusCode - { - get - { - InitializeProperty("statusCode", _statusCode); - return _statusCode; - } - set - { - _statusCode = value; - } - } + public int StatusCode { get; set; } /// HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line). [JsonPropertyName("statusLine")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StatusLine - { - get - { - InitializeProperty("statusLine", _statusLine); - return _statusLine; - } - set - { - _statusLine = value; - } - } + public string StatusLine { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnResponseStartedEvent.cs b/src/WebExtensions.Net/Generated/WebRequest/OnResponseStartedEvent.cs index b8922dc..5f513b3 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnResponseStartedEvent.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnResponseStartedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -7,6 +8,7 @@ namespace WebExtensions.Net.WebRequest { // Type Class /// Fired when the first byte of the response body is received. For HTTP requests, this means that the status line and response headers are available. + [BindAllProperties] public partial class OnResponseStartedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnResponseStartedEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnResponseStartedEventAddListenerCallbackDetails.cs index c231ffb..c9c7ade 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnResponseStartedEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnResponseStartedEventAddListenerCallbackDetails.cs @@ -1,325 +1,98 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnResponseStartedEventAddListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool _fromCache; - private bool? _incognito; - private string _ip; - private string _method; - private string _originUrl; - private int _parentFrameId; - private string _requestId; - private HttpHeaders _responseHeaders; - private int _statusCode; - private string _statusLine; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// Indicates if this response was fetched from disk cache. [JsonPropertyName("fromCache")] - public bool FromCache - { - get - { - InitializeProperty("fromCache", _fromCache); - return _fromCache; - } - set - { - _fromCache = value; - } - } + public bool FromCache { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address. [JsonPropertyName("ip")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Ip - { - get - { - InitializeProperty("ip", _ip); - return _ip; - } - set - { - _ip = value; - } - } + public string Ip { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The HTTP response headers that were received along with this response. [JsonPropertyName("responseHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders ResponseHeaders - { - get - { - InitializeProperty("responseHeaders", _responseHeaders); - return _responseHeaders; - } - set - { - _responseHeaders = value; - } - } + public HttpHeaders ResponseHeaders { get; set; } /// Standard HTTP status code returned by the server. [JsonPropertyName("statusCode")] - public int StatusCode - { - get - { - InitializeProperty("statusCode", _statusCode); - return _statusCode; - } - set - { - _statusCode = value; - } - } + public int StatusCode { get; set; } /// HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers. [JsonPropertyName("statusLine")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StatusLine - { - get - { - InitializeProperty("statusLine", _statusLine); - return _statusLine; - } - set - { - _statusLine = value; - } - } + public string StatusLine { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnResponseStartedEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnResponseStartedEventHasListenerCallbackDetails.cs index 2d6da6e..e873bb9 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnResponseStartedEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnResponseStartedEventHasListenerCallbackDetails.cs @@ -1,325 +1,98 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnResponseStartedEventHasListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool _fromCache; - private bool? _incognito; - private string _ip; - private string _method; - private string _originUrl; - private int _parentFrameId; - private string _requestId; - private HttpHeaders _responseHeaders; - private int _statusCode; - private string _statusLine; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// Indicates if this response was fetched from disk cache. [JsonPropertyName("fromCache")] - public bool FromCache - { - get - { - InitializeProperty("fromCache", _fromCache); - return _fromCache; - } - set - { - _fromCache = value; - } - } + public bool FromCache { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address. [JsonPropertyName("ip")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Ip - { - get - { - InitializeProperty("ip", _ip); - return _ip; - } - set - { - _ip = value; - } - } + public string Ip { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The HTTP response headers that were received along with this response. [JsonPropertyName("responseHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders ResponseHeaders - { - get - { - InitializeProperty("responseHeaders", _responseHeaders); - return _responseHeaders; - } - set - { - _responseHeaders = value; - } - } + public HttpHeaders ResponseHeaders { get; set; } /// Standard HTTP status code returned by the server. [JsonPropertyName("statusCode")] - public int StatusCode - { - get - { - InitializeProperty("statusCode", _statusCode); - return _statusCode; - } - set - { - _statusCode = value; - } - } + public int StatusCode { get; set; } /// HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers. [JsonPropertyName("statusLine")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StatusLine - { - get - { - InitializeProperty("statusLine", _statusLine); - return _statusLine; - } - set - { - _statusLine = value; - } - } + public string StatusLine { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnResponseStartedEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnResponseStartedEventRemoveListenerCallbackDetails.cs index 30f14ba..7b6891e 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnResponseStartedEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnResponseStartedEventRemoveListenerCallbackDetails.cs @@ -1,325 +1,98 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnResponseStartedEventRemoveListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool _fromCache; - private bool? _incognito; - private string _ip; - private string _method; - private string _originUrl; - private int _parentFrameId; - private string _requestId; - private HttpHeaders _responseHeaders; - private int _statusCode; - private string _statusLine; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// Indicates if this response was fetched from disk cache. [JsonPropertyName("fromCache")] - public bool FromCache - { - get - { - InitializeProperty("fromCache", _fromCache); - return _fromCache; - } - set - { - _fromCache = value; - } - } + public bool FromCache { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address. [JsonPropertyName("ip")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Ip - { - get - { - InitializeProperty("ip", _ip); - return _ip; - } - set - { - _ip = value; - } - } + public string Ip { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The HTTP response headers that were received along with this response. [JsonPropertyName("responseHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders ResponseHeaders - { - get - { - InitializeProperty("responseHeaders", _responseHeaders); - return _responseHeaders; - } - set - { - _responseHeaders = value; - } - } + public HttpHeaders ResponseHeaders { get; set; } /// Standard HTTP status code returned by the server. [JsonPropertyName("statusCode")] - public int StatusCode - { - get - { - InitializeProperty("statusCode", _statusCode); - return _statusCode; - } - set - { - _statusCode = value; - } - } + public int StatusCode { get; set; } /// HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers. [JsonPropertyName("statusLine")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string StatusLine - { - get - { - InitializeProperty("statusLine", _statusLine); - return _statusLine; - } - set - { - _statusLine = value; - } - } + public string StatusLine { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnSendHeadersEvent.cs b/src/WebExtensions.Net/Generated/WebRequest/OnSendHeadersEvent.cs index 26dc372..93e6247 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnSendHeadersEvent.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnSendHeadersEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -7,6 +8,7 @@ namespace WebExtensions.Net.WebRequest { // Type Class /// Fired just before a request is going to be sent to the server (modifications of previous onBeforeSendHeaders callbacks are visible by the time onSendHeaders is fired). + [BindAllProperties] public partial class OnSendHeadersEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnSendHeadersEventAddListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnSendHeadersEventAddListenerCallbackDetails.cs index 6875249..18be799 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnSendHeadersEventAddListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnSendHeadersEventAddListenerCallbackDetails.cs @@ -1,259 +1,80 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnSendHeadersEventAddListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool? _incognito; - private string _method; - private string _originUrl; - private int _parentFrameId; - private HttpHeaders _requestHeaders; - private string _requestId; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The HTTP request headers that have been sent out with this request. [JsonPropertyName("requestHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders RequestHeaders - { - get - { - InitializeProperty("requestHeaders", _requestHeaders); - return _requestHeaders; - } - set - { - _requestHeaders = value; - } - } + public HttpHeaders RequestHeaders { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnSendHeadersEventHasListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnSendHeadersEventHasListenerCallbackDetails.cs index 09d6931..67249d5 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnSendHeadersEventHasListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnSendHeadersEventHasListenerCallbackDetails.cs @@ -1,259 +1,80 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnSendHeadersEventHasListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool? _incognito; - private string _method; - private string _originUrl; - private int _parentFrameId; - private HttpHeaders _requestHeaders; - private string _requestId; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The HTTP request headers that have been sent out with this request. [JsonPropertyName("requestHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders RequestHeaders - { - get - { - InitializeProperty("requestHeaders", _requestHeaders); - return _requestHeaders; - } - set - { - _requestHeaders = value; - } - } + public HttpHeaders RequestHeaders { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/OnSendHeadersEventRemoveListenerCallbackDetails.cs b/src/WebExtensions.Net/Generated/WebRequest/OnSendHeadersEventRemoveListenerCallbackDetails.cs index b404d5e..6729589 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/OnSendHeadersEventRemoveListenerCallbackDetails.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/OnSendHeadersEventRemoveListenerCallbackDetails.cs @@ -1,259 +1,80 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class OnSendHeadersEventRemoveListenerCallbackDetails : BaseObject { - private string _cookieStoreId; - private string _documentUrl; - private int _frameId; - private bool? _incognito; - private string _method; - private string _originUrl; - private int _parentFrameId; - private HttpHeaders _requestHeaders; - private string _requestId; - private int _tabId; - private bool _thirdParty; - private EpochTime _timeStamp; - private ResourceType _type; - private string _url; - private UrlClassification _urlClassification; - /// The cookie store ID of the contextual identity. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// URL of the page into which the requested resource will be loaded. [JsonPropertyName("documentUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string DocumentUrl - { - get - { - InitializeProperty("documentUrl", _documentUrl); - return _documentUrl; - } - set - { - _documentUrl = value; - } - } + public string DocumentUrl { get; set; } /// The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. [JsonPropertyName("frameId")] - public int FrameId - { - get - { - InitializeProperty("frameId", _frameId); - return _frameId; - } - set - { - _frameId = value; - } - } + public int FrameId { get; set; } /// True for private browsing requests. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// Standard HTTP method. [JsonPropertyName("method")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Method - { - get - { - InitializeProperty("method", _method); - return _method; - } - set - { - _method = value; - } - } + public string Method { get; set; } /// URL of the resource that triggered this request. [JsonPropertyName("originUrl")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string OriginUrl - { - get - { - InitializeProperty("originUrl", _originUrl); - return _originUrl; - } - set - { - _originUrl = value; - } - } + public string OriginUrl { get; set; } /// ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. [JsonPropertyName("parentFrameId")] - public int ParentFrameId - { - get - { - InitializeProperty("parentFrameId", _parentFrameId); - return _parentFrameId; - } - set - { - _parentFrameId = value; - } - } + public int ParentFrameId { get; set; } /// The HTTP request headers that have been sent out with this request. [JsonPropertyName("requestHeaders")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public HttpHeaders RequestHeaders - { - get - { - InitializeProperty("requestHeaders", _requestHeaders); - return _requestHeaders; - } - set - { - _requestHeaders = value; - } - } + public HttpHeaders RequestHeaders { get; set; } /// The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. [JsonPropertyName("requestId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string RequestId - { - get - { - InitializeProperty("requestId", _requestId); - return _requestId; - } - set - { - _requestId = value; - } - } + public string RequestId { get; set; } /// The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. [JsonPropertyName("tabId")] - public int TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int TabId { get; set; } /// Indicates if this request and its content window hierarchy is third party. [JsonPropertyName("thirdParty")] - public bool ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public bool ThirdParty { get; set; } /// The time when this signal is triggered, in milliseconds since the epoch. [JsonPropertyName("timeStamp")] - public EpochTime TimeStamp - { - get - { - InitializeProperty("timeStamp", _timeStamp); - return _timeStamp; - } - set - { - _timeStamp = value; - } - } + public EpochTime TimeStamp { get; set; } /// How the requested resource will be used. [JsonPropertyName("type")] - public ResourceType Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public ResourceType Type { get; set; } /// [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public string Url { get; set; } /// Tracking classification if the request has been classified. [JsonPropertyName("urlClassification")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassification UrlClassification - { - get - { - InitializeProperty("urlClassification", _urlClassification); - return _urlClassification; - } - set - { - _urlClassification = value; - } - } + public UrlClassification UrlClassification { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/Options.cs b/src/WebExtensions.Net/Generated/WebRequest/Options.cs index 5215bcc..0f77d50 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/Options.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/Options.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class Options : BaseObject { - private bool? _certificateChain; - private bool? _rawDER; - /// Include the entire certificate chain. [JsonPropertyName("certificateChain")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? CertificateChain - { - get - { - InitializeProperty("certificateChain", _certificateChain); - return _certificateChain; - } - set - { - _certificateChain = value; - } - } + public bool? CertificateChain { get; set; } /// Include raw certificate data for processing by the extension. [JsonPropertyName("rawDER")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? RawDER - { - get - { - InitializeProperty("rawDER", _rawDER); - return _rawDER; - } - set - { - _rawDER = value; - } - } + public bool? RawDER { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/RemoveListenerCallbackDetailsChallenger.cs b/src/WebExtensions.Net/Generated/WebRequest/RemoveListenerCallbackDetailsChallenger.cs index f02c48e..6c5f049 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/RemoveListenerCallbackDetailsChallenger.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/RemoveListenerCallbackDetailsChallenger.cs @@ -1,43 +1,20 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// The server requesting authentication. + [BindAllProperties] public partial class RemoveListenerCallbackDetailsChallenger : BaseObject { - private string _host; - private int _port; - /// [JsonPropertyName("host")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Host - { - get - { - InitializeProperty("host", _host); - return _host; - } - set - { - _host = value; - } - } + public string Host { get; set; } /// [JsonPropertyName("port")] - public int Port - { - get - { - InitializeProperty("port", _port); - return _port; - } - set - { - _port = value; - } - } + public int Port { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/RemoveListenerCallbackDetailsRequestBody.cs b/src/WebExtensions.Net/Generated/WebRequest/RemoveListenerCallbackDetailsRequestBody.cs index f9dc2dd..ac25560 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/RemoveListenerCallbackDetailsRequestBody.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/RemoveListenerCallbackDetailsRequestBody.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,58 +6,22 @@ namespace WebExtensions.Net.WebRequest { // Type Class /// Contains the HTTP request body data. Only provided if extraInfoSpec contains 'requestBody'. + [BindAllProperties] public partial class RemoveListenerCallbackDetailsRequestBody : BaseObject { - private string _error; - private object _formData; - private IEnumerable _raw; - /// Errors when obtaining request body data. [JsonPropertyName("error")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Error - { - get - { - InitializeProperty("error", _error); - return _error; - } - set - { - _error = value; - } - } + public string Error { get; set; } /// If the request method is POST and the body is a sequence of key-value pairs encoded in UTF8, encoded as either multipart/form-data, or application/x-www-form-urlencoded, this dictionary is present and for each key contains the list of all values for that key. If the data is of another media type, or if it is malformed, the dictionary is not present. An example value of this dictionary is {'key': ['value1', 'value2']}. [JsonPropertyName("formData")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public object FormData - { - get - { - InitializeProperty("formData", _formData); - return _formData; - } - set - { - _formData = value; - } - } + public object FormData { get; set; } /// If the request method is PUT or POST, and the body is not already parsed in formData, then the unparsed request body elements are contained in this array. [JsonPropertyName("raw")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Raw - { - get - { - InitializeProperty("raw", _raw); - return _raw; - } - set - { - _raw = value; - } - } + public IEnumerable Raw { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/RequestFilter.cs b/src/WebExtensions.Net/Generated/WebRequest/RequestFilter.cs index 2bc3a0d..db045dd 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/RequestFilter.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/RequestFilter.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,92 +6,32 @@ namespace WebExtensions.Net.WebRequest { // Type Class /// An object describing filters to apply to webRequest events. + [BindAllProperties] public partial class RequestFilter : BaseObject { - private bool? _incognito; - private int? _tabId; - private IEnumerable _types; - private IEnumerable _urls; - private int? _windowId; - /// If provided, requests that do not match the incognito state will be filtered out. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// [JsonPropertyName("tabId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int? TabId { get; set; } /// A list of request types. Requests that cannot match any of the types will be filtered out. [JsonPropertyName("types")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Types - { - get - { - InitializeProperty("types", _types); - return _types; - } - set - { - _types = value; - } - } + public IEnumerable Types { get; set; } /// A list of URLs or URL patterns. Requests that cannot match any of the URLs will be filtered out. [JsonPropertyName("urls")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Urls - { - get - { - InitializeProperty("urls", _urls); - return _urls; - } - set - { - _urls = value; - } - } + public IEnumerable Urls { get; set; } /// [JsonPropertyName("windowId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? WindowId - { - get - { - InitializeProperty("windowId", _windowId); - return _windowId; - } - set - { - _windowId = value; - } - } + public int? WindowId { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/UploadData.cs b/src/WebExtensions.Net/Generated/WebRequest/UploadData.cs index 8595b59..71f14c4 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/UploadData.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/UploadData.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// Contains data uploaded in a URL request. + [BindAllProperties] public partial class UploadData : BaseObject { - private object _bytes; - private string _file; - /// An ArrayBuffer with a copy of the data. [JsonPropertyName("bytes")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public object Bytes - { - get - { - InitializeProperty("bytes", _bytes); - return _bytes; - } - set - { - _bytes = value; - } - } + public object Bytes { get; set; } /// A string with the file's path and name. [JsonPropertyName("file")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string File - { - get - { - InitializeProperty("file", _file); - return _file; - } - set - { - _file = value; - } - } + public string File { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/UrlClassification.cs b/src/WebExtensions.Net/Generated/WebRequest/UrlClassification.cs index 178b4ac..cc6d58e 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/UrlClassification.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/UrlClassification.cs @@ -1,44 +1,21 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.WebRequest { // Type Class /// + [BindAllProperties] public partial class UrlClassification : BaseObject { - private UrlClassificationParty _firstParty; - private UrlClassificationParty _thirdParty; - /// Classification flags if the request has been classified and it is first party. [JsonPropertyName("firstParty")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassificationParty FirstParty - { - get - { - InitializeProperty("firstParty", _firstParty); - return _firstParty; - } - set - { - _firstParty = value; - } - } + public UrlClassificationParty FirstParty { get; set; } /// Classification flags if the request has been classified and it or its window hierarchy is third party. [JsonPropertyName("thirdParty")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public UrlClassificationParty ThirdParty - { - get - { - InitializeProperty("thirdParty", _thirdParty); - return _thirdParty; - } - set - { - _thirdParty = value; - } - } + public UrlClassificationParty ThirdParty { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/WebRequest/WebRequestApi.cs b/src/WebExtensions.Net/Generated/WebRequest/WebRequestApi.cs index 8d5ef66..d9d2b8e 100644 --- a/src/WebExtensions.Net/Generated/WebRequest/WebRequestApi.cs +++ b/src/WebExtensions.Net/Generated/WebRequest/WebRequestApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Text.Json; using System.Threading.Tasks; @@ -17,8 +18,9 @@ public partial class WebRequestApi : BaseApi, IWebRequestApi private OnSendHeadersEvent _onSendHeaders; /// Creates a new instance of . - /// Web Extension JS Runtime - public WebRequestApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "webRequest") + /// The JS runtime adapter. + /// The base API access path. + public WebRequestApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "webRequest")) { } @@ -33,7 +35,7 @@ public OnAuthRequiredEvent OnAuthRequired if (_onAuthRequired is null) { _onAuthRequired = new OnAuthRequiredEvent(); - InitializeProperty("onAuthRequired", _onAuthRequired); + _onAuthRequired.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onAuthRequired")); } return _onAuthRequired; } @@ -47,7 +49,7 @@ public OnBeforeRedirectEvent OnBeforeRedirect if (_onBeforeRedirect is null) { _onBeforeRedirect = new OnBeforeRedirectEvent(); - InitializeProperty("onBeforeRedirect", _onBeforeRedirect); + _onBeforeRedirect.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onBeforeRedirect")); } return _onBeforeRedirect; } @@ -61,7 +63,7 @@ public OnBeforeRequestEvent OnBeforeRequest if (_onBeforeRequest is null) { _onBeforeRequest = new OnBeforeRequestEvent(); - InitializeProperty("onBeforeRequest", _onBeforeRequest); + _onBeforeRequest.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onBeforeRequest")); } return _onBeforeRequest; } @@ -75,7 +77,7 @@ public OnBeforeSendHeadersEvent OnBeforeSendHeaders if (_onBeforeSendHeaders is null) { _onBeforeSendHeaders = new OnBeforeSendHeadersEvent(); - InitializeProperty("onBeforeSendHeaders", _onBeforeSendHeaders); + _onBeforeSendHeaders.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onBeforeSendHeaders")); } return _onBeforeSendHeaders; } @@ -89,7 +91,7 @@ public OnCompletedEvent OnCompleted if (_onCompleted is null) { _onCompleted = new OnCompletedEvent(); - InitializeProperty("onCompleted", _onCompleted); + _onCompleted.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onCompleted")); } return _onCompleted; } @@ -103,7 +105,7 @@ public OnErrorOccurredEvent OnErrorOccurred if (_onErrorOccurred is null) { _onErrorOccurred = new OnErrorOccurredEvent(); - InitializeProperty("onErrorOccurred", _onErrorOccurred); + _onErrorOccurred.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onErrorOccurred")); } return _onErrorOccurred; } @@ -117,7 +119,7 @@ public OnHeadersReceivedEvent OnHeadersReceived if (_onHeadersReceived is null) { _onHeadersReceived = new OnHeadersReceivedEvent(); - InitializeProperty("onHeadersReceived", _onHeadersReceived); + _onHeadersReceived.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onHeadersReceived")); } return _onHeadersReceived; } @@ -131,7 +133,7 @@ public OnResponseStartedEvent OnResponseStarted if (_onResponseStarted is null) { _onResponseStarted = new OnResponseStartedEvent(); - InitializeProperty("onResponseStarted", _onResponseStarted); + _onResponseStarted.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onResponseStarted")); } return _onResponseStarted; } @@ -145,7 +147,7 @@ public OnSendHeadersEvent OnSendHeaders if (_onSendHeaders is null) { _onSendHeaders = new OnSendHeadersEvent(); - InitializeProperty("onSendHeaders", _onSendHeaders); + _onSendHeaders.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onSendHeaders")); } return _onSendHeaders; } diff --git a/src/WebExtensions.Net/Generated/Windows/CreateData.cs b/src/WebExtensions.Net/Generated/Windows/CreateData.cs index f06ba41..63fbc5c 100644 --- a/src/WebExtensions.Net/Generated/Windows/CreateData.cs +++ b/src/WebExtensions.Net/Generated/Windows/CreateData.cs @@ -1,231 +1,76 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Windows { // Type Class /// + [BindAllProperties] public partial class CreateData : BaseObject { - private bool? _allowScriptsToClose; - private string _cookieStoreId; - private bool? _focused; - private int? _height; - private bool? _incognito; - private int? _left; - private WindowState? _state; - private int? _tabId; - private string _titlePreface; - private int? _top; - private CreateType? _type; - private Url _url; - private int? _width; - /// Allow scripts to close the window. [JsonPropertyName("allowScriptsToClose")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? AllowScriptsToClose - { - get - { - InitializeProperty("allowScriptsToClose", _allowScriptsToClose); - return _allowScriptsToClose; - } - set - { - _allowScriptsToClose = value; - } - } + public bool? AllowScriptsToClose { get; set; } /// The CookieStoreId to use for all tabs that were created when the window is opened. [JsonPropertyName("cookieStoreId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string CookieStoreId - { - get - { - InitializeProperty("cookieStoreId", _cookieStoreId); - return _cookieStoreId; - } - set - { - _cookieStoreId = value; - } - } + public string CookieStoreId { get; set; } /// If true, opens an active window. If false, opens an inactive window. [JsonPropertyName("focused")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Focused - { - get - { - InitializeProperty("focused", _focused); - return _focused; - } - set - { - _focused = value; - } - } + public bool? Focused { get; set; } /// The height in pixels of the new window, including the frame. If not specified defaults to a natural height. [JsonPropertyName("height")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Height - { - get - { - InitializeProperty("height", _height); - return _height; - } - set - { - _height = value; - } - } + public int? Height { get; set; } /// Whether the new window should be an incognito window. [JsonPropertyName("incognito")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool? Incognito { get; set; } /// The number of pixels to position the new window from the left edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels. [JsonPropertyName("left")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Left - { - get - { - InitializeProperty("left", _left); - return _left; - } - set - { - _left = value; - } - } + public int? Left { get; set; } /// The initial state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'. [JsonPropertyName("state")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public WindowState? State - { - get - { - InitializeProperty("state", _state); - return _state; - } - set - { - _state = value; - } - } + public WindowState? State { get; set; } /// The id of the tab for which you want to adopt to the new window. [JsonPropertyName("tabId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? TabId - { - get - { - InitializeProperty("tabId", _tabId); - return _tabId; - } - set - { - _tabId = value; - } - } + public int? TabId { get; set; } /// A string to add to the beginning of the window title. [JsonPropertyName("titlePreface")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string TitlePreface - { - get - { - InitializeProperty("titlePreface", _titlePreface); - return _titlePreface; - } - set - { - _titlePreface = value; - } - } + public string TitlePreface { get; set; } /// The number of pixels to position the new window from the top edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels. [JsonPropertyName("top")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Top - { - get - { - InitializeProperty("top", _top); - return _top; - } - set - { - _top = value; - } - } + public int? Top { get; set; } /// Specifies what type of browser window to create. The 'panel' and 'detached_panel' types create a popup unless the '--enable-panels' flag is set. [JsonPropertyName("type")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public CreateType? Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public CreateType? Type { get; set; } /// A URL or array of URLs to open as tabs in the window. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page. [JsonPropertyName("url")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public Url Url - { - get - { - InitializeProperty("url", _url); - return _url; - } - set - { - _url = value; - } - } + public Url Url { get; set; } /// The width in pixels of the new window, including the frame. If not specified defaults to a natural width. [JsonPropertyName("width")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Width - { - get - { - InitializeProperty("width", _width); - return _width; - } - set - { - _width = value; - } - } + public int? Width { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Windows/GetAllGetInfo.cs b/src/WebExtensions.Net/Generated/Windows/GetAllGetInfo.cs index b498a01..d47590f 100644 --- a/src/WebExtensions.Net/Generated/Windows/GetAllGetInfo.cs +++ b/src/WebExtensions.Net/Generated/Windows/GetAllGetInfo.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -5,24 +6,12 @@ namespace WebExtensions.Net.Windows { // Type Class /// Specifies properties used to filter the $(ref:windows.Window) returned and to determine whether they should contain a list of the $(ref:tabs.Tab) objects. + [BindAllProperties] public partial class GetAllGetInfo : BaseObject { - private IEnumerable _windowTypes; - /// If set, the $(ref:windows.Window) returned will be filtered based on its type. If unset the default filter is set to ['app', 'normal', 'panel', 'popup'], with 'app' and 'panel' window types limited to the extension's own windows. [JsonPropertyName("windowTypes")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable WindowTypes - { - get - { - InitializeProperty("windowTypes", _windowTypes); - return _windowTypes; - } - set - { - _windowTypes = value; - } - } + public IEnumerable WindowTypes { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Windows/GetInfo.cs b/src/WebExtensions.Net/Generated/Windows/GetInfo.cs index 6de2c4c..c156f01 100644 --- a/src/WebExtensions.Net/Generated/Windows/GetInfo.cs +++ b/src/WebExtensions.Net/Generated/Windows/GetInfo.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Collections.Generic; using System.Text.Json.Serialization; @@ -6,42 +7,18 @@ namespace WebExtensions.Net.Windows { // Type Class /// Specifies whether the $(ref:windows.Window) returned should contain a list of the $(ref:tabs.Tab) objects. + [BindAllProperties] public partial class GetInfo : BaseObject { - private bool? _populate; - private IEnumerable _windowTypes; - /// If true, the $(ref:windows.Window) returned will have a tabs property that contains a list of the $(ref:tabs.Tab) objects. The Tab objects only contain the url, title and favIconUrl properties if the extension's manifest file includes the "tabs" permission. [JsonPropertyName("populate")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Populate - { - get - { - InitializeProperty("populate", _populate); - return _populate; - } - set - { - _populate = value; - } - } + public bool? Populate { get; set; } /// windowTypes is deprecated and ignored on Firefox. [Obsolete("This has been marked as deprecated without a description message. Please refer to the summary comment or the official API documentation.")] [JsonPropertyName("windowTypes")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable WindowTypes - { - get - { - InitializeProperty("windowTypes", _windowTypes); - return _windowTypes; - } - set - { - _windowTypes = value; - } - } + public IEnumerable WindowTypes { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Windows/OnCreatedEvent.cs b/src/WebExtensions.Net/Generated/Windows/OnCreatedEvent.cs index e69a41a..8ed6071 100644 --- a/src/WebExtensions.Net/Generated/Windows/OnCreatedEvent.cs +++ b/src/WebExtensions.Net/Generated/Windows/OnCreatedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Windows { // Type Class /// Fired when a window is created. + [BindAllProperties] public partial class OnCreatedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Windows/OnFocusChangedEvent.cs b/src/WebExtensions.Net/Generated/Windows/OnFocusChangedEvent.cs index 471912c..cf5c170 100644 --- a/src/WebExtensions.Net/Generated/Windows/OnFocusChangedEvent.cs +++ b/src/WebExtensions.Net/Generated/Windows/OnFocusChangedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Windows { // Type Class /// Fired when the currently focused window changes. Will be $(ref:windows.WINDOW_ID_NONE) if all browser windows have lost focus. Note: On some Linux window managers, WINDOW_ID_NONE will always be sent immediately preceding a switch from one browser window to another. + [BindAllProperties] public partial class OnFocusChangedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Windows/OnRemovedEvent.cs b/src/WebExtensions.Net/Generated/Windows/OnRemovedEvent.cs index 3498d6d..ad27051 100644 --- a/src/WebExtensions.Net/Generated/Windows/OnRemovedEvent.cs +++ b/src/WebExtensions.Net/Generated/Windows/OnRemovedEvent.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System; using System.Threading.Tasks; using WebExtensions.Net.Events; @@ -6,6 +7,7 @@ namespace WebExtensions.Net.Windows { // Type Class /// Fired when a window is removed (closed). + [BindAllProperties] public partial class OnRemovedEvent : Event { /// Registers an event listener callback to an event. diff --git a/src/WebExtensions.Net/Generated/Windows/UpdateInfo.cs b/src/WebExtensions.Net/Generated/Windows/UpdateInfo.cs index 1f0212d..72d3ac4 100644 --- a/src/WebExtensions.Net/Generated/Windows/UpdateInfo.cs +++ b/src/WebExtensions.Net/Generated/Windows/UpdateInfo.cs @@ -1,146 +1,51 @@ +using JsBind.Net; using System.Text.Json.Serialization; namespace WebExtensions.Net.Windows { // Type Class /// + [BindAllProperties] public partial class UpdateInfo : BaseObject { - private bool? _drawAttention; - private bool? _focused; - private int? _height; - private int? _left; - private WindowState? _state; - private string _titlePreface; - private int? _top; - private int? _width; - /// If true, causes the window to be displayed in a manner that draws the user's attention to the window, without changing the focused window. The effect lasts until the user changes focus to the window. This option has no effect if the window already has focus. Set to false to cancel a previous draw attention request. [JsonPropertyName("drawAttention")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? DrawAttention - { - get - { - InitializeProperty("drawAttention", _drawAttention); - return _drawAttention; - } - set - { - _drawAttention = value; - } - } + public bool? DrawAttention { get; set; } /// If true, brings the window to the front. If false, brings the next window in the z-order to the front. [JsonPropertyName("focused")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? Focused - { - get - { - InitializeProperty("focused", _focused); - return _focused; - } - set - { - _focused = value; - } - } + public bool? Focused { get; set; } /// The height to resize the window to in pixels. This value is ignored for panels. [JsonPropertyName("height")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Height - { - get - { - InitializeProperty("height", _height); - return _height; - } - set - { - _height = value; - } - } + public int? Height { get; set; } /// The offset from the left edge of the screen to move the window to in pixels. This value is ignored for panels. [JsonPropertyName("left")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Left - { - get - { - InitializeProperty("left", _left); - return _left; - } - set - { - _left = value; - } - } + public int? Left { get; set; } /// The new state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'. [JsonPropertyName("state")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public WindowState? State - { - get - { - InitializeProperty("state", _state); - return _state; - } - set - { - _state = value; - } - } + public WindowState? State { get; set; } /// A string to add to the beginning of the window title. [JsonPropertyName("titlePreface")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string TitlePreface - { - get - { - InitializeProperty("titlePreface", _titlePreface); - return _titlePreface; - } - set - { - _titlePreface = value; - } - } + public string TitlePreface { get; set; } /// The offset from the top edge of the screen to move the window to in pixels. This value is ignored for panels. [JsonPropertyName("top")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Top - { - get - { - InitializeProperty("top", _top); - return _top; - } - set - { - _top = value; - } - } + public int? Top { get; set; } /// The width to resize the window to in pixels. This value is ignored for panels. [JsonPropertyName("width")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Width - { - get - { - InitializeProperty("width", _width); - return _width; - } - set - { - _width = value; - } - } + public int? Width { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Windows/Window.cs b/src/WebExtensions.Net/Generated/Windows/Window.cs index 4119728..063ef62 100644 --- a/src/WebExtensions.Net/Generated/Windows/Window.cs +++ b/src/WebExtensions.Net/Generated/Windows/Window.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Text.Json.Serialization; using WebExtensions.Net.Tabs; @@ -6,225 +7,69 @@ namespace WebExtensions.Net.Windows { // Type Class /// + [BindAllProperties] public partial class Window : BaseObject { - private bool _alwaysOnTop; - private bool _focused; - private int? _height; - private int? _id; - private bool _incognito; - private int? _left; - private string _sessionId; - private WindowState? _state; - private IEnumerable _tabs; - private string _title; - private int? _top; - private WindowType? _type; - private int? _width; - /// Whether the window is set to be always on top. [JsonPropertyName("alwaysOnTop")] - public bool AlwaysOnTop - { - get - { - InitializeProperty("alwaysOnTop", _alwaysOnTop); - return _alwaysOnTop; - } - set - { - _alwaysOnTop = value; - } - } + public bool AlwaysOnTop { get; set; } /// Whether the window is currently the focused window. [JsonPropertyName("focused")] - public bool Focused - { - get - { - InitializeProperty("focused", _focused); - return _focused; - } - set - { - _focused = value; - } - } + public bool Focused { get; set; } /// The height of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned height property, for example when querying closed windows from the $(ref:sessions) API. [JsonPropertyName("height")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Height - { - get - { - InitializeProperty("height", _height); - return _height; - } - set - { - _height = value; - } - } + public int? Height { get; set; } /// The ID of the window. Window IDs are unique within a browser session. Under some circumstances a Window may not be assigned an ID, for example when querying windows using the $(ref:sessions) API, in which case a session ID may be present. [JsonPropertyName("id")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Id - { - get - { - InitializeProperty("id", _id); - return _id; - } - set - { - _id = value; - } - } + public int? Id { get; set; } /// Whether the window is incognito. [JsonPropertyName("incognito")] - public bool Incognito - { - get - { - InitializeProperty("incognito", _incognito); - return _incognito; - } - set - { - _incognito = value; - } - } + public bool Incognito { get; set; } /// The offset of the window from the left edge of the screen in pixels. Under some circumstances a Window may not be assigned left property, for example when querying closed windows from the $(ref:sessions) API. [JsonPropertyName("left")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Left - { - get - { - InitializeProperty("left", _left); - return _left; - } - set - { - _left = value; - } - } + public int? Left { get; set; } /// The session ID used to uniquely identify a Window obtained from the $(ref:sessions) API. [JsonPropertyName("sessionId")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string SessionId - { - get - { - InitializeProperty("sessionId", _sessionId); - return _sessionId; - } - set - { - _sessionId = value; - } - } + public string SessionId { get; set; } /// The state of this browser window. [JsonPropertyName("state")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public WindowState? State - { - get - { - InitializeProperty("state", _state); - return _state; - } - set - { - _state = value; - } - } + public WindowState? State { get; set; } /// Array of $(ref:tabs.Tab) objects representing the current tabs in the window. [JsonPropertyName("tabs")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public IEnumerable Tabs - { - get - { - InitializeProperty("tabs", _tabs); - return _tabs; - } - set - { - _tabs = value; - } - } + public IEnumerable Tabs { get; set; } /// The title of the window. Read-only. [JsonPropertyName("title")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Title - { - get - { - InitializeProperty("title", _title); - return _title; - } - set - { - _title = value; - } - } + public string Title { get; set; } /// The offset of the window from the top edge of the screen in pixels. Under some circumstances a Window may not be assigned top property, for example when querying closed windows from the $(ref:sessions) API. [JsonPropertyName("top")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Top - { - get - { - InitializeProperty("top", _top); - return _top; - } - set - { - _top = value; - } - } + public int? Top { get; set; } /// The type of browser window this is. [JsonPropertyName("type")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public WindowType? Type - { - get - { - InitializeProperty("type", _type); - return _type; - } - set - { - _type = value; - } - } + public WindowType? Type { get; set; } /// The width of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned width property, for example when querying closed windows from the $(ref:sessions) API. [JsonPropertyName("width")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public int? Width - { - get - { - InitializeProperty("width", _width); - return _width; - } - set - { - _width = value; - } - } + public int? Width { get; set; } } } diff --git a/src/WebExtensions.Net/Generated/Windows/WindowsApi.cs b/src/WebExtensions.Net/Generated/Windows/WindowsApi.cs index 826c8fd..ef41519 100644 --- a/src/WebExtensions.Net/Generated/Windows/WindowsApi.cs +++ b/src/WebExtensions.Net/Generated/Windows/WindowsApi.cs @@ -1,3 +1,4 @@ +using JsBind.Net; using System.Collections.Generic; using System.Threading.Tasks; @@ -11,8 +12,9 @@ public partial class WindowsApi : BaseApi, IWindowsApi private OnRemovedEvent _onRemoved; /// Creates a new instance of . - /// Web Extension JS Runtime - public WindowsApi(IWebExtensionsJSRuntime webExtensionsJSRuntime) : base(webExtensionsJSRuntime, "windows") + /// The JS runtime adapter. + /// The base API access path. + public WindowsApi(IJsRuntimeAdapter jsRuntime, string accessPath) : base(jsRuntime, AccessPaths.Combine(accessPath, "windows")) { } @@ -24,7 +26,7 @@ public OnCreatedEvent OnCreated if (_onCreated is null) { _onCreated = new OnCreatedEvent(); - InitializeProperty("onCreated", _onCreated); + _onCreated.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onCreated")); } return _onCreated; } @@ -38,7 +40,7 @@ public OnFocusChangedEvent OnFocusChanged if (_onFocusChanged is null) { _onFocusChanged = new OnFocusChangedEvent(); - InitializeProperty("onFocusChanged", _onFocusChanged); + _onFocusChanged.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onFocusChanged")); } return _onFocusChanged; } @@ -52,7 +54,7 @@ public OnRemovedEvent OnRemoved if (_onRemoved is null) { _onRemoved = new OnRemovedEvent(); - InitializeProperty("onRemoved", _onRemoved); + _onRemoved.Initialize(JsRuntime, AccessPaths.Combine(AccessPath, "onRemoved")); } return _onRemoved; } diff --git a/src/WebExtensions.Net/Generated/generated.txt b/src/WebExtensions.Net/Generated/generated.txt index dacfb59..08fa28c 100644 --- a/src/WebExtensions.Net/Generated/generated.txt +++ b/src/WebExtensions.Net/Generated/generated.txt @@ -1 +1 @@ -This file is auto generated at 2021-07-05T08:14:40 \ No newline at end of file +This file is auto generated at 2021-08-24T04:14:27 \ No newline at end of file diff --git a/src/WebExtensions.Net/IWebExtensionsJSRuntime.cs b/src/WebExtensions.Net/IWebExtensionsJSRuntime.cs deleted file mode 100644 index 678e07e..0000000 --- a/src/WebExtensions.Net/IWebExtensionsJSRuntime.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Threading.Tasks; - -namespace WebExtensions.Net -{ - /// - /// Adapter for IJSRuntime - /// - public interface IWebExtensionsJSRuntime - { - internal static IWebExtensionsJSRuntime StaticInstance { get; set; } - - /// - /// Invokes the specified JavaScript function synchronously. - /// - /// The JSON-serializable return type. - /// An identifier for the function to invoke. For example, the value "someScope.someFunction" will invoke the function window.someScope.someFunction. - /// The option for invocation. - /// JSON-serializable arguments. - /// An instance of TResult obtained by JSON-deserializing the return value. - TValue Invoke(string identifier, InvokeOption invokeOption, params object[] args); - - /// - /// Invokes the specified JavaScript function asynchronously. - /// - /// The JSON-serializable return type. - /// An identifier for the function to invoke. For example, the value "someScope.someFunction" will invoke the function window.someScope.someFunction. - /// The option for invocation. - /// JSON-serializable arguments. - /// An instance of TValue obtained by JSON-deserializing the return value. - ValueTask InvokeAsync(string identifier, InvokeOption invokeOption, params object[] args); - - /// - /// Invokes the specified JavaScript function synchronously. - /// - /// An identifier for the function to invoke. For example, the value "someScope.someFunction" will invoke the function window.someScope.someFunction. - /// The option for invocation. - /// JSON-serializable arguments. - void InvokeVoid(string identifier, InvokeOption invokeOption, params object[] args); - - /// - /// Invokes the specified JavaScript function asynchronously. - /// - /// An identifier for the function to invoke. For example, the value "someScope.someFunction" will invoke the function window.someScope.someFunction. - /// The option for invocation. - /// JSON-serializable arguments. - /// A System.Threading.Tasks.ValueTask that represents the asynchronous invocation operation. - ValueTask InvokeVoidAsync(string identifier, InvokeOption invokeOption, params object[] args); - } -} diff --git a/src/WebExtensions.Net/InvokeFunctionReferenceOption.cs b/src/WebExtensions.Net/InvokeFunctionReferenceOption.cs deleted file mode 100644 index e1977b5..0000000 --- a/src/WebExtensions.Net/InvokeFunctionReferenceOption.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; - -namespace WebExtensions.Net -{ - /// - /// Invoke JavaScript function reference options. - /// - public class InvokeFunctionReferenceOption : InvokeOption - { - /// - /// The identifier for the action 'InvokeFunctionFromDotNet'. - /// - public const string Identifier = "WebExtensionsNet.InvokeFunctionFromDotNet"; - - internal InvokeFunctionReferenceOption(Guid referenceId) - { - ReferenceId = referenceId; - } - - /// - /// Reference ID of the JavaScript function. - /// - public Guid ReferenceId { get; set; } - } -} diff --git a/src/WebExtensions.Net/InvokeObjectReferenceOption.cs b/src/WebExtensions.Net/InvokeObjectReferenceOption.cs deleted file mode 100644 index 363f7dc..0000000 --- a/src/WebExtensions.Net/InvokeObjectReferenceOption.cs +++ /dev/null @@ -1,35 +0,0 @@ -namespace WebExtensions.Net -{ - /// - /// Invoke JavaScript object reference options. - /// - public class InvokeObjectReferenceOption : InvokeOption - { - /// - /// The identifier for the action 'InvokeOnObjectReference'. - /// - public const string Identifier = "WebExtensionsNet.InvokeOnObjectReference"; - - internal InvokeObjectReferenceOption(string referenceId, string targetPath, bool isFunction) - { - ReferenceId = referenceId; - TargetPath = targetPath; - IsFunction = isFunction; - } - - /// - /// The identifier of the JavaScript object. - /// - public string ReferenceId { get; set; } - - /// - /// The target path of the JavaScript object. - /// - public string TargetPath { get; set; } - - /// - /// The indicator if the target is a function. - /// - public bool IsFunction { get; set; } - } -} diff --git a/src/WebExtensions.Net/InvokeOption.cs b/src/WebExtensions.Net/InvokeOption.cs deleted file mode 100644 index 822a648..0000000 --- a/src/WebExtensions.Net/InvokeOption.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace WebExtensions.Net -{ - /// - /// Invoke JavaScript options. - /// - public abstract class InvokeOption - { - /// - /// The identifier to be used as a key for the JavaScript object returned. - /// - public string ReturnObjectReferenceId { get; set; } - } -} diff --git a/src/WebExtensions.Net/JSFunctionProxy.cs b/src/WebExtensions.Net/JSFunctionProxy.cs deleted file mode 100644 index 002807c..0000000 --- a/src/WebExtensions.Net/JSFunctionProxy.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; - -namespace WebExtensions.Net -{ - /// - /// A JS function proxy to be invoked in DotNet. - /// - internal class JSFunctionProxy - { - private static readonly MethodInfo dynamicInvokeMethodInfo = typeof(JSFunctionProxy).GetMethod(nameof(DynamicInvoke), BindingFlags.Public | BindingFlags.Instance); - private readonly Guid id; - - /// - /// Creates a new instance of the JSFunctionProxy class. - /// - /// The function identifier. - public JSFunctionProxy(Guid id) - { - this.id = id; - } - - /// - /// Gets the proxy delegate to invoke the JavaScript function. - /// - /// The delegate type. - /// A delegate matching the signature of the delegate type, when invoked executes the JavaScript function. - public Delegate GetDelegate(Type delegateType) - { - // Generates a lambda expression based on the delegate type. - // Action generates () => DynamicInvoke(new object[]) - // Action generates (arg0) => DynamicInvoke(new object[] { (object)arg0 }) - // Func generates (arg0) => (int)DynamicInvoke(new object[] { (object)arg0 }) - // Action generates (arg0, arg1) => DynamicInvoke(new object[] { (object)arg0, (object)arg1 }) - // Func generates (arg0, arg1) => DynamicInvoke(new object[] { (object)arg0, (object)arg1 }) - - var invokeMethod = delegateType.GetMethod("Invoke"); - var invokeParameters = invokeMethod.GetParameters(); - var parameterExpressions = invokeParameters.Select((invokeParameter, index) => Expression.Parameter(invokeParameter.ParameterType, $"arg{index}")).ToArray(); - - var returnType = invokeMethod.ReturnType == typeof(void) ? typeof(object) : invokeMethod.ReturnType; - var newArrayInitExpression = Expression.NewArrayInit(typeof(object), parameterExpressions.Select(parameterExpression => Expression.Convert(parameterExpression, typeof(object)))); - var methodCallExpression = Expression.Call(Expression.Constant(this), dynamicInvokeMethodInfo.MakeGenericMethod(returnType), newArrayInitExpression); - - Expression expression = methodCallExpression; - if (invokeMethod.ReturnType != typeof(void)) - { - expression = Expression.Convert(methodCallExpression, invokeMethod.ReturnType); - } - - return Expression.Lambda(delegateType, expression, parameterExpressions).Compile(); - } - - /// - /// Dynamically invoke the JavaScript function synchronously. - /// - /// The JSON-serializable return type. - /// JSON-serializable arguments. - /// An instance of TResult obtained by JSON-deserializing the return value. - public TValue DynamicInvoke(object[] arguments) - { - var webExtensionsJsRuntime = IWebExtensionsJSRuntime.StaticInstance; - return webExtensionsJsRuntime.Invoke(InvokeFunctionReferenceOption.Identifier, new InvokeFunctionReferenceOption(id), arguments); - } - } -} diff --git a/src/WebExtensions.Net/Mock/DefaultMockHandlers.cs b/src/WebExtensions.Net/Mock/DefaultMockHandlers.cs deleted file mode 100644 index 8be23d4..0000000 --- a/src/WebExtensions.Net/Mock/DefaultMockHandlers.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; -using WebExtensions.Net.Mock.Configurators; -using WebExtensions.Net.Mock.Handlers; -using WebExtensions.Net.Storage; - -namespace WebExtensions.Net.Mock -{ - internal static class DefaultMockHandlers - { - } -} diff --git a/src/WebExtensions.Net/Mock/MockConfigurationContext.cs b/src/WebExtensions.Net/Mock/MockConfigurationContext.cs index dd21e34..3a6bb1a 100644 --- a/src/WebExtensions.Net/Mock/MockConfigurationContext.cs +++ b/src/WebExtensions.Net/Mock/MockConfigurationContext.cs @@ -19,7 +19,7 @@ public static void Configure() IsConfiguring = true; IsConfigured = false; - var webExtensionsApi = new WebExtensionsApi(new MockWebExtensionsJSRuntime()); + var webExtensionsApi = new WebExtensionsApi(new MockJsRuntimeAdapter()); var configurator = new MockConfigurator(webExtensionsApi); DefaultMockResolver.Configure(configurator); ConfiguredMockResolver.Configure(configurator); diff --git a/src/WebExtensions.Net/Mock/MockJsRuntimeAdapter.cs b/src/WebExtensions.Net/Mock/MockJsRuntimeAdapter.cs new file mode 100644 index 0000000..3712ef6 --- /dev/null +++ b/src/WebExtensions.Net/Mock/MockJsRuntimeAdapter.cs @@ -0,0 +1,172 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using JsBind.Net; +using JsBind.Net.InvokeOptions; + +namespace WebExtensions.Net.Mock +{ + /// + /// Mock adapter for JS runtime, should be used as a singleton. + /// + public class MockJsRuntimeAdapter : IJsRuntimeAdapter + { + private static readonly IDictionary objectReferences = new Dictionary(); + + /// + public TValue Invoke(string identifier, InvokeOptionWithReturnValue invokeOption) + { + return MockInvoke(invokeOption); + } + + /// + public ValueTask InvokeAsync(string identifier, InvokeOptionWithReturnValue invokeOption) + { + return ValueTask.FromResult(MockInvoke(invokeOption)); + } + + /// + public void InvokeVoid(string identifier, InvokeOption invokeOption) + { + MockInvoke(invokeOption); + } + + /// + public ValueTask InvokeVoidAsync(string identifier, InvokeOption invokeOption) + { + MockInvoke(invokeOption); + return ValueTask.CompletedTask; + } + + private TValue MockInvoke(InvokeOption invokeOption) + { + if (!MockConfigurationContext.IsConfigured && !MockConfigurationContext.IsConfiguring) + { + MockConfigurationContext.Configure(); + } + + object result = null; + + if (invokeOption is IGetPropertyOption getPropertyOption) + { + result = MockGetProperty(getPropertyOption); + } + else if (invokeOption is IInvokeFunctionOption invokeFunctionOption) + { + result = MockInvokeFunction(invokeFunctionOption); + } + + if (result is null) + { + return default; + } + + if (invokeOption is InvokeOptionWithReturnValue invokeOptionWithReturnValue && invokeOptionWithReturnValue.HasReturnValue && invokeOptionWithReturnValue.ReturnValueIsReference) + { + var accessPath = AccessPaths.FromReferenceId(invokeOptionWithReturnValue.ReturnValueReferenceId); + InitializeObject(result, accessPath); + objectReferences[invokeOptionWithReturnValue.ReturnValueReferenceId] = result; + } + + return (TValue)result; + } + + private void InitializeObject(object obj, string accessPath) + { + if (obj is BaseObject baseObject) + { + baseObject.Initialize(this, accessPath); + } + else if (obj is IEnumerable enumerable) + { + var index = 0; + foreach (var item in enumerable) + { + var itemAccessPath = AccessPaths.Combine(accessPath, index.ToString()); + InitializeObject(item, itemAccessPath); + index++; + } + } + } + + private static object MockGetProperty(IGetPropertyOption getPropertyOption) + { + var accessPaths = AccessPaths.Split(getPropertyOption.AccessPath); + if (accessPaths is null || !accessPaths.Any()) + { + return null; + } + + var accessPathIdentifier = accessPaths.First(); + var targetPath = AccessPaths.Combine(accessPaths.Skip(1).Concat(new[] { getPropertyOption.PropertyName }).ToArray()); + + if (accessPathIdentifier == "browser") + { + return MockInvokeApi(targetPath, Array.Empty()); + } + + if (!AccessPaths.IsReferenceId(accessPathIdentifier)) + { + return null; + } + + return MockInvokeObjectReference(AccessPaths.GetReferenceId(accessPathIdentifier)?.ToString(), targetPath, Array.Empty()); + } + + private static object MockInvokeFunction(IInvokeFunctionOption invokeFunctionOption) + { + var accessPaths = AccessPaths.Split(invokeFunctionOption.AccessPath); + if (accessPaths is null || !accessPaths.Any()) + { + return null; + } + + var accessPathIdentifier = accessPaths.First(); + var targetPath = AccessPaths.Combine(accessPaths.Skip(1).Concat(new[] { invokeFunctionOption.FunctionName }).ToArray()); + var functionArguments = invokeFunctionOption.FunctionArguments?.ToArray() ?? Array.Empty(); + + if (accessPathIdentifier == "browser") + { + return MockInvokeApi(targetPath, functionArguments); + } + + if (!AccessPaths.IsReferenceId(accessPathIdentifier)) + { + return null; + } + + return MockInvokeObjectReference(AccessPaths.GetReferenceId(accessPathIdentifier)?.ToString(), targetPath, functionArguments); + } + + private static object MockInvokeApi(string targetPath, object[] arguments) + { + if (MockConfigurationContext.IsConfiguring) + { + MockConfigurationContext.ApiInvoked(targetPath); + return null; + } + + return MockResolvers.InvokeApiHandler(targetPath, arguments); + } + + private static object MockInvokeObjectReference(string referenceId, string targetPath, object[] arguments) + { + if (objectReferences.ContainsKey(referenceId)) + { + var objectReference = objectReferences[referenceId]; + + if (MockConfigurationContext.IsConfiguring) + { + MockConfigurationContext.ObjectReferenceInvoked(objectReference, targetPath); + return null; + } + + return MockResolvers.InvokeObjectReferenceHandler(objectReference, targetPath, arguments); + } + + return null; + } + } +} diff --git a/src/WebExtensions.Net/Mock/MockWebExtensionsJSRuntime.cs b/src/WebExtensions.Net/Mock/MockWebExtensionsJSRuntime.cs deleted file mode 100644 index 79ed928..0000000 --- a/src/WebExtensions.Net/Mock/MockWebExtensionsJSRuntime.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace WebExtensions.Net.Mock -{ - /// - /// Mock adapter for IJSRuntime, should be used as a singleton. - /// - public class MockWebExtensionsJSRuntime : IWebExtensionsJSRuntime - { - private static readonly IDictionary objectReferences = new Dictionary(); - - /// - /// Creates a new instance of MockWebExtensionsJSRuntime. - /// - public MockWebExtensionsJSRuntime() - { - IWebExtensionsJSRuntime.StaticInstance = this; - } - - /// - public ValueTask InvokeAsync(string identifier, InvokeOption invokeOption, params object[] args) - { - return ValueTask.FromResult(MockInvoke(identifier, invokeOption, args)); - } - - /// - public ValueTask InvokeVoidAsync(string identifier, InvokeOption invokeOption, params object[] args) - { - MockInvoke(identifier, invokeOption, args); - return ValueTask.CompletedTask; - } - - /// - public TValue Invoke(string identifier, InvokeOption invokeOption, params object[] args) - { - return MockInvoke(identifier, invokeOption, args); - } - - /// - public void InvokeVoid(string identifier, InvokeOption invokeOption, params object[] args) - { - MockInvoke(identifier, invokeOption, args); - } - - private TValue MockInvoke(string identifier, InvokeOption invokeOption, object[] args) - { - if (!MockConfigurationContext.IsConfigured && !MockConfigurationContext.IsConfiguring) - { - MockConfigurationContext.Configure(); - } - - object result = null; - - if (identifier == InvokeObjectReferenceOption.Identifier) - { - var invokeObjectReferenceOption = invokeOption as InvokeObjectReferenceOption; - result = MockInvokeObjectReference(invokeObjectReferenceOption, args); - } - - if (typeof(BaseObject).IsAssignableFrom(typeof(TValue)) && result is BaseObject baseObject) - { - var objectReferenceId = Guid.NewGuid().ToString(); - objectReferences[objectReferenceId] = baseObject; - baseObject.Initialize(this, objectReferenceId, null); - } - - if (result is null) - { - return default; - } - - return (TValue)result; - } - - private static object MockInvokeObjectReference(InvokeObjectReferenceOption invokeObjectReferenceOption, object[] arguments) - { - var referenceId = invokeObjectReferenceOption.ReferenceId; - var targetPath = invokeObjectReferenceOption.TargetPath; - - if (referenceId == "browser") - { - if (MockConfigurationContext.IsConfiguring) - { - MockConfigurationContext.ApiInvoked(targetPath); - return null; - } - - return MockResolvers.InvokeApiHandler(targetPath, arguments); - } - - if (objectReferences.ContainsKey(referenceId)) - { - var objectReference = objectReferences[referenceId]; - - if (MockConfigurationContext.IsConfiguring) - { - MockConfigurationContext.ObjectReferenceInvoked(objectReference, targetPath); - return null; - } - - return MockResolvers.InvokeObjectReferenceHandler(objectReference, targetPath, arguments); - } - - return null; - } - } -} diff --git a/src/WebExtensions.Net/RemoveObjectReferenceOption.cs b/src/WebExtensions.Net/RemoveObjectReferenceOption.cs deleted file mode 100644 index 1f6f52b..0000000 --- a/src/WebExtensions.Net/RemoveObjectReferenceOption.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace WebExtensions.Net -{ - /// - /// Remove JavaScript object reference options. - /// - public class RemoveObjectReferenceOption : InvokeOption - { - /// - /// The identifier for the action 'RemoveObjectReference'. - /// - public const string Identifier = "WebExtensionsNet.RemoveObjectReference"; - - internal RemoveObjectReferenceOption(string referenceId) - { - ReferenceId = referenceId; - } - - /// - /// Reference ID of the JavaScript object. - /// - public string ReferenceId { get; set; } - } -} diff --git a/src/WebExtensions.Net/WebExtensions.Net.csproj b/src/WebExtensions.Net/WebExtensions.Net.csproj index 7a3886b..e18f3c5 100644 --- a/src/WebExtensions.Net/WebExtensions.Net.csproj +++ b/src/WebExtensions.Net/WebExtensions.Net.csproj @@ -22,14 +22,6 @@ - - true - build - - - true - content - true @@ -37,7 +29,7 @@ - + diff --git a/src/WebExtensions.Net/WebExtensionsJSRuntime.cs b/src/WebExtensions.Net/WebExtensionsJSRuntime.cs deleted file mode 100644 index 389ec14..0000000 --- a/src/WebExtensions.Net/WebExtensionsJSRuntime.cs +++ /dev/null @@ -1,100 +0,0 @@ -using Microsoft.JSInterop; -using System; -using System.Linq; -using System.Text.Json; -using System.Threading.Tasks; - -namespace WebExtensions.Net -{ - /// - /// Adapter for IJSRuntime - /// - public class WebExtensionsJSRuntime : IWebExtensionsJSRuntime - { - private readonly IJSRuntime jsRuntime; - private const string GetLastInvocationResultIdentifier = "WebExtensionsNet.GetLastInvocationResult"; - - /// - /// Creates a new instance of WebExtensionsJSRuntime. - /// - /// The IJSRuntime instance. - public WebExtensionsJSRuntime(IJSRuntime jsRuntime) - { - IWebExtensionsJSRuntime.StaticInstance = this; - this.jsRuntime = jsRuntime; - } - - /// - public async ValueTask InvokeAsync(string identifier, InvokeOption invokeOption, params object[] args) - { - if (typeof(BaseObject).IsAssignableFrom(typeof(TValue))) - { - invokeOption.ReturnObjectReferenceId = Guid.NewGuid().ToString(); - } - var invokeArgs = new object[] { invokeOption }.Concat(ArgumentsHandler.ProcessOutgoingArguments(args)).ToArray(); - - TValue result; - try - { - result = await jsRuntime.InvokeAsync(identifier, invokeArgs); - } - catch (JsonException jsonException) - { - var json = await jsRuntime.InvokeAsync(GetLastInvocationResultIdentifier); - throw new JsonException($"Last invocation result: {json}", jsonException); - } - - if (!string.IsNullOrEmpty(invokeOption.ReturnObjectReferenceId) && result is BaseObject baseObject) - { - baseObject.Initialize(this, invokeOption.ReturnObjectReferenceId, null); - } - return result; - } - - /// - public ValueTask InvokeVoidAsync(string identifier, InvokeOption invokeOption, params object[] args) - { - var invokeArgs = new object[] { invokeOption }.Concat(ArgumentsHandler.ProcessOutgoingArguments(args)).ToArray(); - return jsRuntime.InvokeVoidAsync(identifier, invokeArgs); - } - - /// - public TValue Invoke(string identifier, InvokeOption invokeOption, params object[] args) - { - if (typeof(BaseObject).IsAssignableFrom(typeof(TValue))) - { - invokeOption.ReturnObjectReferenceId = Guid.NewGuid().ToString(); - } - var invokeArgs = new object[] { invokeOption }.Concat(ArgumentsHandler.ProcessOutgoingArguments(args)).ToArray(); - - if (jsRuntime is not IJSInProcessRuntime jsInProcessRuntime) - { - throw new InvalidOperationException($"Unable to cast JS runtime to type {nameof(IJSInProcessRuntime)}"); - } - - TValue result; - try - { - result = jsInProcessRuntime.Invoke(identifier, invokeArgs); - } - catch (JsonException jsonException) - { - var json = jsInProcessRuntime.Invoke(GetLastInvocationResultIdentifier); - throw new JsonException($"Last invocation result: {json}", jsonException); - } - - if (!string.IsNullOrEmpty(invokeOption.ReturnObjectReferenceId) && result is BaseObject baseObject) - { - baseObject.Initialize(this, invokeOption.ReturnObjectReferenceId, null); - } - return result; - } - - /// - public void InvokeVoid(string identifier, InvokeOption invokeOption, params object[] args) - { - var invokeArgs = new object[] { invokeOption }.Concat(ArgumentsHandler.ProcessOutgoingArguments(args)).ToArray(); - ((IJSInProcessRuntime)jsRuntime).InvokeVoid(identifier, invokeArgs); - } - } -} diff --git a/src/WebExtensions.Net/build/WebExtensions.Net.props b/src/WebExtensions.Net/build/WebExtensions.Net.props deleted file mode 100644 index daa3bd3..0000000 --- a/src/WebExtensions.Net/build/WebExtensions.Net.props +++ /dev/null @@ -1,9 +0,0 @@ - - - - - wwwroot - true - - - \ No newline at end of file diff --git a/src/WebExtensions.Net/build/WebExtensions.Net.targets b/src/WebExtensions.Net/build/WebExtensions.Net.targets deleted file mode 100644 index 4533d72..0000000 --- a/src/WebExtensions.Net/build/WebExtensions.Net.targets +++ /dev/null @@ -1,15 +0,0 @@ - - - - - $(MSBuildThisFileDirectory)..\content\WebExtensionsScripts - $(WebExtensionsAssetsPath)\WebExtensionsScripts - - - - - Always - - - - \ No newline at end of file diff --git a/src/WebExtensions.Net/content/WebExtensionsScripts/Modules/ArgumentsHandler.js b/src/WebExtensions.Net/content/WebExtensionsScripts/Modules/ArgumentsHandler.js deleted file mode 100644 index 952ba4b..0000000 --- a/src/WebExtensions.Net/content/WebExtensionsScripts/Modules/ArgumentsHandler.js +++ /dev/null @@ -1,67 +0,0 @@ -import FunctionReferenceHandler from "./FunctionReferenceHandler.js"; - -/** - * Process incoming and outgoing arguments. - */ -export default class ArgumentsHandler { - /** - * Process incoming arguments. - * @param {object[]} incomingArguments The incoming arguments. - * @returns {object[]} The processed incoming arguments. - */ - static ProcessIncomingArguments(incomingArguments) { - return incomingArguments.map(incomingArgument => { - if (incomingArgument && incomingArgument.__isDelegateReference) { - return FunctionReferenceHandler.GetDotnetProxyFunction(incomingArgument.__id); - } - - return incomingArgument; - }); - } - - /** - * Process outgoing arguments. - * @param {object[]} outgoingArguments The outgoing arguments. - * @returns {object[]} The processed outgoing arguments. - */ - static ProcessOutgoingArguments(outgoingArguments) { - return outgoingArguments.map(this.ProcessOutgoingArgument); - } - - /** - * Process outgoing argument. - * @param {object} outgoingArgument The outgoing argument. - * @returns {object} The processed outgoing argument. - */ - static ProcessOutgoingArgument(outgoingArgument) { - if (outgoingArgument === undefined || outgoingArgument === null) { - return outgoingArgument; - } - - if (outgoingArgument instanceof Function) { - return FunctionReferenceHandler.GetJSFunctionReference(outgoingArgument); - } - - if (outgoingArgument instanceof Window || outgoingArgument?.["window"] === outgoingArgument) { - return this._ProcessWindowArgument(outgoingArgument); - } - - return outgoingArgument; - } - - /** - * Process window argument. - * @param {Window} windowObject The window object. - * @returns {object} The processed window object. - */ - static _ProcessWindowArgument(windowObject) { - var processedWindowObject = {}; - for (const [key, value] of Object.entries(windowObject)) { - if (value == windowObject) { - continue; - } - processedWindowObject[key] = value; - } - return processedWindowObject; - } -} \ No newline at end of file diff --git a/src/WebExtensions.Net/content/WebExtensionsScripts/Modules/DotNetDelegateProxy.js b/src/WebExtensions.Net/content/WebExtensionsScripts/Modules/DotNetDelegateProxy.js deleted file mode 100644 index c367437..0000000 --- a/src/WebExtensions.Net/content/WebExtensionsScripts/Modules/DotNetDelegateProxy.js +++ /dev/null @@ -1,35 +0,0 @@ -import ArgumentsHandler from "./ArgumentsHandler.js"; - -/** - * A DotNet delegate proxy to be invoked in JS. - */ -export default class DotNetDelegateProxy { - _id; - - /** - * Creates a new instance of the DotNetDelegateProxy class. - * @param {string} id The delegate identifier. - */ - constructor(id) { - this._id = id; - } - - /** - * Gets the proxy function to invoke the DotNet delegate. - * @returns {Function} A function, when invoked executes the DotNet delegate. - */ - getFunction() { - return this.dynamicInvoke.bind(this); - } - - /** - * Dynamically invoke the DotNet delegate synchronously. - * @param {...any} invokeArgs JSON-serializable arguments. - * @returns {object} An object obtained by JSON-deserializing the return value. - */ - dynamicInvoke(...invokeArgs) { - const id = this._id; - const processedInvokeArgs = ArgumentsHandler.ProcessOutgoingArguments(invokeArgs); - return globalThis.DotNet.invokeMethod("WebExtensions.Net", "InvokeDelegateFromJS", id, processedInvokeArgs); - } -} \ No newline at end of file diff --git a/src/WebExtensions.Net/content/WebExtensionsScripts/Modules/FunctionReferenceHandler.js b/src/WebExtensions.Net/content/WebExtensionsScripts/Modules/FunctionReferenceHandler.js deleted file mode 100644 index 0300847..0000000 --- a/src/WebExtensions.Net/content/WebExtensionsScripts/Modules/FunctionReferenceHandler.js +++ /dev/null @@ -1,60 +0,0 @@ -import DotNetDelegateProxy from "./DotNetDelegateProxy.js"; -import Guid from "./Guid.js"; -import JSFunctionReference from "./JSFunctionReference.js"; - -/** - * Handles passing function reference to be invoked in DotNet. - */ -export default class FunctionReferenceHandler { - static _functionReferences = {}; - static _dotnetProxyFunctions = {}; - - /** - * Invoke a function reference from DotNet. - * @param {string} id The identifier of the function. - * @param {object[]} args The arguments to invoke the delegate. - * @returns {object} The result of the function invocation. - */ - static InvokeFunctionFromDotNet(id, args) { - if (this._functionReferences[id]) { - return this._functionReferences[id].apply(null, args); - } - - throw new Error("Function reference does not exist."); - } - - /** - * Gets an instance of JSFunctionReference representing the function. - * @param {Function} functionArgument The function. - * @returns {JSFunctionReference} An instance of JSFunctionReference referencing the function argument. - */ - static GetJSFunctionReference(functionArgument) { - let functionReferenceId; - if (Object.values(this._functionReferences).includes(functionArgument)) { - functionReferenceId = Object.entries(this._functionReferences) - .map(([key, value]) => { return { key, value }; }) - .find(({ value }) => value === functionArgument).key; - } else { - functionReferenceId = Guid.NewGuid(); - this._functionReferences[functionReferenceId] = functionArgument; - } - - return new JSFunctionReference(functionReferenceId); - } - - /** - * Gets the proxy function to invoke the DotNet delegate. - * @param {string} id The identifier of the delegate. - * @returns {Function} A function, when invoked executes the DotNet delegate. - */ - static GetDotnetProxyFunction(id) { - if (this._dotnetProxyFunctions[id]) { - return this._dotnetProxyFunctions[id]; - } - - const delegateProxy = new DotNetDelegateProxy(id); - const proxyFunction = delegateProxy.getFunction(); - this._dotnetProxyFunctions[id] = proxyFunction; - return proxyFunction; - } -} \ No newline at end of file diff --git a/src/WebExtensions.Net/content/WebExtensionsScripts/Modules/Guid.js b/src/WebExtensions.Net/content/WebExtensionsScripts/Modules/Guid.js deleted file mode 100644 index 2585992..0000000 --- a/src/WebExtensions.Net/content/WebExtensionsScripts/Modules/Guid.js +++ /dev/null @@ -1,12 +0,0 @@ -export default class Guid { - /** - * Generates a new Guid. - * @returns {string} A Guid string. - */ - static NewGuid() { - return (1e7.toString() + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c => { - const d = parseInt(c); - return (d ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> d / 4).toString(16); - }); - } -} \ No newline at end of file diff --git a/src/WebExtensions.Net/content/WebExtensionsScripts/Modules/JSFunctionReference.js b/src/WebExtensions.Net/content/WebExtensionsScripts/Modules/JSFunctionReference.js deleted file mode 100644 index c360361..0000000 --- a/src/WebExtensions.Net/content/WebExtensionsScripts/Modules/JSFunctionReference.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * A JavaScript function reference to be invoked in DotNet. - */ -export default class JSFunctionReference { - /** - * Creates a new instance of the JSFunctionReference class. - * @param {string} id The identifier. - */ - constructor(id) { - this.__id = id; - } - - /** - * @type {boolean} Indicate that this object is a JavaScript function reference. - */ - __isFunctionReference = true; - - /** - * @type {string} The identifier of this JavaScript function reference. - */ - __id; -} \ No newline at end of file diff --git a/src/WebExtensions.Net/content/WebExtensionsScripts/Modules/WebExtensions.js b/src/WebExtensions.Net/content/WebExtensionsScripts/Modules/WebExtensions.js deleted file mode 100644 index 5e8e263..0000000 --- a/src/WebExtensions.Net/content/WebExtensionsScripts/Modules/WebExtensions.js +++ /dev/null @@ -1,113 +0,0 @@ -import ArgumentsHandler from "./ArgumentsHandler.js"; -import FunctionReferenceHandler from "./FunctionReferenceHandler.js"; - -export default class WebExtensions { - /** - * @type {object} The object references. - */ - _objectReferences = {}; - - /** - * @type {number} The count of the object references. - */ - _objectReferencesCount = 0; - - /** - * @type {object} The last invocation result, stored for logging when JSON exception is thrown in .Net. - */ - _lastInvocationResult = null; - - /** - * Invoke on an object reference. - * @param {object} invokeOption The option for invocation. - * @param {string} invokeOption.referenceId The identifier of the JavaScript object. - * @param {string} invokeOption.targetPath The target path of the JavaScript object. - * @param {boolean} invokeOption.isFunction The indicator if the target is a function. - * @param {string} invokeOption.returnObjectReferenceId The identifier to be used as a key for the JavaScript object returned. - * @returns {Promise} The result of the invocation. - */ - async InvokeOnObjectReference({ referenceId, targetPath, isFunction, returnObjectReferenceId }, ...args) { - let targetObject = this._objectReferences[referenceId]; - let targetMember = targetPath; - if (referenceId === "browser") { - targetObject = globalThis.browser; - } - const targetPaths = targetPath.split("."); - for (let i = 0; i < targetPaths.length; i++) { - if (i === targetPaths.length - 1) { - targetMember = targetPaths[i]; - } else { - targetObject = targetObject?.[targetPaths[i]]; - } - } - - if (isFunction && !targetObject?.[targetMember]) { - throw new Error(`Unable to find function ${targetPath} on object '${referenceId}'.`); - } - - const processedArgs = ArgumentsHandler.ProcessIncomingArguments(args); - try { - let result = isFunction ? targetObject[targetMember].apply(targetObject, processedArgs) : targetObject?.[targetMember]; - if (result instanceof Promise) { - result = await result; - } - - result = ArgumentsHandler.ProcessOutgoingArgument(result); - - if (returnObjectReferenceId) { - this._objectReferencesCount++; - this._objectReferences[returnObjectReferenceId] = result; - } - - this._lastInvocationResult = result; - return result; - } catch (error) { - console.error(referenceId, targetPath, processedArgs, targetObject, targetMember, args); - throw new Error(`Failed to execute function ${targetPath} on object '${referenceId}': ${error.message}`); - } - } - - /** - * Remove an object reference. - * @param {object} invokeOption The option for invocation. - * @param {string} invokeOption.referenceId The identifier of the object reference. - */ - RemoveObjectReference({ referenceId }) { - if (this._objectReferences[referenceId] !== null) { - this._objectReferencesCount--; - this._objectReferences[referenceId] = null; - } - } - - /** - * Gets the object references. - * @returns {object} The object references. - */ - GetObjectReferences() { return this._objectReferences; } - - /** - * Gets the count of the object references. - * @returns {number} The count of the object references. - */ - GetObjectReferencesCount() { return this._objectReferencesCount; } - - /** - * Invoke a function reference synchronously. - * @param {object} invokeOption The option for invocation. - * @param {string} invokeOption.referenceId The identifier of the function. - * @param {...any} args The arguments to invoke the delegate. - * @returns {object} The result of the function invocation. - */ - InvokeFunctionFromDotNet({ referenceId }, ...args) { - const result = FunctionReferenceHandler.InvokeFunctionFromDotNet(referenceId, args); - this._lastInvocationResult = result; - return result; - } - - /** - * Returns the last invocation result, called when JSON exception is thrown in .Net. - */ - GetLastInvocationResult() { - return JSON.stringify(this._lastInvocationResult); - } -} \ No newline at end of file diff --git a/src/WebExtensions.Net/content/WebExtensionsScripts/WebExtensionsNet.js b/src/WebExtensions.Net/content/WebExtensionsScripts/WebExtensionsNet.js deleted file mode 100644 index d0d9284..0000000 --- a/src/WebExtensions.Net/content/WebExtensionsScripts/WebExtensionsNet.js +++ /dev/null @@ -1,4 +0,0 @@ -(async () => { - var WebExtensions = (await import("./Modules/WebExtensions.js")).default; - globalThis.WebExtensionsNet = new WebExtensions(); -})(); \ No newline at end of file diff --git a/test/WebExtensions.Net.BrowserExtensionIntegrationTest/WebExtensions.Net.BrowserExtensionIntegrationTest.csproj b/test/WebExtensions.Net.BrowserExtensionIntegrationTest/WebExtensions.Net.BrowserExtensionIntegrationTest.csproj index dab7135..2d98ebf 100644 --- a/test/WebExtensions.Net.BrowserExtensionIntegrationTest/WebExtensions.Net.BrowserExtensionIntegrationTest.csproj +++ b/test/WebExtensions.Net.BrowserExtensionIntegrationTest/WebExtensions.Net.BrowserExtensionIntegrationTest.csproj @@ -19,11 +19,8 @@ - - -