diff --git a/src/WebExtension.Net/Generated/ContentScripts/ContentScripts.json b/src/WebExtension.Net/Generated/ContentScripts/ContentScripts.json index 0aa04dc..cfdaef2 100644 --- a/src/WebExtension.Net/Generated/ContentScripts/ContentScripts.json +++ b/src/WebExtension.Net/Generated/ContentScripts/ContentScripts.json @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - [ { "namespace": "contentScripts", diff --git a/src/WebExtension.Net/Generated/ContentScripts/ContentScriptsAPI.cs b/src/WebExtension.Net/Generated/ContentScripts/ContentScriptsAPI.cs index dfc61a3..bdcd28b 100644 --- a/src/WebExtension.Net/Generated/ContentScripts/ContentScriptsAPI.cs +++ b/src/WebExtension.Net/Generated/ContentScripts/ContentScriptsAPI.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -8,17 +6,17 @@ namespace WebExtension.Net.ContentScripts { /// - public class ContentScriptsAPI : IContentScriptsAPI + public class ContentScriptsAPI : BaseAPI, IContentScriptsAPI { - private readonly WebExtensionJSRuntime webExtensionJSRuntime; /// Creates a new instance of ContentScriptsAPI. /// Web Extension JS Runtime - public ContentScriptsAPI(WebExtensionJSRuntime webExtensionJSRuntime) + public ContentScriptsAPI(WebExtensionJSRuntime webExtensionJSRuntime) : base(webExtensionJSRuntime, "contentScripts") { - this.webExtensionJSRuntime = webExtensionJSRuntime; } + + // Function Definition /// /// Register a content script programmatically @@ -26,7 +24,7 @@ public ContentScriptsAPI(WebExtensionJSRuntime webExtensionJSRuntime) /// public virtual ValueTask Register(RegisteredContentScriptOptions contentScriptOptions) { - return webExtensionJSRuntime.InvokeVoidAsync("contentScripts.register", contentScriptOptions); + return InvokeVoidAsync("register", contentScriptOptions); } } } diff --git a/src/WebExtension.Net/Generated/ContentScripts/IContentScriptsAPI.cs b/src/WebExtension.Net/Generated/ContentScripts/IContentScriptsAPI.cs index a47d08b..a9c3f91 100644 --- a/src/WebExtension.Net/Generated/ContentScripts/IContentScriptsAPI.cs +++ b/src/WebExtension.Net/Generated/ContentScripts/IContentScriptsAPI.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -13,6 +11,8 @@ namespace WebExtension.Net.ContentScripts public interface IContentScriptsAPI { + + // Function Definition Interface /// /// Register a content script programmatically diff --git a/src/WebExtension.Net/Generated/ContentScripts/RegisteredContentScript.cs b/src/WebExtension.Net/Generated/ContentScripts/RegisteredContentScript.cs index ed4f713..df05f07 100644 --- a/src/WebExtension.Net/Generated/ContentScripts/RegisteredContentScript.cs +++ b/src/WebExtension.Net/Generated/ContentScripts/RegisteredContentScript.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -21,7 +19,7 @@ public class RegisteredContentScript : BaseObject /// public virtual ValueTask Unregister() { - return webExtensionJSRuntime.InvokeVoidAsync(""); + return InvokeVoidAsync("unregister"); } } } diff --git a/src/WebExtension.Net/Generated/ContentScripts/RegisteredContentScriptOptions.cs b/src/WebExtension.Net/Generated/ContentScripts/RegisteredContentScriptOptions.cs index c9411e7..f741ce0 100644 --- a/src/WebExtension.Net/Generated/ContentScripts/RegisteredContentScriptOptions.cs +++ b/src/WebExtension.Net/Generated/ContentScripts/RegisteredContentScriptOptions.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,71 +10,179 @@ namespace WebExtension.Net.ContentScripts /// /// Details of a content script registered programmatically /// - public class RegisteredContentScriptOptions + public class RegisteredContentScriptOptions : BaseObject { // Property Definition + private IEnumerable _matches; /// /// /// [JsonPropertyName("matches")] - public IEnumerable Matches { get; set; } + public IEnumerable Matches + { + get + { + InitializeProperty("matches", _matches); + return _matches; + } + set + { + _matches = value; + } + } // Property Definition + private IEnumerable _excludeMatches; /// /// /// [JsonPropertyName("excludeMatches")] - public IEnumerable ExcludeMatches { get; set; } + public IEnumerable ExcludeMatches + { + get + { + InitializeProperty("excludeMatches", _excludeMatches); + return _excludeMatches; + } + set + { + _excludeMatches = value; + } + } // Property Definition + private IEnumerable _includeGlobs; /// /// /// [JsonPropertyName("includeGlobs")] - public IEnumerable IncludeGlobs { get; set; } + public IEnumerable IncludeGlobs + { + get + { + InitializeProperty("includeGlobs", _includeGlobs); + return _includeGlobs; + } + set + { + _includeGlobs = value; + } + } // Property Definition + private IEnumerable _excludeGlobs; /// /// /// [JsonPropertyName("excludeGlobs")] - public IEnumerable ExcludeGlobs { get; set; } + public IEnumerable ExcludeGlobs + { + get + { + InitializeProperty("excludeGlobs", _excludeGlobs); + return _excludeGlobs; + } + set + { + _excludeGlobs = value; + } + } // Property Definition + private IEnumerable _css; /// /// The list of CSS files to inject /// [JsonPropertyName("css")] - public IEnumerable Css { get; set; } + public IEnumerable Css + { + get + { + InitializeProperty("css", _css); + return _css; + } + set + { + _css = value; + } + } // Property Definition + private IEnumerable _js; /// /// The list of JS files to inject /// [JsonPropertyName("js")] - public IEnumerable Js { get; set; } + public IEnumerable Js + { + get + { + InitializeProperty("js", _js); + return _js; + } + set + { + _js = value; + } + } // Property Definition + private bool? _allFrames; /// /// 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")] - public bool? AllFrames { get; set; } + public bool? AllFrames + { + get + { + InitializeProperty("allFrames", _allFrames); + return _allFrames; + } + set + { + _allFrames = value; + } + } // Property Definition + private bool? _matchAboutBlank; /// /// 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")] - public bool? MatchAboutBlank { get; set; } + public bool? MatchAboutBlank + { + get + { + InitializeProperty("matchAboutBlank", _matchAboutBlank); + return _matchAboutBlank; + } + set + { + _matchAboutBlank = value; + } + } // Property Definition + private ExtensionTypes.RunAt _runAt; /// /// The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle". /// [JsonPropertyName("runAt")] - public ExtensionTypes.RunAt RunAt { get; set; } + public ExtensionTypes.RunAt RunAt + { + get + { + InitializeProperty("runAt", _runAt); + return _runAt; + } + set + { + _runAt = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/ContentScripts/generated.txt b/src/WebExtension.Net/Generated/ContentScripts/generated.txt index e69de29..a7fc8fc 100644 --- a/src/WebExtension.Net/Generated/ContentScripts/generated.txt +++ b/src/WebExtension.Net/Generated/ContentScripts/generated.txt @@ -0,0 +1 @@ +This file is auto generated at 2021-03-26T07:08:47 \ No newline at end of file diff --git a/src/WebExtension.Net/Generated/Events/Event.cs b/src/WebExtension.Net/Generated/Events/Event.cs index a030014..09c2bfa 100644 --- a/src/WebExtension.Net/Generated/Events/Event.cs +++ b/src/WebExtension.Net/Generated/Events/Event.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -21,7 +19,7 @@ public class Event : BaseObject /// public virtual ValueTask AddListener() { - return webExtensionJSRuntime.InvokeVoidAsync(""); + return InvokeVoidAsync("addListener"); } // Function Definition @@ -30,7 +28,7 @@ public virtual ValueTask AddListener() /// public virtual ValueTask RemoveListener() { - return webExtensionJSRuntime.InvokeVoidAsync(""); + return InvokeVoidAsync("removeListener"); } // Function Definition @@ -40,7 +38,7 @@ public virtual ValueTask RemoveListener() /// public virtual ValueTask HasListener() { - return webExtensionJSRuntime.InvokeAsync(""); + return InvokeAsync("hasListener"); } // Function Definition @@ -50,7 +48,7 @@ public virtual ValueTask HasListener() /// public virtual ValueTask HasListeners() { - return webExtensionJSRuntime.InvokeAsync(""); + return InvokeAsync("hasListeners"); } } } diff --git a/src/WebExtension.Net/Generated/Events/Events.json b/src/WebExtension.Net/Generated/Events/Events.json index bab21c2..035bebc 100644 --- a/src/WebExtension.Net/Generated/Events/Events.json +++ b/src/WebExtension.Net/Generated/Events/Events.json @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - [ { "namespace": "events", diff --git a/src/WebExtension.Net/Generated/Events/Rule.cs b/src/WebExtension.Net/Generated/Events/Rule.cs index 61eedba..64988ae 100644 --- a/src/WebExtension.Net/Generated/Events/Rule.cs +++ b/src/WebExtension.Net/Generated/Events/Rule.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,43 +10,103 @@ namespace WebExtension.Net.Events /// /// Description of a declarative rule for handling events. /// - public class Rule + public class Rule : BaseObject { // Property Definition + private string _id; /// /// Optional identifier that allows referencing this rule. /// [JsonPropertyName("id")] - public string Id { get; set; } + public string Id + { + get + { + InitializeProperty("id", _id); + return _id; + } + set + { + _id = value; + } + } // Property Definition + private IEnumerable _tags; /// /// Tags can be used to annotate rules and perform operations on sets of rules. /// [JsonPropertyName("tags")] - public IEnumerable Tags { get; set; } + public IEnumerable Tags + { + get + { + InitializeProperty("tags", _tags); + return _tags; + } + set + { + _tags = value; + } + } // Property Definition + private IEnumerable _conditions; /// /// List of conditions that can trigger the actions. /// [JsonPropertyName("conditions")] - public IEnumerable Conditions { get; set; } + public IEnumerable Conditions + { + get + { + InitializeProperty("conditions", _conditions); + return _conditions; + } + set + { + _conditions = value; + } + } // Property Definition + private IEnumerable _actions; /// /// List of actions that are triggered if one of the condtions is fulfilled. /// [JsonPropertyName("actions")] - public IEnumerable Actions { get; set; } + public IEnumerable Actions + { + get + { + InitializeProperty("actions", _actions); + return _actions; + } + set + { + _actions = value; + } + } // Property Definition + private int? _priority; /// /// Optional priority of this rule. Defaults to 100. /// [JsonPropertyName("priority")] - public int? Priority { get; set; } + public int? Priority + { + get + { + InitializeProperty("priority", _priority); + return _priority; + } + set + { + _priority = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Events/UrlFilter.cs b/src/WebExtension.Net/Generated/Events/UrlFilter.cs index 3613366..218ebf0 100644 --- a/src/WebExtension.Net/Generated/Events/UrlFilter.cs +++ b/src/WebExtension.Net/Generated/Events/UrlFilter.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,148 +10,388 @@ namespace WebExtension.Net.Events /// /// Filters URLs for various criteria. See event filtering. All criteria are case sensitive. /// - public class UrlFilter + public class UrlFilter : BaseObject { // Property Definition + private string _hostContains; /// /// 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")] - public string HostContains { get; set; } + public string HostContains + { + get + { + InitializeProperty("hostContains", _hostContains); + return _hostContains; + } + set + { + _hostContains = value; + } + } // Property Definition + private string _hostEquals; /// /// Matches if the host name of the URL is equal to a specified string. /// [JsonPropertyName("hostEquals")] - public string HostEquals { get; set; } + public string HostEquals + { + get + { + InitializeProperty("hostEquals", _hostEquals); + return _hostEquals; + } + set + { + _hostEquals = value; + } + } // Property Definition + private string _hostPrefix; /// /// Matches if the host name of the URL starts with a specified string. /// [JsonPropertyName("hostPrefix")] - public string HostPrefix { get; set; } + public string HostPrefix + { + get + { + InitializeProperty("hostPrefix", _hostPrefix); + return _hostPrefix; + } + set + { + _hostPrefix = value; + } + } // Property Definition + private string _hostSuffix; /// /// Matches if the host name of the URL ends with a specified string. /// [JsonPropertyName("hostSuffix")] - public string HostSuffix { get; set; } + public string HostSuffix + { + get + { + InitializeProperty("hostSuffix", _hostSuffix); + return _hostSuffix; + } + set + { + _hostSuffix = value; + } + } // Property Definition + private string _pathContains; /// /// Matches if the path segment of the URL contains a specified string. /// [JsonPropertyName("pathContains")] - public string PathContains { get; set; } + public string PathContains + { + get + { + InitializeProperty("pathContains", _pathContains); + return _pathContains; + } + set + { + _pathContains = value; + } + } // Property Definition + private string _pathEquals; /// /// Matches if the path segment of the URL is equal to a specified string. /// [JsonPropertyName("pathEquals")] - public string PathEquals { get; set; } + public string PathEquals + { + get + { + InitializeProperty("pathEquals", _pathEquals); + return _pathEquals; + } + set + { + _pathEquals = value; + } + } // Property Definition + private string _pathPrefix; /// /// Matches if the path segment of the URL starts with a specified string. /// [JsonPropertyName("pathPrefix")] - public string PathPrefix { get; set; } + public string PathPrefix + { + get + { + InitializeProperty("pathPrefix", _pathPrefix); + return _pathPrefix; + } + set + { + _pathPrefix = value; + } + } // Property Definition + private string _pathSuffix; /// /// Matches if the path segment of the URL ends with a specified string. /// [JsonPropertyName("pathSuffix")] - public string PathSuffix { get; set; } + public string PathSuffix + { + get + { + InitializeProperty("pathSuffix", _pathSuffix); + return _pathSuffix; + } + set + { + _pathSuffix = value; + } + } // Property Definition + private string _queryContains; /// /// Matches if the query segment of the URL contains a specified string. /// [JsonPropertyName("queryContains")] - public string QueryContains { get; set; } + public string QueryContains + { + get + { + InitializeProperty("queryContains", _queryContains); + return _queryContains; + } + set + { + _queryContains = value; + } + } // Property Definition + private string _queryEquals; /// /// Matches if the query segment of the URL is equal to a specified string. /// [JsonPropertyName("queryEquals")] - public string QueryEquals { get; set; } + public string QueryEquals + { + get + { + InitializeProperty("queryEquals", _queryEquals); + return _queryEquals; + } + set + { + _queryEquals = value; + } + } // Property Definition + private string _queryPrefix; /// /// Matches if the query segment of the URL starts with a specified string. /// [JsonPropertyName("queryPrefix")] - public string QueryPrefix { get; set; } + public string QueryPrefix + { + get + { + InitializeProperty("queryPrefix", _queryPrefix); + return _queryPrefix; + } + set + { + _queryPrefix = value; + } + } // Property Definition + private string _querySuffix; /// /// Matches if the query segment of the URL ends with a specified string. /// [JsonPropertyName("querySuffix")] - public string QuerySuffix { get; set; } + public string QuerySuffix + { + get + { + InitializeProperty("querySuffix", _querySuffix); + return _querySuffix; + } + set + { + _querySuffix = value; + } + } // Property Definition + private string _urlContains; /// /// 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")] - public string UrlContains { get; set; } + public string UrlContains + { + get + { + InitializeProperty("urlContains", _urlContains); + return _urlContains; + } + set + { + _urlContains = value; + } + } // Property Definition + private string _urlEquals; /// /// 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")] - public string UrlEquals { get; set; } + public string UrlEquals + { + get + { + InitializeProperty("urlEquals", _urlEquals); + return _urlEquals; + } + set + { + _urlEquals = value; + } + } // Property Definition + private string _urlMatches; /// /// 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")] - public string UrlMatches { get; set; } + public string UrlMatches + { + get + { + InitializeProperty("urlMatches", _urlMatches); + return _urlMatches; + } + set + { + _urlMatches = value; + } + } // Property Definition + private string _originAndPathMatches; /// /// 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")] - public string OriginAndPathMatches { get; set; } + public string OriginAndPathMatches + { + get + { + InitializeProperty("originAndPathMatches", _originAndPathMatches); + return _originAndPathMatches; + } + set + { + _originAndPathMatches = value; + } + } // Property Definition + private string _urlPrefix; /// /// 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")] - public string UrlPrefix { get; set; } + public string UrlPrefix + { + get + { + InitializeProperty("urlPrefix", _urlPrefix); + return _urlPrefix; + } + set + { + _urlPrefix = value; + } + } // Property Definition + private string _urlSuffix; /// /// 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")] - public string UrlSuffix { get; set; } + public string UrlSuffix + { + get + { + InitializeProperty("urlSuffix", _urlSuffix); + return _urlSuffix; + } + set + { + _urlSuffix = value; + } + } // Property Definition + private IEnumerable _schemes; /// /// Matches if the scheme of the URL is equal to any of the schemes specified in the array. /// [JsonPropertyName("schemes")] - public IEnumerable Schemes { get; set; } + public IEnumerable Schemes + { + get + { + InitializeProperty("schemes", _schemes); + return _schemes; + } + set + { + _schemes = value; + } + } // Property Definition + private IEnumerable _ports; /// /// 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")] - public IEnumerable Ports { get; set; } + public IEnumerable Ports + { + get + { + InitializeProperty("ports", _ports); + return _ports; + } + set + { + _ports = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Events/generated.txt b/src/WebExtension.Net/Generated/Events/generated.txt index e69de29..4c440f6 100644 --- a/src/WebExtension.Net/Generated/Events/generated.txt +++ b/src/WebExtension.Net/Generated/Events/generated.txt @@ -0,0 +1 @@ +This file is auto generated at 2021-03-26T07:08:48 \ No newline at end of file diff --git a/src/WebExtension.Net/Generated/ExtensionTypes/CSSOrigin.cs b/src/WebExtension.Net/Generated/ExtensionTypes/CSSOrigin.cs index 87e3345..4ac85be 100644 --- a/src/WebExtension.Net/Generated/ExtensionTypes/CSSOrigin.cs +++ b/src/WebExtension.Net/Generated/ExtensionTypes/CSSOrigin.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/ExtensionTypes/Date.cs b/src/WebExtension.Net/Generated/ExtensionTypes/Date.cs index dc8f5d2..6f1308f 100644 --- a/src/WebExtension.Net/Generated/ExtensionTypes/Date.cs +++ b/src/WebExtension.Net/Generated/ExtensionTypes/Date.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/ExtensionTypes/ExtensionFileOrCode.cs b/src/WebExtension.Net/Generated/ExtensionTypes/ExtensionFileOrCode.cs index d78fa36..6affa2a 100644 --- a/src/WebExtension.Net/Generated/ExtensionTypes/ExtensionFileOrCode.cs +++ b/src/WebExtension.Net/Generated/ExtensionTypes/ExtensionFileOrCode.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/ExtensionTypes/ExtensionTypes.json b/src/WebExtension.Net/Generated/ExtensionTypes/ExtensionTypes.json index e2950ba..0c99018 100644 --- a/src/WebExtension.Net/Generated/ExtensionTypes/ExtensionTypes.json +++ b/src/WebExtension.Net/Generated/ExtensionTypes/ExtensionTypes.json @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - [ { "namespace": "extensionTypes", diff --git a/src/WebExtension.Net/Generated/ExtensionTypes/ImageDetails.cs b/src/WebExtension.Net/Generated/ExtensionTypes/ImageDetails.cs index 9c1b8b1..61d90b9 100644 --- a/src/WebExtension.Net/Generated/ExtensionTypes/ImageDetails.cs +++ b/src/WebExtension.Net/Generated/ExtensionTypes/ImageDetails.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,36 +10,84 @@ namespace WebExtension.Net.ExtensionTypes /// /// Details about the format, quality, area and scale of the capture. /// - public class ImageDetails + public class ImageDetails : BaseObject { // Property Definition + private ImageFormat _format; /// /// The format of the resulting image. Default is "jpeg". /// [JsonPropertyName("format")] - public ImageFormat Format { get; set; } + public ImageFormat Format + { + get + { + InitializeProperty("format", _format); + return _format; + } + set + { + _format = value; + } + } // Property Definition + private int? _quality; /// /// 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")] - public int? Quality { get; set; } + public int? Quality + { + get + { + InitializeProperty("quality", _quality); + return _quality; + } + set + { + _quality = value; + } + } // Property Definition + private object _rect; /// /// The area of the document to capture, in CSS pixels, relative to the page. If omitted, capture the visible viewport. /// [JsonPropertyName("rect")] - public object Rect { get; set; } + public object Rect + { + get + { + InitializeProperty("rect", _rect); + return _rect; + } + set + { + _rect = value; + } + } // Property Definition + private double? _scale; /// /// The scale of the resulting image. Defaults to devicePixelRatio. /// [JsonPropertyName("scale")] - public double? Scale { get; set; } + public double? Scale + { + get + { + InitializeProperty("scale", _scale); + return _scale; + } + set + { + _scale = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/ExtensionTypes/ImageFormat.cs b/src/WebExtension.Net/Generated/ExtensionTypes/ImageFormat.cs index e3cce59..823c655 100644 --- a/src/WebExtension.Net/Generated/ExtensionTypes/ImageFormat.cs +++ b/src/WebExtension.Net/Generated/ExtensionTypes/ImageFormat.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/ExtensionTypes/InjectDetails.cs b/src/WebExtension.Net/Generated/ExtensionTypes/InjectDetails.cs index f39aa1f..ffd8866 100644 --- a/src/WebExtension.Net/Generated/ExtensionTypes/InjectDetails.cs +++ b/src/WebExtension.Net/Generated/ExtensionTypes/InjectDetails.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,10 +10,11 @@ namespace WebExtension.Net.ExtensionTypes /// /// 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. /// - public class InjectDetails + public class InjectDetails : BaseObject { // Property Definition + private string _code; /// /// JavaScript or CSS code to inject. /// @@ -23,49 +22,132 @@ public class InjectDetails /// Be careful using the code parameter. Incorrect use of it may open your extension to cross site scripting attacks. /// [JsonPropertyName("code")] - public string Code { get; set; } + public string Code + { + get + { + InitializeProperty("code", _code); + return _code; + } + set + { + _code = value; + } + } // Property Definition + private string _file; /// /// JavaScript or CSS file to inject. /// [JsonPropertyName("file")] - public string File { get; set; } + public string File + { + get + { + InitializeProperty("file", _file); + return _file; + } + set + { + _file = value; + } + } // Property Definition + private bool? _allFrames; /// /// 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")] - public bool? AllFrames { get; set; } + public bool? AllFrames + { + get + { + InitializeProperty("allFrames", _allFrames); + return _allFrames; + } + set + { + _allFrames = value; + } + } // Property Definition + private bool? _matchAboutBlank; /// /// 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")] - public bool? MatchAboutBlank { get; set; } + public bool? MatchAboutBlank + { + get + { + InitializeProperty("matchAboutBlank", _matchAboutBlank); + return _matchAboutBlank; + } + set + { + _matchAboutBlank = value; + } + } // Property Definition + private int? _frameId; /// /// The ID of the frame to inject the script into. This may not be used in combination with allFrames. /// [JsonPropertyName("frameId")] - public int? FrameId { get; set; } + public int? FrameId + { + get + { + InitializeProperty("frameId", _frameId); + return _frameId; + } + set + { + _frameId = value; + } + } // Property Definition + private RunAt _runAt; /// /// The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle". /// [JsonPropertyName("runAt")] - public RunAt RunAt { get; set; } + public RunAt RunAt + { + get + { + InitializeProperty("runAt", _runAt); + return _runAt; + } + set + { + _runAt = value; + } + } // Property Definition + private CSSOrigin _cssOrigin; /// /// The css origin of the stylesheet to inject. Defaults to "author". /// [JsonPropertyName("cssOrigin")] - public CSSOrigin CssOrigin { get; set; } + public CSSOrigin CssOrigin + { + get + { + InitializeProperty("cssOrigin", _cssOrigin); + return _cssOrigin; + } + set + { + _cssOrigin = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/ExtensionTypes/PlainJSONValue.cs b/src/WebExtension.Net/Generated/ExtensionTypes/PlainJSONValue.cs index 56ef5b6..caeaac4 100644 --- a/src/WebExtension.Net/Generated/ExtensionTypes/PlainJSONValue.cs +++ b/src/WebExtension.Net/Generated/ExtensionTypes/PlainJSONValue.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/ExtensionTypes/RunAt.cs b/src/WebExtension.Net/Generated/ExtensionTypes/RunAt.cs index b20d138..e8d438b 100644 --- a/src/WebExtension.Net/Generated/ExtensionTypes/RunAt.cs +++ b/src/WebExtension.Net/Generated/ExtensionTypes/RunAt.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/ExtensionTypes/generated.txt b/src/WebExtension.Net/Generated/ExtensionTypes/generated.txt index e69de29..4c440f6 100644 --- a/src/WebExtension.Net/Generated/ExtensionTypes/generated.txt +++ b/src/WebExtension.Net/Generated/ExtensionTypes/generated.txt @@ -0,0 +1 @@ +This file is auto generated at 2021-03-26T07:08:48 \ No newline at end of file diff --git a/src/WebExtension.Net/Generated/IWebExtensionAPI.cs b/src/WebExtension.Net/Generated/IWebExtensionAPI.cs index 649e819..0628000 100644 --- a/src/WebExtension.Net/Generated/IWebExtensionAPI.cs +++ b/src/WebExtension.Net/Generated/IWebExtensionAPI.cs @@ -1,11 +1,10 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using WebExtension.Net.Windows; using WebExtension.Net.ContentScripts; using WebExtension.Net.Tabs; -using WebExtension.Net.Notifications; using WebExtension.Net.Runtime; using WebExtension.Net.WebNavigation; +using WebExtension.Net.Storage; +using WebExtension.Net.Notifications; using WebExtension.Net.WebRequest; namespace WebExtension.Net @@ -26,11 +25,6 @@ public interface IWebExtensionAPI /// ITabsAPI Tabs { get; } /// - /// - /// Requires manifest permission notifications. - /// - INotificationsAPI Notifications { get; } - /// /// Use the browser.runtime API to retrieve the background page, return details about the manifest, and listen for and respond to events in the app or extension lifecycle. You can also use this API to convert the relative path of URLs to fully-qualified URLs. /// IRuntimeAPI Runtime { get; } @@ -40,6 +34,16 @@ public interface IWebExtensionAPI /// IWebNavigationAPI WebNavigation { get; } /// + /// Use the browser.storage API to store, retrieve, and track changes to user data. + /// Requires manifest permission storage. + /// + IStorageAPI Storage { get; } + /// + /// + /// Requires manifest permission notifications. + /// + INotificationsAPI Notifications { get; } + /// /// Use the browser.webRequest API to observe and analyze traffic and to intercept, block, or modify requests in-flight. /// Requires manifest permission webRequest. /// diff --git a/src/WebExtension.Net/Generated/Manifest/ContentScript.cs b/src/WebExtension.Net/Generated/Manifest/ContentScript.cs index d1b6009..5d1f219 100644 --- a/src/WebExtension.Net/Generated/Manifest/ContentScript.cs +++ b/src/WebExtension.Net/Generated/Manifest/ContentScript.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,71 +10,179 @@ namespace WebExtension.Net.Manifest /// /// 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. Based on InjectDetails, but using underscore rather than camel case naming conventions. /// - public class ContentScript + public class ContentScript : BaseObject { // Property Definition + private IEnumerable _matches; /// /// /// [JsonPropertyName("matches")] - public IEnumerable Matches { get; set; } + public IEnumerable Matches + { + get + { + InitializeProperty("matches", _matches); + return _matches; + } + set + { + _matches = value; + } + } // Property Definition + private IEnumerable _exclude_matches; /// /// /// [JsonPropertyName("exclude_matches")] - public IEnumerable Exclude_matches { get; set; } + public IEnumerable Exclude_matches + { + get + { + InitializeProperty("exclude_matches", _exclude_matches); + return _exclude_matches; + } + set + { + _exclude_matches = value; + } + } // Property Definition + private IEnumerable _include_globs; /// /// /// [JsonPropertyName("include_globs")] - public IEnumerable Include_globs { get; set; } + public IEnumerable Include_globs + { + get + { + InitializeProperty("include_globs", _include_globs); + return _include_globs; + } + set + { + _include_globs = value; + } + } // Property Definition + private IEnumerable _exclude_globs; /// /// /// [JsonPropertyName("exclude_globs")] - public IEnumerable Exclude_globs { get; set; } + public IEnumerable Exclude_globs + { + get + { + InitializeProperty("exclude_globs", _exclude_globs); + return _exclude_globs; + } + set + { + _exclude_globs = value; + } + } // Property Definition + private IEnumerable _css; /// /// The list of CSS files to inject /// [JsonPropertyName("css")] - public IEnumerable Css { get; set; } + public IEnumerable Css + { + get + { + InitializeProperty("css", _css); + return _css; + } + set + { + _css = value; + } + } // Property Definition + private IEnumerable _js; /// /// The list of JS files to inject /// [JsonPropertyName("js")] - public IEnumerable Js { get; set; } + public IEnumerable Js + { + get + { + InitializeProperty("js", _js); + return _js; + } + set + { + _js = value; + } + } // Property Definition + private bool? _all_frames; /// /// 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("all_frames")] - public bool? All_frames { get; set; } + public bool? All_frames + { + get + { + InitializeProperty("all_frames", _all_frames); + return _all_frames; + } + set + { + _all_frames = value; + } + } // Property Definition + private bool? _match_about_blank; /// /// 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("match_about_blank")] - public bool? Match_about_blank { get; set; } + public bool? Match_about_blank + { + get + { + InitializeProperty("match_about_blank", _match_about_blank); + return _match_about_blank; + } + set + { + _match_about_blank = value; + } + } // Property Definition + private ExtensionTypes.RunAt _run_at; /// /// The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle". /// [JsonPropertyName("run_at")] - public ExtensionTypes.RunAt Run_at { get; set; } + public ExtensionTypes.RunAt Run_at + { + get + { + InitializeProperty("run_at", _run_at); + return _run_at; + } + set + { + _run_at = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Manifest/ExtensionFileUrl.cs b/src/WebExtension.Net/Generated/Manifest/ExtensionFileUrl.cs index 8b6b46f..0429088 100644 --- a/src/WebExtension.Net/Generated/Manifest/ExtensionFileUrl.cs +++ b/src/WebExtension.Net/Generated/Manifest/ExtensionFileUrl.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/ExtensionID.cs b/src/WebExtension.Net/Generated/Manifest/ExtensionID.cs index ed9461d..3764ef6 100644 --- a/src/WebExtension.Net/Generated/Manifest/ExtensionID.cs +++ b/src/WebExtension.Net/Generated/Manifest/ExtensionID.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/ExtensionURL.cs b/src/WebExtension.Net/Generated/Manifest/ExtensionURL.cs index 62102df..72a93cf 100644 --- a/src/WebExtension.Net/Generated/Manifest/ExtensionURL.cs +++ b/src/WebExtension.Net/Generated/Manifest/ExtensionURL.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/FirefoxSpecificProperties.cs b/src/WebExtension.Net/Generated/Manifest/FirefoxSpecificProperties.cs index cd72ab0..19fb18d 100644 --- a/src/WebExtension.Net/Generated/Manifest/FirefoxSpecificProperties.cs +++ b/src/WebExtension.Net/Generated/Manifest/FirefoxSpecificProperties.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,36 +10,84 @@ namespace WebExtension.Net.Manifest /// /// /// - public class FirefoxSpecificProperties + public class FirefoxSpecificProperties : BaseObject { // Property Definition + private ExtensionID _id; /// /// /// [JsonPropertyName("id")] - public ExtensionID Id { get; set; } + public ExtensionID Id + { + get + { + InitializeProperty("id", _id); + return _id; + } + set + { + _id = value; + } + } // Property Definition + private string _update_url; /// /// /// [JsonPropertyName("update_url")] - public string Update_url { get; set; } + public string Update_url + { + get + { + InitializeProperty("update_url", _update_url); + return _update_url; + } + set + { + _update_url = value; + } + } // Property Definition + private string _strict_min_version; /// /// /// [JsonPropertyName("strict_min_version")] - public string Strict_min_version { get; set; } + public string Strict_min_version + { + get + { + InitializeProperty("strict_min_version", _strict_min_version); + return _strict_min_version; + } + set + { + _strict_min_version = value; + } + } // Property Definition + private string _strict_max_version; /// /// /// [JsonPropertyName("strict_max_version")] - public string Strict_max_version { get; set; } + public string Strict_max_version + { + get + { + InitializeProperty("strict_max_version", _strict_max_version); + return _strict_max_version; + } + set + { + _strict_max_version = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Manifest/HttpURL.cs b/src/WebExtension.Net/Generated/Manifest/HttpURL.cs index 7d11b9a..61fb27c 100644 --- a/src/WebExtension.Net/Generated/Manifest/HttpURL.cs +++ b/src/WebExtension.Net/Generated/Manifest/HttpURL.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/IconImageData.cs b/src/WebExtension.Net/Generated/Manifest/IconImageData.cs index 0bbfe59..0820c9f 100644 --- a/src/WebExtension.Net/Generated/Manifest/IconImageData.cs +++ b/src/WebExtension.Net/Generated/Manifest/IconImageData.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/IconPath.cs b/src/WebExtension.Net/Generated/Manifest/IconPath.cs index 11fa6f5..15b3702 100644 --- a/src/WebExtension.Net/Generated/Manifest/IconPath.cs +++ b/src/WebExtension.Net/Generated/Manifest/IconPath.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/ImageData.cs b/src/WebExtension.Net/Generated/Manifest/ImageData.cs index 7f1e9bc..5fe091d 100644 --- a/src/WebExtension.Net/Generated/Manifest/ImageData.cs +++ b/src/WebExtension.Net/Generated/Manifest/ImageData.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,7 +10,7 @@ namespace WebExtension.Net.Manifest /// /// /// - public class ImageData + public class ImageData : BaseObject { } } diff --git a/src/WebExtension.Net/Generated/Manifest/ImageDataOrExtensionURL.cs b/src/WebExtension.Net/Generated/Manifest/ImageDataOrExtensionURL.cs index 676f120..b9c3f1f 100644 --- a/src/WebExtension.Net/Generated/Manifest/ImageDataOrExtensionURL.cs +++ b/src/WebExtension.Net/Generated/Manifest/ImageDataOrExtensionURL.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/KeyName.cs b/src/WebExtension.Net/Generated/Manifest/KeyName.cs index 826a1c6..415eafb 100644 --- a/src/WebExtension.Net/Generated/Manifest/KeyName.cs +++ b/src/WebExtension.Net/Generated/Manifest/KeyName.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/Manifest.json b/src/WebExtension.Net/Generated/Manifest/Manifest.json index f3f8fa8..fc47857 100644 --- a/src/WebExtension.Net/Generated/Manifest/Manifest.json +++ b/src/WebExtension.Net/Generated/Manifest/Manifest.json @@ -1,6 +1,36 @@ -// This file is auto generated at 2021-03-24T04:51:22 - [ + { + "namespace": "manifest", + "types": [ + { + "$extend": "PermissionNoPrompt", + "choices": [ + { + "type": "string", + "enum": [ + "activityLog" + ] + } + ] + } + ] + }, + { + "namespace": "manifest", + "types": [ + { + "$extend": "OptionalPermissionNoPrompt", + "choices": [ + { + "type": "string", + "enum": [ + "search" + ] + } + ] + } + ] + }, { "namespace": "manifest", "types": [ @@ -10,7 +40,7 @@ { "type": "string", "enum": [ - "management" + "find" ] } ] @@ -19,263 +49,369 @@ }, { "namespace": "manifest", - "permissions": [], "types": [ { - "id": "ManifestBase", + "$extend": "OptionalPermission", + "choices": [ + { + "type": "string", + "enum": [ + "browserSettings" + ] + } + ] + } + ] + }, + { + "namespace": "manifest", + "types": [ + { + "$extend": "Permission", + "choices": [ + { + "type": "string", + "pattern": "^experiments(\\.\\w\u002B)\u002B$" + } + ] + }, + { + "$extend": "WebExtensionManifest", + "properties": { + "experiment_apis": { + "type": "object", + "additionalProperties": { + "$ref": "experiments.ExperimentAPI" + }, + "optional": true + } + } + } + ] + }, + { + "namespace": "manifest", + "types": [ + { + "$extend": "PermissionNoPrompt", + "choices": [ + { + "type": "string", + "enum": [ + "theme" + ] + } + ] + }, + { + "id": "ThemeColor", + "choices": [ + { + "type": "string" + }, + { + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": { + "type": "integer", + "minimum": 0, + "maximum": 255 + } + }, + { + "type": "array", + "minItems": 4, + "maxItems": 4, + "items": { + "type": "number" + } + } + ] + }, + { + "id": "ThemeExperiment", "type": "object", - "description": "Common properties for all manifest.json files", "properties": { - "manifest_version": { - "type": "integer", - "minimum": 2, - "maximum": 3, - "postprocess": "manifestVersionCheck" + "stylesheet": { + "optional": true, + "$ref": "ExtensionURL" }, - "applications": { + "images": { "type": "object", "optional": true, - "properties": { - "gecko": { - "$ref": "FirefoxSpecificProperties", - "optional": true - } + "additionalProperties": { + "type": "string" } }, - "browser_specific_settings": { + "colors": { "type": "object", "optional": true, - "properties": { - "gecko": { - "$ref": "FirefoxSpecificProperties", - "optional": true - }, - "edge": { - "type": "object", - "additionalProperties": { - "type": "any" - }, - "optional": true - } - }, "additionalProperties": { - "$ref": "UnrecognizedProperty" + "type": "string" } }, - "name": { - "type": "string", - "optional": false, - "preprocess": "localize" - }, - "short_name": { - "type": "string", - "optional": true, - "preprocess": "localize" - }, - "description": { - "type": "string", - "optional": true, - "preprocess": "localize" - }, - "author": { - "type": "string", - "optional": true, - "preprocess": "localize", - "onError": "warn" - }, - "version": { - "type": "string", - "optional": false - }, - "homepage_url": { - "type": "string", - "format": "url", + "properties": { + "type": "object", "optional": true, - "preprocess": "localize" + "additionalProperties": { + "type": "string" + } } } }, { - "id": "WebExtensionManifest", + "id": "ThemeType", "type": "object", - "description": "Represents a WebExtension manifest.json file", - "$import": "ManifestBase", "properties": { - "minimum_chrome_version": { - "type": "string", - "optional": true - }, - "minimum_opera_version": { - "type": "string", - "optional": true - }, - "icons": { + "images": { "type": "object", "optional": true, - "patternProperties": { - "^[1-9]\\d*$": { - "$ref": "ExtensionFileUrl" + "properties": { + "additional_backgrounds": { + "type": "array", + "items": { + "$ref": "ImageDataOrExtensionURL" + }, + "maxItems": 15, + "optional": true + }, + "headerURL": { + "$ref": "ImageDataOrExtensionURL", + "optional": true, + "deprecated": "Unsupported images property, use \u0027theme.images.theme_frame\u0027, this alias is ignored in Firefox \u003E= 70." + }, + "theme_frame": { + "$ref": "ImageDataOrExtensionURL", + "optional": true } + }, + "additionalProperties": { + "$ref": "ImageDataOrExtensionURL" } }, - "incognito": { - "type": "string", - "enum": [ - "not_allowed", - "spanning" - ], - "default": "spanning", - "optional": true - }, - "background": { - "choices": [ - { - "type": "object", - "properties": { - "page": { - "$ref": "ExtensionURL" - }, - "persistent": { - "optional": true, - "$ref": "PersistentBackgroundProperty" - } - }, - "additionalProperties": { - "$ref": "UnrecognizedProperty" - } + "colors": { + "type": "object", + "optional": true, + "properties": { + "tab_selected": { + "$ref": "ThemeColor", + "optional": true }, - { - "type": "object", - "properties": { - "scripts": { - "type": "array", - "items": { - "$ref": "ExtensionURL" - } - }, - "persistent": { - "optional": true, - "$ref": "PersistentBackgroundProperty" - } - }, - "additionalProperties": { - "$ref": "UnrecognizedProperty" - } + "accentcolor": { + "$ref": "ThemeColor", + "optional": true, + "deprecated": "Unsupported colors property, use \u0027theme.colors.frame\u0027, this alias is ignored in Firefox \u003E= 70." }, - { - "type": "object", - "properties": { - "service_worker": { - "$ref": "ExtensionURL" - } - }, - "postprocess": "requireBackgroundServiceWorkerEnabled" - } - ], - "optional": true - }, - "options_ui": { - "type": "object", - "optional": true, - "properties": { - "page": { - "$ref": "ExtensionURL" + "frame": { + "$ref": "ThemeColor", + "optional": true }, - "browser_style": { - "type": "boolean", + "frame_inactive": { + "$ref": "ThemeColor", + "optional": true + }, + "textcolor": { + "$ref": "ThemeColor", "optional": true, - "default": true + "deprecated": "Unsupported color property, use \u0027theme.colors.tab_background_text\u0027, this alias is ignored in Firefox \u003E= 70." }, - "chrome_style": { - "type": "boolean", + "tab_background_text": { + "$ref": "ThemeColor", "optional": true }, - "open_in_tab": { - "type": "boolean", + "tab_background_separator": { + "$ref": "ThemeColor", + "optional": true + }, + "tab_loading": { + "$ref": "ThemeColor", + "optional": true + }, + "tab_text": { + "$ref": "ThemeColor", + "optional": true + }, + "tab_line": { + "$ref": "ThemeColor", + "optional": true + }, + "toolbar": { + "$ref": "ThemeColor", + "optional": true + }, + "toolbar_text": { + "$ref": "ThemeColor", + "optional": true, + "description": "This color property is an alias of \u0027bookmark_text\u0027." + }, + "bookmark_text": { + "$ref": "ThemeColor", + "optional": true + }, + "toolbar_field": { + "$ref": "ThemeColor", + "optional": true + }, + "toolbar_field_text": { + "$ref": "ThemeColor", + "optional": true + }, + "toolbar_field_border": { + "$ref": "ThemeColor", + "optional": true + }, + "toolbar_field_separator": { + "$ref": "ThemeColor", + "optional": true + }, + "toolbar_top_separator": { + "$ref": "ThemeColor", + "optional": true + }, + "toolbar_bottom_separator": { + "$ref": "ThemeColor", + "optional": true + }, + "toolbar_vertical_separator": { + "$ref": "ThemeColor", + "optional": true + }, + "icons": { + "$ref": "ThemeColor", + "optional": true + }, + "icons_attention": { + "$ref": "ThemeColor", + "optional": true + }, + "button_background_hover": { + "$ref": "ThemeColor", + "optional": true + }, + "button_background_active": { + "$ref": "ThemeColor", + "optional": true + }, + "popup": { + "$ref": "ThemeColor", + "optional": true + }, + "popup_text": { + "$ref": "ThemeColor", + "optional": true + }, + "popup_border": { + "$ref": "ThemeColor", + "optional": true + }, + "toolbar_field_focus": { + "$ref": "ThemeColor", + "optional": true + }, + "toolbar_field_text_focus": { + "$ref": "ThemeColor", + "optional": true + }, + "toolbar_field_border_focus": { + "$ref": "ThemeColor", + "optional": true + }, + "popup_highlight": { + "$ref": "ThemeColor", + "optional": true + }, + "popup_highlight_text": { + "$ref": "ThemeColor", + "optional": true + }, + "ntp_background": { + "$ref": "ThemeColor", + "optional": true + }, + "ntp_text": { + "$ref": "ThemeColor", + "optional": true + }, + "sidebar": { + "$ref": "ThemeColor", + "optional": true + }, + "sidebar_border": { + "$ref": "ThemeColor", + "optional": true + }, + "sidebar_text": { + "$ref": "ThemeColor", + "optional": true + }, + "sidebar_highlight": { + "$ref": "ThemeColor", + "optional": true + }, + "sidebar_highlight_text": { + "$ref": "ThemeColor", + "optional": true + }, + "toolbar_field_highlight": { + "$ref": "ThemeColor", + "optional": true + }, + "toolbar_field_highlight_text": { + "$ref": "ThemeColor", "optional": true } }, "additionalProperties": { - "type": "any", - "deprecated": "An unexpected property was found in the WebExtension manifest" - } - }, - "content_scripts": { - "type": "array", - "optional": true, - "items": { - "$ref": "ContentScript" + "$ref": "ThemeColor" } }, - "content_security_policy": { - "optional": true, - "onError": "warn", - "choices": [ - { - "type": "string", - "format": "contentSecurityPolicy" - }, - { - "type": "object", - "additionalProperties": { - "$ref": "UnrecognizedProperty" - }, - "properties": { - "extension_pages": { - "type": "string", - "optional": true, - "format": "contentSecurityPolicy", - "description": "The Content Security Policy used for extension pages." - } - } - } - ] - }, - "permissions": { - "type": "array", - "default": [], - "items": { - "$ref": "PermissionOrOrigin", - "onError": "warn" - }, - "optional": true - }, - "optional_permissions": { - "type": "array", - "items": { - "$ref": "OptionalPermissionOrOrigin", - "onError": "warn" - }, - "optional": true, - "default": [] - }, - "web_accessible_resources": { - "type": "array", - "items": { - "type": "string" - }, - "optional": true - }, - "developer": { + "properties": { "type": "object", "optional": true, "properties": { - "name": { - "type": "string", - "optional": true, - "preprocess": "localize" + "additional_backgrounds_alignment": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "bottom", + "center", + "left", + "right", + "top", + "center bottom", + "center center", + "center top", + "left bottom", + "left center", + "left top", + "right bottom", + "right center", + "right top" + ] + }, + "maxItems": 15, + "optional": true }, - "url": { - "type": "string", - "optional": true, - "preprocess": "localize" + "additional_backgrounds_tiling": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "no-repeat", + "repeat", + "repeat-x", + "repeat-y" + ] + }, + "maxItems": 15, + "optional": true } + }, + "additionalProperties": { + "type": "string" } - }, - "hidden": { - "type": "boolean", - "optional": true, - "default": false } }, "additionalProperties": { @@ -283,433 +419,369 @@ } }, { - "id": "WebExtensionLangpackManifest", + "id": "ThemeManifest", "type": "object", - "description": "Represents a WebExtension language pack manifest.json file", - "$import": "ManifestBase", + "description": "Contents of manifest.json for a static theme", + "$import": "manifest.ManifestBase", "properties": { - "homepage_url": { - "type": "string", - "format": "url", - "optional": true, - "preprocess": "localize" + "theme": { + "$ref": "ThemeType" }, - "langpack_id": { + "dark_theme": { + "$ref": "ThemeType", + "optional": true + }, + "default_locale": { "type": "string", - "pattern": "^[a-zA-Z][a-zA-Z-]\u002B$" + "optional": true }, - "languages": { - "type": "object", - "patternProperties": { - "^[a-z]{2}[a-zA-Z-]*$": { - "type": "object", - "properties": { - "chrome_resources": { - "type": "object", - "patternProperties": { - "^[a-zA-Z-.]\u002B$": { - "choices": [ - { - "$ref": "ExtensionURL" - }, - { - "type": "object", - "patternProperties": { - "^[a-z]\u002B$": { - "$ref": "ExtensionURL" - } - } - } - ] - } - } - }, - "version": { - "type": "string" - } - } - } - } + "theme_experiment": { + "$ref": "ThemeExperiment", + "optional": true }, - "sources": { + "icons": { "type": "object", "optional": true, "patternProperties": { - "^[a-z]\u002B$": { - "type": "object", - "properties": { - "base_path": { - "$ref": "ExtensionURL" - }, - "paths": { - "type": "array", - "items": { - "type": "string", - "format": "strictRelativeUrl" - }, - "optional": true - } - } - } - } - } - } - }, - { - "id": "WebExtensionDictionaryManifest", - "type": "object", - "description": "Represents a WebExtension dictionary manifest.json file", - "$import": "ManifestBase", - "properties": { - "homepage_url": { - "type": "string", - "format": "url", - "optional": true, - "preprocess": "localize" - }, - "dictionaries": { - "type": "object", - "patternProperties": { - "^[a-z]{2}[a-zA-Z-]*$": { - "type": "string", - "format": "strictRelativeUrl", - "pattern": "\\.dic$" + "^[1-9]\\d*$": { + "type": "string" } } } } }, { - "id": "ThemeIcons", - "type": "object", + "$extend": "WebExtensionManifest", "properties": { - "light": { - "$ref": "ExtensionURL", - "description": "A light icon to use for dark themes" - }, - "dark": { - "$ref": "ExtensionURL", - "description": "The dark icon to use for light themes" - }, - "size": { - "type": "integer", - "description": "The size of the icons" + "theme_experiment": { + "$ref": "ThemeExperiment", + "optional": true } - }, - "additionalProperties": { - "$ref": "UnrecognizedProperty" } - }, + } + ] + }, + { + "namespace": "manifest", + "types": [ { - "id": "OptionalPermissionNoPrompt", + "$extend": "OptionalPermission", "choices": [ { "type": "string", "enum": [ - "idle" + "bookmarks" ] } ] - }, + } + ] + }, + { + "namespace": "manifest", + "types": [ { - "id": "OptionalPermission", + "$extend": "OptionalPermission", "choices": [ - { - "$ref": "OptionalPermissionNoPrompt" - }, { "type": "string", "enum": [ - "clipboardRead", - "clipboardWrite", - "geolocation", - "notifications" + "privacy" ] } ] - }, + } + ] + }, + { + "namespace": "manifest", + "types": [ { - "id": "OptionalPermissionOrOrigin", - "choices": [ - { - "$ref": "OptionalPermission" - }, - { - "$ref": "MatchPattern" + "$extend": "WebExtensionManifest", + "properties": { + "sidebar_action": { + "type": "object", + "additionalProperties": { + "$ref": "UnrecognizedProperty" + }, + "properties": { + "default_title": { + "type": "string", + "optional": true, + "preprocess": "localize" + }, + "default_icon": { + "$ref": "IconPath", + "optional": true + }, + "browser_style": { + "type": "boolean", + "optional": true, + "default": true + }, + "default_panel": { + "type": "string", + "format": "strictRelativeUrl", + "preprocess": "localize" + }, + "open_at_install": { + "type": "boolean", + "optional": true, + "default": true, + "description": "Whether or not the sidebar is opened at install. Default is \u003Ccode\u003Etrue\u003C/code\u003E." + } + }, + "optional": true } - ] - }, - { - "id": "PermissionNoPrompt", - "choices": [ - { - "$ref": "OptionalPermission" - }, + } + } + ] + }, + { + "namespace": "manifest", + "types": [ + { + "$extend": "WebExtensionManifest", + "properties": { + "chrome_settings_overrides": { + "type": "object", + "optional": true, + "additionalProperties": { + "$ref": "UnrecognizedProperty" + }, + "properties": { + "homepage": { + "type": "string", + "format": "homepageUrl", + "optional": true, + "preprocess": "localize" + }, + "search_provider": { + "type": "object", + "optional": true, + "additionalProperties": { + "$ref": "UnrecognizedProperty" + }, + "properties": { + "name": { + "type": "string", + "preprocess": "localize" + }, + "keyword": { + "optional": true, + "choices": [ + { + "type": "string", + "preprocess": "localize" + }, + { + "type": "array", + "items": { + "type": "string", + "preprocess": "localize" + }, + "minItems": 1 + } + ] + }, + "search_url": { + "type": "string", + "format": "url", + "pattern": "^(https://|http://(localhost|127\\.0\\.0\\.1|\\[::1\\])(:\\d*)?(/|$)).*$", + "preprocess": "localize" + }, + "favicon_url": { + "type": "string", + "optional": true, + "format": "relativeUrl", + "preprocess": "localize" + }, + "suggest_url": { + "type": "string", + "optional": true, + "pattern": "^$|^(https://|http://(localhost|127\\.0\\.0\\.1|\\[::1\\])(:\\d*)?(/|$)).*$", + "preprocess": "localize" + }, + "instant_url": { + "type": "string", + "optional": true, + "format": "url", + "preprocess": "localize", + "deprecated": "Unsupported on Firefox at this time." + }, + "image_url": { + "type": "string", + "optional": true, + "format": "url", + "preprocess": "localize", + "deprecated": "Unsupported on Firefox at this time." + }, + "search_url_get_params": { + "type": "string", + "optional": true, + "preprocess": "localize", + "description": "GET parameters to the search_url as a query string." + }, + "search_url_post_params": { + "type": "string", + "optional": true, + "preprocess": "localize", + "description": "POST parameters to the search_url as a query string." + }, + "suggest_url_get_params": { + "type": "string", + "optional": true, + "preprocess": "localize", + "description": "GET parameters to the suggest_url as a query string." + }, + "suggest_url_post_params": { + "type": "string", + "optional": true, + "preprocess": "localize", + "description": "POST parameters to the suggest_url as a query string." + }, + "instant_url_post_params": { + "type": "string", + "optional": true, + "preprocess": "localize", + "deprecated": "Unsupported on Firefox at this time." + }, + "image_url_post_params": { + "type": "string", + "optional": true, + "preprocess": "localize", + "deprecated": "Unsupported on Firefox at this time." + }, + "search_form": { + "type": "string", + "optional": true, + "format": "url", + "pattern": "^(https://|http://(localhost|127\\.0\\.0\\.1|\\[::1\\])(:\\d*)?(/|$)).*$", + "preprocess": "localize" + }, + "alternate_urls": { + "type": "array", + "items": { + "type": "string", + "format": "url", + "preprocess": "localize" + }, + "optional": true, + "deprecated": "Unsupported on Firefox at this time." + }, + "prepopulated_id": { + "type": "integer", + "optional": true, + "deprecated": "Unsupported on Firefox." + }, + "encoding": { + "type": "string", + "optional": true, + "description": "Encoding of the search term." + }, + "is_default": { + "type": "boolean", + "optional": true, + "description": "Sets the default engine to a built-in engine only." + }, + "params": { + "optional": true, + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "A url parameter name" + }, + "condition": { + "type": "string", + "optional": true, + "enum": [ + "purpose", + "pref" + ], + "description": "The type of param can be either \u0022purpose\u0022 or \u0022pref\u0022." + }, + "pref": { + "type": "string", + "optional": true, + "description": "The preference to retrieve the value from.", + "preprocess": "localize" + }, + "purpose": { + "type": "string", + "optional": true, + "enum": [ + "contextmenu", + "searchbar", + "homepage", + "keyword", + "newtab" + ], + "description": "The context that initiates a search, required if condition is \u0022purpose\u0022." + }, + "value": { + "type": "string", + "optional": true, + "description": "A url parameter value.", + "preprocess": "localize" + } + } + }, + "description": "A list of optional search url parameters. This allows the additon of search url parameters based on how the search is performed in Firefox." + } + } + } + } + } + } + } + ] + }, + { + "namespace": "manifest", + "types": [ + { + "$extend": "OptionalPermission", + "choices": [ { "type": "string", "enum": [ - "alarms", - "mozillaAddons", - "storage", - "unlimitedStorage" + "management" ] } ] - }, + } + ] + }, + { + "namespace": "manifest", + "types": [ { - "id": "Permission", + "$extend": "PermissionNoPrompt", "choices": [ { - "$ref": "PermissionNoPrompt" - }, - { - "$ref": "OptionalPermission" + "type": "string", + "enum": [ + "contextualIdentities" + ] } ] - }, + } + ] + }, + { + "namespace": "manifest", + "types": [ { - "id": "PermissionOrOrigin", + "$extend": "OptionalPermission", "choices": [ { - "$ref": "Permission" - }, - { - "$ref": "MatchPattern" - } - ] - }, - { - "id": "HttpURL", - "type": "string", - "format": "url", - "pattern": "^https?://.*$" - }, - { - "id": "ExtensionURL", - "type": "string", - "format": "strictRelativeUrl" - }, - { - "id": "ExtensionFileUrl", - "type": "string", - "format": "strictRelativeUrl", - "pattern": "\\S", - "preprocess": "localize" - }, - { - "id": "ImageDataOrExtensionURL", - "type": "string", - "format": "imageDataOrStrictRelativeUrl" - }, - { - "id": "ExtensionID", - "choices": [ - { - "type": "string", - "pattern": "(?i)^\\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\}$" - }, - { - "type": "string", - "pattern": "(?i)^[a-z0-9-._]*@[a-z0-9-._]\u002B$" - } - ] - }, - { - "id": "FirefoxSpecificProperties", - "type": "object", - "properties": { - "id": { - "$ref": "ExtensionID", - "optional": true - }, - "update_url": { - "type": "string", - "format": "url", - "optional": true - }, - "strict_min_version": { - "type": "string", - "optional": true - }, - "strict_max_version": { - "type": "string", - "optional": true - } - } - }, - { - "id": "MatchPattern", - "choices": [ - { - "type": "string", - "enum": [ - "\u003Call_urls\u003E" - ] - }, - { - "$ref": "MatchPatternRestricted" - }, - { - "$ref": "MatchPatternUnestricted" - } - ] - }, - { - "id": "MatchPatternRestricted", - "description": "Same as MatchPattern above, but excludes \u003Call_urls\u003E", - "choices": [ - { - "type": "string", - "pattern": "^(https?|wss?|file|ftp|\\*)://(\\*|\\*\\.[^*/]\u002B|[^*/]\u002B)/.*$" - }, - { - "type": "string", - "pattern": "^file:///.*$" - } - ] - }, - { - "id": "MatchPatternUnestricted", - "description": "Mostly unrestricted match patterns for privileged add-ons. This should technically be rejected for unprivileged add-ons, but, reasons. The MatchPattern class will still refuse privileged schemes for those extensions.", - "choices": [ - { - "type": "string", - "pattern": "^resource://(\\*|\\*\\.[^*/]\u002B|[^*/]\u002B)/.*$|^about:" - } - ] - }, - { - "id": "ContentScript", - "type": "object", - "description": "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. Based on InjectDetails, but using underscore rather than camel case naming conventions.", - "additionalProperties": { - "$ref": "UnrecognizedProperty" - }, - "properties": { - "matches": { - "type": "array", - "optional": false, - "minItems": 1, - "items": { - "$ref": "MatchPattern" - } - }, - "exclude_matches": { - "type": "array", - "optional": true, - "minItems": 1, - "items": { - "$ref": "MatchPattern" - } - }, - "include_globs": { - "type": "array", - "optional": true, - "items": { - "type": "string" - } - }, - "exclude_globs": { - "type": "array", - "optional": true, - "items": { - "type": "string" - } - }, - "css": { - "type": "array", - "optional": true, - "description": "The list of CSS files to inject", - "items": { - "$ref": "ExtensionURL" - } - }, - "js": { - "type": "array", - "optional": true, - "description": "The list of JS files to inject", - "items": { - "$ref": "ExtensionURL" - } - }, - "all_frames": { - "type": "boolean", - "optional": true, - "description": "If allFrames is \u003Ccode\u003Etrue\u003C/code\u003E, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it\u0027s \u003Ccode\u003Efalse\u003C/code\u003E and is only injected into the top frame." - }, - "match_about_blank": { - "type": "boolean", - "optional": true, - "description": "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 \u003Ccode\u003Efalse\u003C/code\u003E." - }, - "run_at": { - "$ref": "extensionTypes.RunAt", - "optional": true, - "default": "document_idle", - "description": "The soonest that the JavaScript or CSS will be injected into the tab. Defaults to \u0022document_idle\u0022." - } - } - }, - { - "id": "IconPath", - "choices": [ - { - "type": "object", - "patternProperties": { - "^[1-9]\\d*$": { - "$ref": "ExtensionFileUrl" - } - }, - "additionalProperties": false - }, - { - "$ref": "ExtensionFileUrl" - } - ] - }, - { - "id": "IconImageData", - "choices": [ - { - "type": "object", - "patternProperties": { - "^[1-9]\\d*$": { - "$ref": "ImageData" - } - }, - "additionalProperties": false - }, - { - "$ref": "ImageData" - } - ] - }, - { - "id": "ImageData", - "type": "object", - "isInstanceOf": "ImageData", - "postprocess": "convertImageDataToURL" - }, - { - "id": "UnrecognizedProperty", - "type": "any", - "deprecated": "An unexpected property was found in the WebExtension manifest." - }, - { - "id": "PersistentBackgroundProperty", - "choices": [ - { - "type": "boolean", - "enum": [ - true - ] - }, - { - "type": "boolean", - "enum": [ - false - ], - "deprecated": "Event pages are not currently supported. This will run as a persistent background page." + "type": "string", + "enum": [ + "browsingData" + ] } ] } @@ -719,466 +791,130 @@ "namespace": "manifest", "types": [ { - "$extend": "OptionalPermissionNoPrompt", + "$extend": "PermissionNoPrompt", "choices": [ { "type": "string", "enum": [ - "search" + "menus", + "contextMenus" ] } ] - } - ] - }, - { - "namespace": "manifest", - "types": [ + }, { - "id": "NativeManifest", - "description": "Represents a native manifest file", + "$extend": "OptionalPermissionNoPrompt", "choices": [ { - "type": "object", - "properties": { - "name": { - "type": "string", - "pattern": "^\\w\u002B(\\.\\w\u002B)*$" - }, - "description": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "pkcs11", - "stdio" - ] - }, - "allowed_extensions": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "manifest.ExtensionID" - } - } - } - }, - { - "type": "object", - "properties": { - "name": { - "$ref": "manifest.ExtensionID" - }, - "description": { - "type": "string" - }, - "data": { - "type": "object", - "additionalProperties": { - "type": "any" - } - }, - "type": { - "type": "string", - "enum": [ - "storage" - ] - } - } - } - ] - } - ] - }, - { - "namespace": "manifest", - "types": [ - { - "$extend": "OptionalPermission", - "choices": [ - { - "type": "string", - "enum": [ - "find" - ] - } - ] - } - ] - }, - { - "namespace": "manifest", - "types": [ - { - "$extend": "PermissionNoPrompt", - "choices": [ - { - "type": "string", - "enum": [ - "theme" - ] - } - ] - }, - { - "id": "ThemeColor", - "choices": [ - { - "type": "string" - }, - { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": { - "type": "integer", - "minimum": 0, - "maximum": 255 - } - }, - { - "type": "array", - "minItems": 4, - "maxItems": 4, - "items": { - "type": "number" - } - } - ] - }, - { - "id": "ThemeExperiment", - "type": "object", - "properties": { - "stylesheet": { - "optional": true, - "$ref": "ExtensionURL" - }, - "images": { - "type": "object", - "optional": true, - "additionalProperties": { - "type": "string" - } - }, - "colors": { - "type": "object", - "optional": true, - "additionalProperties": { - "type": "string" - } - }, - "properties": { - "type": "object", - "optional": true, - "additionalProperties": { - "type": "string" - } - } - } - }, - { - "id": "ThemeType", - "type": "object", - "properties": { - "images": { - "type": "object", - "optional": true, - "properties": { - "additional_backgrounds": { - "type": "array", - "items": { - "$ref": "ImageDataOrExtensionURL" - }, - "maxItems": 15, - "optional": true - }, - "headerURL": { - "$ref": "ImageDataOrExtensionURL", - "optional": true, - "deprecated": "Unsupported images property, use \u0027theme.images.theme_frame\u0027, this alias is ignored in Firefox \u003E= 70." - }, - "theme_frame": { - "$ref": "ImageDataOrExtensionURL", - "optional": true - } - }, - "additionalProperties": { - "$ref": "ImageDataOrExtensionURL" - } - }, - "colors": { - "type": "object", - "optional": true, - "properties": { - "tab_selected": { - "$ref": "ThemeColor", - "optional": true - }, - "accentcolor": { - "$ref": "ThemeColor", - "optional": true, - "deprecated": "Unsupported colors property, use \u0027theme.colors.frame\u0027, this alias is ignored in Firefox \u003E= 70." - }, - "frame": { - "$ref": "ThemeColor", - "optional": true - }, - "frame_inactive": { - "$ref": "ThemeColor", - "optional": true - }, - "textcolor": { - "$ref": "ThemeColor", - "optional": true, - "deprecated": "Unsupported color property, use \u0027theme.colors.tab_background_text\u0027, this alias is ignored in Firefox \u003E= 70." - }, - "tab_background_text": { - "$ref": "ThemeColor", - "optional": true - }, - "tab_background_separator": { - "$ref": "ThemeColor", - "optional": true - }, - "tab_loading": { - "$ref": "ThemeColor", - "optional": true - }, - "tab_text": { - "$ref": "ThemeColor", - "optional": true - }, - "tab_line": { - "$ref": "ThemeColor", - "optional": true - }, - "toolbar": { - "$ref": "ThemeColor", - "optional": true - }, - "toolbar_text": { - "$ref": "ThemeColor", - "optional": true, - "description": "This color property is an alias of \u0027bookmark_text\u0027." - }, - "bookmark_text": { - "$ref": "ThemeColor", - "optional": true - }, - "toolbar_field": { - "$ref": "ThemeColor", - "optional": true - }, - "toolbar_field_text": { - "$ref": "ThemeColor", - "optional": true - }, - "toolbar_field_border": { - "$ref": "ThemeColor", - "optional": true - }, - "toolbar_field_separator": { - "$ref": "ThemeColor", - "optional": true - }, - "toolbar_top_separator": { - "$ref": "ThemeColor", - "optional": true - }, - "toolbar_bottom_separator": { - "$ref": "ThemeColor", - "optional": true - }, - "toolbar_vertical_separator": { - "$ref": "ThemeColor", - "optional": true - }, - "icons": { - "$ref": "ThemeColor", - "optional": true - }, - "icons_attention": { - "$ref": "ThemeColor", - "optional": true - }, - "button_background_hover": { - "$ref": "ThemeColor", - "optional": true - }, - "button_background_active": { - "$ref": "ThemeColor", - "optional": true - }, - "popup": { - "$ref": "ThemeColor", - "optional": true - }, - "popup_text": { - "$ref": "ThemeColor", - "optional": true - }, - "popup_border": { - "$ref": "ThemeColor", - "optional": true - }, - "toolbar_field_focus": { - "$ref": "ThemeColor", - "optional": true - }, - "toolbar_field_text_focus": { - "$ref": "ThemeColor", - "optional": true - }, - "toolbar_field_border_focus": { - "$ref": "ThemeColor", - "optional": true - }, - "popup_highlight": { - "$ref": "ThemeColor", - "optional": true - }, - "popup_highlight_text": { - "$ref": "ThemeColor", - "optional": true - }, - "ntp_background": { - "$ref": "ThemeColor", - "optional": true - }, - "ntp_text": { - "$ref": "ThemeColor", - "optional": true - }, - "sidebar": { - "$ref": "ThemeColor", - "optional": true - }, - "sidebar_border": { - "$ref": "ThemeColor", - "optional": true - }, - "sidebar_text": { - "$ref": "ThemeColor", - "optional": true - }, - "sidebar_highlight": { - "$ref": "ThemeColor", - "optional": true - }, - "sidebar_highlight_text": { - "$ref": "ThemeColor", - "optional": true - }, - "toolbar_field_highlight": { - "$ref": "ThemeColor", - "optional": true - }, - "toolbar_field_highlight_text": { - "$ref": "ThemeColor", - "optional": true - } - }, - "additionalProperties": { - "$ref": "ThemeColor" - } - }, - "properties": { + "type": "string", + "enum": [ + "menus.overrideContext" + ] + } + ] + } + ] + }, + { + "namespace": "manifest", + "types": [ + { + "id": "KeyName", + "type": "string", + "format": "manifestShortcutKey" + }, + { + "$extend": "WebExtensionManifest", + "properties": { + "commands": { "type": "object", "optional": true, - "properties": { - "additional_backgrounds_alignment": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "bottom", - "center", - "left", - "right", - "top", - "center bottom", - "center center", - "center top", - "left bottom", - "left center", - "left top", - "right bottom", - "right center", - "right top" - ] - }, - "maxItems": 15, - "optional": true + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "UnrecognizedProperty" }, - "additional_backgrounds_tiling": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "no-repeat", - "repeat", - "repeat-x", - "repeat-y" - ] + "properties": { + "suggested_key": { + "type": "object", + "optional": true, + "properties": { + "default": { + "$ref": "KeyName", + "optional": true + }, + "mac": { + "$ref": "KeyName", + "optional": true + }, + "linux": { + "$ref": "KeyName", + "optional": true + }, + "windows": { + "$ref": "KeyName", + "optional": true + }, + "chromeos": { + "type": "string", + "optional": true + }, + "android": { + "type": "string", + "optional": true + }, + "ios": { + "type": "string", + "optional": true + }, + "additionalProperties": { + "type": "string", + "deprecated": "Unknown platform name", + "optional": true + } + } }, - "maxItems": 15, - "optional": true + "description": { + "type": "string", + "preprocess": "localize", + "optional": true + } } - }, - "additionalProperties": { - "type": "string" } } - }, - "additionalProperties": { - "$ref": "UnrecognizedProperty" } - }, + } + ] + }, + { + "namespace": "manifest", + "types": [ { - "id": "ThemeManifest", - "type": "object", - "description": "Contents of manifest.json for a static theme", - "$import": "manifest.ManifestBase", - "properties": { - "theme": { - "$ref": "ThemeType" - }, - "dark_theme": { - "$ref": "ThemeType", - "optional": true - }, - "default_locale": { + "$extend": "OptionalPermission", + "choices": [ + { "type": "string", - "optional": true - }, - "theme_experiment": { - "$ref": "ThemeExperiment", - "optional": true - }, - "icons": { - "type": "object", - "optional": true, - "patternProperties": { - "^[1-9]\\d*$": { - "type": "string" - } - } + "enum": [ + "proxy" + ] } - } - }, + ] + } + ] + }, + { + "namespace": "manifest", + "types": [ { - "$extend": "WebExtensionManifest", - "properties": { - "theme_experiment": { - "$ref": "ThemeExperiment", - "optional": true + "$extend": "PermissionNoPrompt", + "choices": [ + { + "type": "string", + "enum": [ + "dns" + ] } - } + ] } ] }, @@ -1188,65 +924,99 @@ { "$extend": "WebExtensionManifest", "properties": { - "sidebar_action": { + "user_scripts": { "type": "object", + "optional": true, + "properties": { + "api_script": { + "optional": true, + "$ref": "manifest.ExtensionURL" + } + }, "additionalProperties": { "$ref": "UnrecognizedProperty" - }, - "properties": { - "default_title": { + } + } + } + } + ] + }, + { + "namespace": "manifest", + "types": [ + { + "id": "ProtocolHandler", + "type": "object", + "description": "Represents a protocol handler definition.", + "properties": { + "name": { + "description": "A user-readable title string for the protocol handler. This will be displayed to the user in interface objects as needed.", + "type": "string" + }, + "protocol": { + "description": "The protocol the site wishes to handle, specified as a string. For example, you can register to handle SMS text message links by registering to handle the \u0022sms\u0022 scheme.", + "choices": [ + { "type": "string", - "optional": true, - "preprocess": "localize" - }, - "default_icon": { - "$ref": "IconPath", - "optional": true - }, - "browser_style": { - "type": "boolean", - "optional": true, - "default": true + "enum": [ + "bitcoin", + "dat", + "dweb", + "ftp", + "geo", + "gopher", + "im", + "ipfs", + "ipns", + "irc", + "ircs", + "magnet", + "mailto", + "mms", + "news", + "nntp", + "sip", + "sms", + "smsto", + "ssb", + "ssh", + "tel", + "urn", + "webcal", + "wtai", + "xmpp" + ] }, - "default_panel": { + { "type": "string", - "format": "strictRelativeUrl", - "preprocess": "localize" + "pattern": "^(ext|web)\\\u002B[a-z0-9.\u002B-]\u002B$" + } + ] + }, + "uriTemplate": { + "description": "The URL of the handler, as a string. This string should include \u0022%s\u0022 as a placeholder which will be replaced with the escaped URL of the document to be handled. This URL might be a true URL, or it could be a phone number, email address, or so forth.", + "preprocess": "localize", + "choices": [ + { + "$ref": "ExtensionURL" }, - "open_at_install": { - "type": "boolean", - "optional": true, - "default": true, - "description": "Whether or not the sidebar is opened at install. Default is \u003Ccode\u003Etrue\u003C/code\u003E." + { + "$ref": "HttpURL" } - }, - "optional": true + ] } } - } - ] - }, - { - "namespace": "manifest", - "types": [ - { - "$extend": "Permission", - "choices": [ - { - "type": "string", - "pattern": "^experiments(\\.\\w\u002B)\u002B$" - } - ] }, { "$extend": "WebExtensionManifest", "properties": { - "experiment_apis": { - "type": "object", - "additionalProperties": { - "$ref": "experiments.ExperimentAPI" - }, - "optional": true + "protocol_handlers": { + "description": "A list of protocol handler definitions.", + "optional": true, + "type": "array", + "items": { + "$ref": "ProtocolHandler" + } } } } @@ -1256,12 +1026,12 @@ "namespace": "manifest", "types": [ { - "$extend": "OptionalPermission", + "$extend": "PermissionNoPrompt", "choices": [ { "type": "string", "enum": [ - "bookmarks" + "captivePortal" ] } ] @@ -1272,12 +1042,21 @@ "namespace": "manifest", "types": [ { - "$extend": "PermissionNoPrompt", + "$extend": "WebExtensionManifest", + "properties": { + "devtools_page": { + "$ref": "ExtensionURL", + "optional": true + } + } + }, + { + "$extend": "OptionalPermission", "choices": [ { "type": "string", "enum": [ - "networkStatus" + "devtools" ] } ] @@ -1288,28 +1067,24 @@ "namespace": "manifest", "types": [ { - "$extend": "PermissionNoPrompt", + "$extend": "OptionalPermissionNoPrompt", "choices": [ { "type": "string", "enum": [ - "contextualIdentities" + "activeTab" ] } ] - } - ] - }, - { - "namespace": "manifest", - "types": [ + }, { "$extend": "OptionalPermission", "choices": [ { "type": "string", "enum": [ - "privacy" + "tabs", + "tabHide" ] } ] @@ -1318,633 +1093,697 @@ }, { "namespace": "manifest", + "permissions": [], "types": [ { - "id": "KeyName", - "type": "string", - "format": "manifestShortcutKey" + "id": "ManifestBase", + "type": "object", + "description": "Common properties for all manifest.json files", + "properties": { + "manifest_version": { + "type": "integer", + "minimum": 2, + "maximum": 3, + "postprocess": "manifestVersionCheck" + }, + "applications": { + "type": "object", + "optional": true, + "properties": { + "gecko": { + "$ref": "FirefoxSpecificProperties", + "optional": true + } + } + }, + "browser_specific_settings": { + "type": "object", + "optional": true, + "properties": { + "gecko": { + "$ref": "FirefoxSpecificProperties", + "optional": true + }, + "edge": { + "type": "object", + "additionalProperties": { + "type": "any" + }, + "optional": true + } + }, + "additionalProperties": { + "$ref": "UnrecognizedProperty" + } + }, + "name": { + "type": "string", + "optional": false, + "preprocess": "localize" + }, + "short_name": { + "type": "string", + "optional": true, + "preprocess": "localize" + }, + "description": { + "type": "string", + "optional": true, + "preprocess": "localize" + }, + "author": { + "type": "string", + "optional": true, + "preprocess": "localize", + "onError": "warn" + }, + "version": { + "type": "string", + "optional": false + }, + "homepage_url": { + "type": "string", + "format": "url", + "optional": true, + "preprocess": "localize" + } + } }, { - "$extend": "WebExtensionManifest", + "id": "WebExtensionManifest", + "type": "object", + "description": "Represents a WebExtension manifest.json file", + "$import": "ManifestBase", "properties": { - "commands": { + "minimum_chrome_version": { + "type": "string", + "optional": true + }, + "minimum_opera_version": { + "type": "string", + "optional": true + }, + "icons": { "type": "object", "optional": true, - "additionalProperties": { - "type": "object", - "additionalProperties": { - "$ref": "UnrecognizedProperty" + "patternProperties": { + "^[1-9]\\d*$": { + "$ref": "ExtensionFileUrl" + } + } + }, + "incognito": { + "type": "string", + "enum": [ + "not_allowed", + "spanning" + ], + "default": "spanning", + "optional": true + }, + "background": { + "choices": [ + { + "type": "object", + "properties": { + "page": { + "$ref": "ExtensionURL" + }, + "persistent": { + "optional": true, + "$ref": "PersistentBackgroundProperty" + } + }, + "additionalProperties": { + "$ref": "UnrecognizedProperty" + } }, - "properties": { - "suggested_key": { - "type": "object", - "optional": true, - "properties": { - "default": { - "$ref": "KeyName", - "optional": true - }, - "mac": { - "$ref": "KeyName", - "optional": true - }, - "linux": { - "$ref": "KeyName", - "optional": true - }, - "windows": { - "$ref": "KeyName", - "optional": true - }, - "chromeos": { - "type": "string", - "optional": true - }, - "android": { - "type": "string", - "optional": true - }, - "ios": { - "type": "string", - "optional": true - }, - "additionalProperties": { - "type": "string", - "deprecated": "Unknown platform name", - "optional": true + { + "type": "object", + "properties": { + "scripts": { + "type": "array", + "items": { + "$ref": "ExtensionURL" } + }, + "persistent": { + "optional": true, + "$ref": "PersistentBackgroundProperty" + } + }, + "additionalProperties": { + "$ref": "UnrecognizedProperty" + } + }, + { + "type": "object", + "properties": { + "service_worker": { + "$ref": "ExtensionURL" } }, - "description": { - "type": "string", - "preprocess": "localize", - "optional": true - } + "postprocess": "requireBackgroundServiceWorkerEnabled" } - } - } - } - } - ] - }, - { - "namespace": "manifest", - "types": [ - { - "$extend": "OptionalPermissionNoPrompt", - "choices": [ - { - "type": "string", - "enum": [ - "activeTab" - ] - } - ] - }, - { - "$extend": "OptionalPermission", - "choices": [ - { - "type": "string", - "enum": [ - "tabs", - "tabHide" - ] - } - ] - } - ] - }, - { - "namespace": "manifest", - "types": [ - { - "$extend": "WebExtensionManifest", - "properties": { - "browser_action": { + ], + "optional": true + }, + "options_ui": { "type": "object", - "additionalProperties": { - "$ref": "UnrecognizedProperty" - }, + "optional": true, "properties": { - "default_title": { - "type": "string", + "page": { + "$ref": "ExtensionURL" + }, + "browser_style": { + "type": "boolean", "optional": true, - "preprocess": "localize" + "default": true }, - "default_icon": { - "$ref": "IconPath", + "chrome_style": { + "type": "boolean", "optional": true }, - "theme_icons": { - "type": "array", - "optional": true, - "minItems": 1, - "items": { - "$ref": "ThemeIcons" - }, - "description": "Specifies icons to use for dark and light themes" + "open_in_tab": { + "type": "boolean", + "optional": true + } + }, + "additionalProperties": { + "type": "any", + "deprecated": "An unexpected property was found in the WebExtension manifest" + } + }, + "content_scripts": { + "type": "array", + "optional": true, + "items": { + "$ref": "ContentScript" + } + }, + "content_security_policy": { + "optional": true, + "onError": "warn", + "choices": [ + { + "type": "string", + "format": "contentSecurityPolicy" }, - "default_popup": { + { + "type": "object", + "additionalProperties": { + "$ref": "UnrecognizedProperty" + }, + "properties": { + "extension_pages": { + "type": "string", + "optional": true, + "format": "contentSecurityPolicy", + "description": "The Content Security Policy used for extension pages." + } + } + } + ] + }, + "permissions": { + "type": "array", + "default": [], + "items": { + "$ref": "PermissionOrOrigin", + "onError": "warn" + }, + "optional": true + }, + "optional_permissions": { + "type": "array", + "items": { + "$ref": "OptionalPermissionOrOrigin", + "onError": "warn" + }, + "optional": true, + "default": [] + }, + "web_accessible_resources": { + "type": "array", + "items": { + "type": "string" + }, + "optional": true + }, + "developer": { + "type": "object", + "optional": true, + "properties": { + "name": { "type": "string", - "format": "relativeUrl", "optional": true, "preprocess": "localize" }, - "browser_style": { - "type": "boolean", - "optional": true, - "default": false - }, - "default_area": { - "description": "Defines the location the browserAction will appear by default. The default location is navbar.", + "url": { "type": "string", - "enum": [ - "navbar", - "menupanel", - "tabstrip", - "personaltoolbar" - ], - "optional": true + "optional": true, + "preprocess": "localize" } - }, - "optional": true + } + }, + "hidden": { + "type": "boolean", + "optional": true, + "default": false } + }, + "additionalProperties": { + "$ref": "UnrecognizedProperty" } - } - ] - }, - { - "namespace": "manifest", - "types": [ + }, + { + "id": "WebExtensionLangpackManifest", + "type": "object", + "description": "Represents a WebExtension language pack manifest.json file", + "$import": "ManifestBase", + "properties": { + "homepage_url": { + "type": "string", + "format": "url", + "optional": true, + "preprocess": "localize" + }, + "langpack_id": { + "type": "string", + "pattern": "^[a-zA-Z][a-zA-Z-]\u002B$" + }, + "languages": { + "type": "object", + "patternProperties": { + "^[a-z]{2}[a-zA-Z-]*$": { + "type": "object", + "properties": { + "chrome_resources": { + "type": "object", + "patternProperties": { + "^[a-zA-Z-.]\u002B$": { + "choices": [ + { + "$ref": "ExtensionURL" + }, + { + "type": "object", + "patternProperties": { + "^[a-z]\u002B$": { + "$ref": "ExtensionURL" + } + } + } + ] + } + } + }, + "version": { + "type": "string" + } + } + } + } + }, + "sources": { + "type": "object", + "optional": true, + "patternProperties": { + "^[a-z]\u002B$": { + "type": "object", + "properties": { + "base_path": { + "$ref": "ExtensionURL" + }, + "paths": { + "type": "array", + "items": { + "type": "string", + "format": "strictRelativeUrl" + }, + "optional": true + } + } + } + } + } + } + }, { - "id": "ProtocolHandler", + "id": "WebExtensionDictionaryManifest", "type": "object", - "description": "Represents a protocol handler definition.", + "description": "Represents a WebExtension dictionary manifest.json file", + "$import": "ManifestBase", "properties": { - "name": { - "description": "A user-readable title string for the protocol handler. This will be displayed to the user in interface objects as needed.", - "type": "string" + "homepage_url": { + "type": "string", + "format": "url", + "optional": true, + "preprocess": "localize" }, - "protocol": { - "description": "The protocol the site wishes to handle, specified as a string. For example, you can register to handle SMS text message links by registering to handle the \u0022sms\u0022 scheme.", - "choices": [ - { - "type": "string", - "enum": [ - "bitcoin", - "dat", - "dweb", - "ftp", - "geo", - "gopher", - "im", - "ipfs", - "ipns", - "irc", - "ircs", - "magnet", - "mailto", - "mms", - "news", - "nntp", - "sip", - "sms", - "smsto", - "ssb", - "ssh", - "tel", - "urn", - "webcal", - "wtai", - "xmpp" - ] - }, - { + "dictionaries": { + "type": "object", + "patternProperties": { + "^[a-z]{2}[a-zA-Z-]*$": { "type": "string", - "pattern": "^(ext|web)\\\u002B[a-z0-9.\u002B-]\u002B$" - } - ] - }, - "uriTemplate": { - "description": "The URL of the handler, as a string. This string should include \u0022%s\u0022 as a placeholder which will be replaced with the escaped URL of the document to be handled. This URL might be a true URL, or it could be a phone number, email address, or so forth.", - "preprocess": "localize", - "choices": [ - { - "$ref": "ExtensionURL" - }, - { - "$ref": "HttpURL" + "format": "strictRelativeUrl", + "pattern": "\\.dic$" } - ] + } } } }, { - "$extend": "WebExtensionManifest", + "id": "ThemeIcons", + "type": "object", "properties": { - "protocol_handlers": { - "description": "A list of protocol handler definitions.", - "optional": true, - "type": "array", - "items": { - "$ref": "ProtocolHandler" - } + "light": { + "$ref": "ExtensionURL", + "description": "A light icon to use for dark themes" + }, + "dark": { + "$ref": "ExtensionURL", + "description": "The dark icon to use for light themes" + }, + "size": { + "type": "integer", + "description": "The size of the icons" } + }, + "additionalProperties": { + "$ref": "UnrecognizedProperty" } - } - ] - }, - { - "namespace": "manifest", - "types": [ + }, { - "$extend": "PermissionNoPrompt", + "id": "OptionalPermissionNoPrompt", "choices": [ { "type": "string", "enum": [ - "dns" + "idle" ] } ] - } - ] - }, - { - "namespace": "manifest", - "types": [ + }, { - "$extend": "OptionalPermission", + "id": "OptionalPermission", "choices": [ + { + "$ref": "OptionalPermissionNoPrompt" + }, { "type": "string", "enum": [ - "proxy" + "clipboardRead", + "clipboardWrite", + "geolocation", + "notifications" ] } ] - } - ] - }, - { - "namespace": "manifest", - "types": [ + }, { - "$extend": "OptionalPermission", + "id": "OptionalPermissionOrOrigin", + "choices": [ + { + "$ref": "OptionalPermission" + }, + { + "$ref": "MatchPattern" + } + ] + }, + { + "id": "PermissionNoPrompt", "choices": [ + { + "$ref": "OptionalPermission" + }, { "type": "string", "enum": [ - "topSites" + "alarms", + "mozillaAddons", + "storage", + "unlimitedStorage" ] } ] - } - ] - }, - { - "namespace": "manifest", - "types": [ + }, { - "$extend": "WebExtensionManifest", + "id": "Permission", + "choices": [ + { + "$ref": "PermissionNoPrompt" + }, + { + "$ref": "OptionalPermission" + } + ] + }, + { + "id": "PermissionOrOrigin", + "choices": [ + { + "$ref": "Permission" + }, + { + "$ref": "MatchPattern" + } + ] + }, + { + "id": "HttpURL", + "type": "string", + "format": "url", + "pattern": "^https?://.*$" + }, + { + "id": "ExtensionURL", + "type": "string", + "format": "strictRelativeUrl" + }, + { + "id": "ExtensionFileUrl", + "type": "string", + "format": "strictRelativeUrl", + "pattern": "\\S", + "preprocess": "localize" + }, + { + "id": "ImageDataOrExtensionURL", + "type": "string", + "format": "imageDataOrStrictRelativeUrl" + }, + { + "id": "ExtensionID", + "choices": [ + { + "type": "string", + "pattern": "(?i)^\\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\}$" + }, + { + "type": "string", + "pattern": "(?i)^[a-z0-9-._]*@[a-z0-9-._]\u002B$" + } + ] + }, + { + "id": "FirefoxSpecificProperties", + "type": "object", "properties": { - "devtools_page": { - "$ref": "ExtensionURL", + "id": { + "$ref": "ExtensionID", + "optional": true + }, + "update_url": { + "type": "string", + "format": "url", + "optional": true + }, + "strict_min_version": { + "type": "string", + "optional": true + }, + "strict_max_version": { + "type": "string", "optional": true } } }, { - "$extend": "OptionalPermission", + "id": "MatchPattern", "choices": [ { "type": "string", "enum": [ - "devtools" + "\u003Call_urls\u003E" ] + }, + { + "$ref": "MatchPatternRestricted" + }, + { + "$ref": "MatchPatternUnestricted" } ] - } - ] - }, - { - "namespace": "manifest", - "types": [ + }, { - "$extend": "PermissionNoPrompt", + "id": "MatchPatternRestricted", + "description": "Same as MatchPattern above, but excludes \u003Call_urls\u003E", "choices": [ { "type": "string", - "enum": [ - "menus", - "contextMenus" - ] + "pattern": "^(https?|wss?|file|ftp|\\*)://(\\*|\\*\\.[^*/]\u002B|[^*/]\u002B)/.*$" + }, + { + "type": "string", + "pattern": "^file:///.*$" } ] }, { - "$extend": "OptionalPermissionNoPrompt", + "id": "MatchPatternUnestricted", + "description": "Mostly unrestricted match patterns for privileged add-ons. This should technically be rejected for unprivileged add-ons, but, reasons. The MatchPattern class will still refuse privileged schemes for those extensions.", "choices": [ { "type": "string", - "enum": [ - "menus.overrideContext" - ] + "pattern": "^resource://(\\*|\\*\\.[^*/]\u002B|[^*/]\u002B)/.*$|^about:" } ] - } - ] - }, - { - "namespace": "manifest", - "types": [ + }, { - "$extend": "WebExtensionManifest", + "id": "ContentScript", + "type": "object", + "description": "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. Based on InjectDetails, but using underscore rather than camel case naming conventions.", + "additionalProperties": { + "$ref": "UnrecognizedProperty" + }, "properties": { - "chrome_settings_overrides": { - "type": "object", + "matches": { + "type": "array", + "optional": false, + "minItems": 1, + "items": { + "$ref": "MatchPattern" + } + }, + "exclude_matches": { + "type": "array", "optional": true, - "additionalProperties": { - "$ref": "UnrecognizedProperty" - }, - "properties": { - "homepage": { - "type": "string", - "format": "homepageUrl", - "optional": true, - "preprocess": "localize" - }, - "search_provider": { - "type": "object", - "optional": true, - "additionalProperties": { - "$ref": "UnrecognizedProperty" - }, - "properties": { - "name": { - "type": "string", - "preprocess": "localize" - }, - "keyword": { - "optional": true, - "choices": [ - { - "type": "string", - "preprocess": "localize" - }, - { - "type": "array", - "items": { - "type": "string", - "preprocess": "localize" - }, - "minItems": 1 - } - ] - }, - "search_url": { - "type": "string", - "format": "url", - "pattern": "^(https://|http://(localhost|127\\.0\\.0\\.1|\\[::1\\])(:\\d*)?(/|$)).*$", - "preprocess": "localize" - }, - "favicon_url": { - "type": "string", - "optional": true, - "format": "relativeUrl", - "preprocess": "localize" - }, - "suggest_url": { - "type": "string", - "optional": true, - "pattern": "^$|^(https://|http://(localhost|127\\.0\\.0\\.1|\\[::1\\])(:\\d*)?(/|$)).*$", - "preprocess": "localize" - }, - "instant_url": { - "type": "string", - "optional": true, - "format": "url", - "preprocess": "localize", - "deprecated": "Unsupported on Firefox at this time." - }, - "image_url": { - "type": "string", - "optional": true, - "format": "url", - "preprocess": "localize", - "deprecated": "Unsupported on Firefox at this time." - }, - "search_url_get_params": { - "type": "string", - "optional": true, - "preprocess": "localize", - "description": "GET parameters to the search_url as a query string." - }, - "search_url_post_params": { - "type": "string", - "optional": true, - "preprocess": "localize", - "description": "POST parameters to the search_url as a query string." - }, - "suggest_url_get_params": { - "type": "string", - "optional": true, - "preprocess": "localize", - "description": "GET parameters to the suggest_url as a query string." - }, - "suggest_url_post_params": { - "type": "string", - "optional": true, - "preprocess": "localize", - "description": "POST parameters to the suggest_url as a query string." - }, - "instant_url_post_params": { - "type": "string", - "optional": true, - "preprocess": "localize", - "deprecated": "Unsupported on Firefox at this time." - }, - "image_url_post_params": { - "type": "string", - "optional": true, - "preprocess": "localize", - "deprecated": "Unsupported on Firefox at this time." - }, - "search_form": { - "type": "string", - "optional": true, - "format": "url", - "pattern": "^(https://|http://(localhost|127\\.0\\.0\\.1|\\[::1\\])(:\\d*)?(/|$)).*$", - "preprocess": "localize" - }, - "alternate_urls": { - "type": "array", - "items": { - "type": "string", - "format": "url", - "preprocess": "localize" - }, - "optional": true, - "deprecated": "Unsupported on Firefox at this time." - }, - "prepopulated_id": { - "type": "integer", - "optional": true, - "deprecated": "Unsupported on Firefox." - }, - "encoding": { - "type": "string", - "optional": true, - "description": "Encoding of the search term." - }, - "is_default": { - "type": "boolean", - "optional": true, - "description": "Sets the default engine to a built-in engine only." - }, - "params": { - "optional": true, - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "A url parameter name" - }, - "condition": { - "type": "string", - "optional": true, - "enum": [ - "purpose", - "pref" - ], - "description": "The type of param can be either \u0022purpose\u0022 or \u0022pref\u0022." - }, - "pref": { - "type": "string", - "optional": true, - "description": "The preference to retrieve the value from.", - "preprocess": "localize" - }, - "purpose": { - "type": "string", - "optional": true, - "enum": [ - "contextmenu", - "searchbar", - "homepage", - "keyword", - "newtab" - ], - "description": "The context that initiates a search, required if condition is \u0022purpose\u0022." - }, - "value": { - "type": "string", - "optional": true, - "description": "A url parameter value.", - "preprocess": "localize" - } - } - }, - "description": "A list of optional search url parameters. This allows the additon of search url parameters based on how the search is performed in Firefox." - } - } - } + "minItems": 1, + "items": { + "$ref": "MatchPattern" + } + }, + "include_globs": { + "type": "array", + "optional": true, + "items": { + "type": "string" + } + }, + "exclude_globs": { + "type": "array", + "optional": true, + "items": { + "type": "string" + } + }, + "css": { + "type": "array", + "optional": true, + "description": "The list of CSS files to inject", + "items": { + "$ref": "ExtensionURL" + } + }, + "js": { + "type": "array", + "optional": true, + "description": "The list of JS files to inject", + "items": { + "$ref": "ExtensionURL" } + }, + "all_frames": { + "type": "boolean", + "optional": true, + "description": "If allFrames is \u003Ccode\u003Etrue\u003C/code\u003E, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it\u0027s \u003Ccode\u003Efalse\u003C/code\u003E and is only injected into the top frame." + }, + "match_about_blank": { + "type": "boolean", + "optional": true, + "description": "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 \u003Ccode\u003Efalse\u003C/code\u003E." + }, + "run_at": { + "$ref": "extensionTypes.RunAt", + "optional": true, + "default": "document_idle", + "description": "The soonest that the JavaScript or CSS will be injected into the tab. Defaults to \u0022document_idle\u0022." } } - } - ] - }, - { - "namespace": "manifest", - "types": [ + }, { - "$extend": "OptionalPermission", + "id": "IconPath", "choices": [ { - "type": "string", - "enum": [ - "history" - ] + "type": "object", + "patternProperties": { + "^[1-9]\\d*$": { + "$ref": "ExtensionFileUrl" + } + }, + "additionalProperties": false + }, + { + "$ref": "ExtensionFileUrl" } ] - } - ] - }, - { - "namespace": "manifest", - "types": [ + }, { - "$extend": "WebExtensionManifest", - "properties": { - "page_action": { + "id": "IconImageData", + "choices": [ + { "type": "object", - "additionalProperties": { - "$ref": "UnrecognizedProperty" - }, - "properties": { - "default_title": { - "type": "string", - "optional": true, - "preprocess": "localize" - }, - "default_icon": { - "$ref": "IconPath", - "optional": true - }, - "default_popup": { - "type": "string", - "format": "relativeUrl", - "optional": true, - "preprocess": "localize" - }, - "browser_style": { - "type": "boolean", - "optional": true, - "default": false - }, - "show_matches": { - "type": "array", - "optional": true, - "minItems": 1, - "items": { - "$ref": "MatchPattern" - } - }, - "hide_matches": { - "type": "array", - "optional": true, - "minItems": 1, - "items": { - "$ref": "MatchPatternRestricted" - } - }, - "pinned": { - "type": "boolean", - "optional": true, - "default": true + "patternProperties": { + "^[1-9]\\d*$": { + "$ref": "ImageData" } }, - "optional": true + "additionalProperties": false + }, + { + "$ref": "ImageData" } - } - } - ] - }, - { - "namespace": "manifest", - "types": [ + ] + }, { - "$extend": "OptionalPermission", + "id": "ImageData", + "type": "object", + "isInstanceOf": "ImageData", + "postprocess": "convertImageDataToURL" + }, + { + "id": "UnrecognizedProperty", + "type": "any", + "deprecated": "An unexpected property was found in the WebExtension manifest." + }, + { + "id": "PersistentBackgroundProperty", "choices": [ { - "type": "string", + "type": "boolean", "enum": [ - "browserSettings" + true ] + }, + { + "type": "boolean", + "enum": [ + false + ], + "deprecated": "Event pages are not currently supported. This will run as a persistent background page." } ] } @@ -1959,47 +1798,13 @@ { "type": "string", "enum": [ - "downloads", - "downloads.open" + "history" ] } ] } ] }, - { - "namespace": "manifest", - "types": [ - { - "$extend": "WebExtensionManifest", - "properties": { - "chrome_url_overrides": { - "type": "object", - "optional": true, - "properties": { - "newtab": { - "$ref": "ExtensionURL", - "optional": true, - "preprocess": "localize" - }, - "bookmarks": { - "unsupported": true, - "$ref": "ExtensionURL", - "optional": true, - "preprocess": "localize" - }, - "history": { - "unsupported": true, - "$ref": "ExtensionURL", - "optional": true, - "preprocess": "localize" - } - } - } - } - } - ] - }, { "namespace": "manifest", "types": [ @@ -2020,12 +1825,12 @@ "namespace": "manifest", "types": [ { - "$extend": "OptionalPermission", + "$extend": "PermissionNoPrompt", "choices": [ { "type": "string", "enum": [ - "nativeMessaging" + "normandyAddonStudy" ] } ] @@ -2041,7 +1846,7 @@ { "type": "string", "enum": [ - "pkcs11" + "nativeMessaging" ] } ] @@ -2052,38 +1857,62 @@ "namespace": "manifest", "types": [ { - "$extend": "PermissionNoPrompt", + "id": "NativeManifest", + "description": "Represents a native manifest file", "choices": [ { - "type": "string", - "enum": [ - "normandyAddonStudy" - ] - } - ] - } - ] - }, - { - "namespace": "manifest", - "types": [ - { - "$extend": "WebExtensionManifest", - "properties": { - "user_scripts": { "type": "object", - "optional": true, "properties": { - "api_script": { - "optional": true, - "$ref": "manifest.ExtensionURL" + "name": { + "type": "string", + "pattern": "^\\w\u002B(\\.\\w\u002B)*$" + }, + "description": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "pkcs11", + "stdio" + ] + }, + "allowed_extensions": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "manifest.ExtensionID" + } + } + } + }, + { + "type": "object", + "properties": { + "name": { + "$ref": "manifest.ExtensionID" + }, + "description": { + "type": "string" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "any" + } + }, + "type": { + "type": "string", + "enum": [ + "storage" + ] } - }, - "additionalProperties": { - "$ref": "UnrecognizedProperty" } } - } + ] } ] }, @@ -2091,12 +1920,12 @@ "namespace": "manifest", "types": [ { - "$extend": "OptionalPermission", + "$extend": "PermissionNoPrompt", "choices": [ { "type": "string", "enum": [ - "webNavigation" + "geckoProfiler" ] } ] @@ -2107,12 +1936,13 @@ "namespace": "manifest", "types": [ { - "$extend": "PermissionNoPrompt", + "$extend": "OptionalPermission", "choices": [ { "type": "string", "enum": [ - "geckoProfiler" + "downloads", + "downloads.open" ] } ] @@ -2128,7 +1958,7 @@ { "type": "string", "enum": [ - "browsingData" + "topSites" ] } ] @@ -2144,7 +1974,7 @@ { "type": "string", "enum": [ - "urlbar" + "networkStatus" ] } ] @@ -2155,15 +1985,22 @@ "namespace": "manifest", "types": [ { - "$extend": "PermissionNoPrompt", - "choices": [ - { - "type": "string", - "enum": [ - "activityLog" - ] + "$extend": "WebExtensionManifest", + "properties": { + "omnibox": { + "type": "object", + "additionalProperties": { + "$ref": "UnrecognizedProperty" + }, + "properties": { + "keyword": { + "type": "string", + "pattern": "^[^?\\s:][^\\s:]*$" + } + }, + "optional": true } - ] + } } ] }, @@ -2173,15 +2010,84 @@ { "$extend": "WebExtensionManifest", "properties": { - "omnibox": { + "chrome_url_overrides": { + "type": "object", + "optional": true, + "properties": { + "newtab": { + "$ref": "ExtensionURL", + "optional": true, + "preprocess": "localize" + }, + "bookmarks": { + "unsupported": true, + "$ref": "ExtensionURL", + "optional": true, + "preprocess": "localize" + }, + "history": { + "unsupported": true, + "$ref": "ExtensionURL", + "optional": true, + "preprocess": "localize" + } + } + } + } + } + ] + }, + { + "namespace": "manifest", + "types": [ + { + "$extend": "WebExtensionManifest", + "properties": { + "browser_action": { "type": "object", "additionalProperties": { "$ref": "UnrecognizedProperty" }, "properties": { - "keyword": { + "default_title": { "type": "string", - "pattern": "^[^?\\s:][^\\s:]*$" + "optional": true, + "preprocess": "localize" + }, + "default_icon": { + "$ref": "IconPath", + "optional": true + }, + "theme_icons": { + "type": "array", + "optional": true, + "minItems": 1, + "items": { + "$ref": "ThemeIcons" + }, + "description": "Specifies icons to use for dark and light themes" + }, + "default_popup": { + "type": "string", + "format": "relativeUrl", + "optional": true, + "preprocess": "localize" + }, + "browser_style": { + "type": "boolean", + "optional": true, + "default": false + }, + "default_area": { + "description": "Defines the location the browserAction will appear by default. The default location is navbar.", + "type": "string", + "enum": [ + "navbar", + "menupanel", + "tabstrip", + "personaltoolbar" + ], + "optional": true } }, "optional": true @@ -2190,6 +2096,22 @@ } ] }, + { + "namespace": "manifest", + "types": [ + { + "$extend": "OptionalPermission", + "choices": [ + { + "type": "string", + "enum": [ + "webNavigation" + ] + } + ] + } + ] + }, { "namespace": "manifest", "types": [ @@ -2211,6 +2133,22 @@ } ] }, + { + "namespace": "manifest", + "types": [ + { + "$extend": "OptionalPermission", + "choices": [ + { + "type": "string", + "enum": [ + "pkcs11" + ] + } + ] + } + ] + }, { "namespace": "manifest", "types": [ @@ -2220,7 +2158,23 @@ { "type": "string", "enum": [ - "captivePortal" + "urlbar" + ] + } + ] + } + ] + }, + { + "namespace": "manifest", + "types": [ + { + "$extend": "OptionalPermissionNoPrompt", + "choices": [ + { + "type": "string", + "enum": [ + "cookies" ] } ] @@ -2244,6 +2198,22 @@ } ] }, + { + "namespace": "manifest", + "types": [ + { + "$extend": "PermissionNoPrompt", + "choices": [ + { + "type": "string", + "enum": [ + "identity" + ] + } + ] + } + ] + }, { "namespace": "manifest", "types": [ @@ -2322,31 +2292,59 @@ "namespace": "manifest", "types": [ { - "$extend": "PermissionNoPrompt", - "choices": [ - { - "type": "string", - "enum": [ - "identity" - ] - } - ] - } - ] - }, - { - "namespace": "manifest", - "types": [ - { - "$extend": "OptionalPermissionNoPrompt", - "choices": [ - { - "type": "string", - "enum": [ - "cookies" - ] + "$extend": "WebExtensionManifest", + "properties": { + "page_action": { + "type": "object", + "additionalProperties": { + "$ref": "UnrecognizedProperty" + }, + "properties": { + "default_title": { + "type": "string", + "optional": true, + "preprocess": "localize" + }, + "default_icon": { + "$ref": "IconPath", + "optional": true + }, + "default_popup": { + "type": "string", + "format": "relativeUrl", + "optional": true, + "preprocess": "localize" + }, + "browser_style": { + "type": "boolean", + "optional": true, + "default": false + }, + "show_matches": { + "type": "array", + "optional": true, + "minItems": 1, + "items": { + "$ref": "MatchPattern" + } + }, + "hide_matches": { + "type": "array", + "optional": true, + "minItems": 1, + "items": { + "$ref": "MatchPatternRestricted" + } + }, + "pinned": { + "type": "boolean", + "optional": true, + "default": true + } + }, + "optional": true } - ] + } } ] } diff --git a/src/WebExtension.Net/Generated/Manifest/ManifestBase.cs b/src/WebExtension.Net/Generated/Manifest/ManifestBase.cs index 800dc07..2230c0e 100644 --- a/src/WebExtension.Net/Generated/Manifest/ManifestBase.cs +++ b/src/WebExtension.Net/Generated/Manifest/ManifestBase.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,71 +10,179 @@ namespace WebExtension.Net.Manifest /// /// Common properties for all manifest.json files /// - public class ManifestBase + public class ManifestBase : BaseObject { // Property Definition + private int _manifest_version; /// /// /// [JsonPropertyName("manifest_version")] - public int Manifest_version { get; set; } + public int Manifest_version + { + get + { + InitializeProperty("manifest_version", _manifest_version); + return _manifest_version; + } + set + { + _manifest_version = value; + } + } // Property Definition + private object _applications; /// /// /// [JsonPropertyName("applications")] - public object Applications { get; set; } + public object Applications + { + get + { + InitializeProperty("applications", _applications); + return _applications; + } + set + { + _applications = value; + } + } // Property Definition + private object _browser_specific_settings; /// /// /// [JsonPropertyName("browser_specific_settings")] - public object Browser_specific_settings { get; set; } + public object Browser_specific_settings + { + get + { + InitializeProperty("browser_specific_settings", _browser_specific_settings); + return _browser_specific_settings; + } + set + { + _browser_specific_settings = value; + } + } // Property Definition + private string _name; /// /// /// [JsonPropertyName("name")] - public string Name { get; set; } + public string Name + { + get + { + InitializeProperty("name", _name); + return _name; + } + set + { + _name = value; + } + } // Property Definition + private string _short_name; /// /// /// [JsonPropertyName("short_name")] - public string Short_name { get; set; } + public string Short_name + { + get + { + InitializeProperty("short_name", _short_name); + return _short_name; + } + set + { + _short_name = value; + } + } // Property Definition + private string _description; /// /// /// [JsonPropertyName("description")] - public string Description { get; set; } + public string Description + { + get + { + InitializeProperty("description", _description); + return _description; + } + set + { + _description = value; + } + } // Property Definition + private string _author; /// /// /// [JsonPropertyName("author")] - public string Author { get; set; } + public string Author + { + get + { + InitializeProperty("author", _author); + return _author; + } + set + { + _author = value; + } + } // Property Definition + private string _version; /// /// /// [JsonPropertyName("version")] - public string Version { get; set; } + public string Version + { + get + { + InitializeProperty("version", _version); + return _version; + } + set + { + _version = value; + } + } // Property Definition + private string _homepage_url; /// /// /// [JsonPropertyName("homepage_url")] - public string Homepage_url { get; set; } + public string Homepage_url + { + get + { + InitializeProperty("homepage_url", _homepage_url); + return _homepage_url; + } + set + { + _homepage_url = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Manifest/MatchPattern.cs b/src/WebExtension.Net/Generated/Manifest/MatchPattern.cs index 5824ef0..991b6f5 100644 --- a/src/WebExtension.Net/Generated/Manifest/MatchPattern.cs +++ b/src/WebExtension.Net/Generated/Manifest/MatchPattern.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/MatchPatternRestricted.cs b/src/WebExtension.Net/Generated/Manifest/MatchPatternRestricted.cs index 0b215ec..5aec48c 100644 --- a/src/WebExtension.Net/Generated/Manifest/MatchPatternRestricted.cs +++ b/src/WebExtension.Net/Generated/Manifest/MatchPatternRestricted.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/MatchPatternUnestricted.cs b/src/WebExtension.Net/Generated/Manifest/MatchPatternUnestricted.cs index 368efc7..22fbd60 100644 --- a/src/WebExtension.Net/Generated/Manifest/MatchPatternUnestricted.cs +++ b/src/WebExtension.Net/Generated/Manifest/MatchPatternUnestricted.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/NativeManifest.cs b/src/WebExtension.Net/Generated/Manifest/NativeManifest.cs index 3014f11..e8750a6 100644 --- a/src/WebExtension.Net/Generated/Manifest/NativeManifest.cs +++ b/src/WebExtension.Net/Generated/Manifest/NativeManifest.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/OptionalPermission.cs b/src/WebExtension.Net/Generated/Manifest/OptionalPermission.cs index 4f1a9d7..2e34cce 100644 --- a/src/WebExtension.Net/Generated/Manifest/OptionalPermission.cs +++ b/src/WebExtension.Net/Generated/Manifest/OptionalPermission.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/OptionalPermissionNoPrompt.cs b/src/WebExtension.Net/Generated/Manifest/OptionalPermissionNoPrompt.cs index 4e8b54f..312d611 100644 --- a/src/WebExtension.Net/Generated/Manifest/OptionalPermissionNoPrompt.cs +++ b/src/WebExtension.Net/Generated/Manifest/OptionalPermissionNoPrompt.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/OptionalPermissionOrOrigin.cs b/src/WebExtension.Net/Generated/Manifest/OptionalPermissionOrOrigin.cs index c900d98..a6773f6 100644 --- a/src/WebExtension.Net/Generated/Manifest/OptionalPermissionOrOrigin.cs +++ b/src/WebExtension.Net/Generated/Manifest/OptionalPermissionOrOrigin.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/Permission.cs b/src/WebExtension.Net/Generated/Manifest/Permission.cs index d0ff1cd..d53b7d1 100644 --- a/src/WebExtension.Net/Generated/Manifest/Permission.cs +++ b/src/WebExtension.Net/Generated/Manifest/Permission.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/PermissionNoPrompt.cs b/src/WebExtension.Net/Generated/Manifest/PermissionNoPrompt.cs index bd3cc7e..b4bf38c 100644 --- a/src/WebExtension.Net/Generated/Manifest/PermissionNoPrompt.cs +++ b/src/WebExtension.Net/Generated/Manifest/PermissionNoPrompt.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/PermissionOrOrigin.cs b/src/WebExtension.Net/Generated/Manifest/PermissionOrOrigin.cs index 8d3597a..4641378 100644 --- a/src/WebExtension.Net/Generated/Manifest/PermissionOrOrigin.cs +++ b/src/WebExtension.Net/Generated/Manifest/PermissionOrOrigin.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/PersistentBackgroundProperty.cs b/src/WebExtension.Net/Generated/Manifest/PersistentBackgroundProperty.cs index 2e0c156..4e8fa84 100644 --- a/src/WebExtension.Net/Generated/Manifest/PersistentBackgroundProperty.cs +++ b/src/WebExtension.Net/Generated/Manifest/PersistentBackgroundProperty.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/ProtocolHandler.cs b/src/WebExtension.Net/Generated/Manifest/ProtocolHandler.cs index dc84d76..31c5fce 100644 --- a/src/WebExtension.Net/Generated/Manifest/ProtocolHandler.cs +++ b/src/WebExtension.Net/Generated/Manifest/ProtocolHandler.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,29 +10,65 @@ namespace WebExtension.Net.Manifest /// /// Represents a protocol handler definition. /// - public class ProtocolHandler + public class ProtocolHandler : BaseObject { // Property Definition + private string _name; /// /// A user-readable title string for the protocol handler. This will be displayed to the user in interface objects as needed. /// [JsonPropertyName("name")] - public string Name { get; set; } + public string Name + { + get + { + InitializeProperty("name", _name); + return _name; + } + set + { + _name = value; + } + } // Property Definition + private object _protocol; /// /// The protocol the site wishes to handle, specified as a string. For example, you can register to handle SMS text message links by registering to handle the "sms" scheme. /// [JsonPropertyName("protocol")] - public object Protocol { get; set; } + public object Protocol + { + get + { + InitializeProperty("protocol", _protocol); + return _protocol; + } + set + { + _protocol = value; + } + } // Property Definition + private object _uriTemplate; /// /// The URL of the handler, as a string. This string should include "%s" as a placeholder which will be replaced with the escaped URL of the document to be handled. This URL might be a true URL, or it could be a phone number, email address, or so forth. /// [JsonPropertyName("uriTemplate")] - public object UriTemplate { get; set; } + public object UriTemplate + { + get + { + InitializeProperty("uriTemplate", _uriTemplate); + return _uriTemplate; + } + set + { + _uriTemplate = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Manifest/ThemeColor.cs b/src/WebExtension.Net/Generated/Manifest/ThemeColor.cs index de57300..c03133e 100644 --- a/src/WebExtension.Net/Generated/Manifest/ThemeColor.cs +++ b/src/WebExtension.Net/Generated/Manifest/ThemeColor.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Manifest/ThemeExperiment.cs b/src/WebExtension.Net/Generated/Manifest/ThemeExperiment.cs index ffb3cb9..036bcb9 100644 --- a/src/WebExtension.Net/Generated/Manifest/ThemeExperiment.cs +++ b/src/WebExtension.Net/Generated/Manifest/ThemeExperiment.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,36 +10,84 @@ namespace WebExtension.Net.Manifest /// /// /// - public class ThemeExperiment + public class ThemeExperiment : BaseObject { // Property Definition + private ExtensionURL _stylesheet; /// /// /// [JsonPropertyName("stylesheet")] - public ExtensionURL Stylesheet { get; set; } + public ExtensionURL Stylesheet + { + get + { + InitializeProperty("stylesheet", _stylesheet); + return _stylesheet; + } + set + { + _stylesheet = value; + } + } // Property Definition + private object _images; /// /// /// [JsonPropertyName("images")] - public object Images { get; set; } + public object Images + { + get + { + InitializeProperty("images", _images); + return _images; + } + set + { + _images = value; + } + } // Property Definition + private object _colors; /// /// /// [JsonPropertyName("colors")] - public object Colors { get; set; } + public object Colors + { + get + { + InitializeProperty("colors", _colors); + return _colors; + } + set + { + _colors = value; + } + } // Property Definition + private object _properties; /// /// /// [JsonPropertyName("properties")] - public object Properties { get; set; } + public object Properties + { + get + { + InitializeProperty("properties", _properties); + return _properties; + } + set + { + _properties = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Manifest/ThemeIcons.cs b/src/WebExtension.Net/Generated/Manifest/ThemeIcons.cs index 2002e7d..e5982fa 100644 --- a/src/WebExtension.Net/Generated/Manifest/ThemeIcons.cs +++ b/src/WebExtension.Net/Generated/Manifest/ThemeIcons.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,29 +10,65 @@ namespace WebExtension.Net.Manifest /// /// /// - public class ThemeIcons + public class ThemeIcons : BaseObject { // Property Definition + private ExtensionURL _light; /// /// A light icon to use for dark themes /// [JsonPropertyName("light")] - public ExtensionURL Light { get; set; } + public ExtensionURL Light + { + get + { + InitializeProperty("light", _light); + return _light; + } + set + { + _light = value; + } + } // Property Definition + private ExtensionURL _dark; /// /// The dark icon to use for light themes /// [JsonPropertyName("dark")] - public ExtensionURL Dark { get; set; } + public ExtensionURL Dark + { + get + { + InitializeProperty("dark", _dark); + return _dark; + } + set + { + _dark = value; + } + } // Property Definition + private int _size; /// /// The size of the icons /// [JsonPropertyName("size")] - public int Size { get; set; } + public int Size + { + get + { + InitializeProperty("size", _size); + return _size; + } + set + { + _size = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Manifest/ThemeManifest.cs b/src/WebExtension.Net/Generated/Manifest/ThemeManifest.cs index 96fc49f..6ff5285 100644 --- a/src/WebExtension.Net/Generated/Manifest/ThemeManifest.cs +++ b/src/WebExtension.Net/Generated/Manifest/ThemeManifest.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,43 +10,103 @@ namespace WebExtension.Net.Manifest /// /// Contents of manifest.json for a static theme /// - public class ThemeManifest + public class ThemeManifest : BaseObject { // Property Definition + private ThemeType _theme; /// /// /// [JsonPropertyName("theme")] - public ThemeType Theme { get; set; } + public ThemeType Theme + { + get + { + InitializeProperty("theme", _theme); + return _theme; + } + set + { + _theme = value; + } + } // Property Definition + private ThemeType _dark_theme; /// /// /// [JsonPropertyName("dark_theme")] - public ThemeType Dark_theme { get; set; } + public ThemeType Dark_theme + { + get + { + InitializeProperty("dark_theme", _dark_theme); + return _dark_theme; + } + set + { + _dark_theme = value; + } + } // Property Definition + private string _default_locale; /// /// /// [JsonPropertyName("default_locale")] - public string Default_locale { get; set; } + public string Default_locale + { + get + { + InitializeProperty("default_locale", _default_locale); + return _default_locale; + } + set + { + _default_locale = value; + } + } // Property Definition + private ThemeExperiment _theme_experiment; /// /// /// [JsonPropertyName("theme_experiment")] - public ThemeExperiment Theme_experiment { get; set; } + public ThemeExperiment Theme_experiment + { + get + { + InitializeProperty("theme_experiment", _theme_experiment); + return _theme_experiment; + } + set + { + _theme_experiment = value; + } + } // Property Definition + private object _icons; /// /// /// [JsonPropertyName("icons")] - public object Icons { get; set; } + public object Icons + { + get + { + InitializeProperty("icons", _icons); + return _icons; + } + set + { + _icons = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Manifest/ThemeType.cs b/src/WebExtension.Net/Generated/Manifest/ThemeType.cs index e9854c0..1c709e0 100644 --- a/src/WebExtension.Net/Generated/Manifest/ThemeType.cs +++ b/src/WebExtension.Net/Generated/Manifest/ThemeType.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,29 +10,65 @@ namespace WebExtension.Net.Manifest /// /// /// - public class ThemeType + public class ThemeType : BaseObject { // Property Definition + private object _images; /// /// /// [JsonPropertyName("images")] - public object Images { get; set; } + public object Images + { + get + { + InitializeProperty("images", _images); + return _images; + } + set + { + _images = value; + } + } // Property Definition + private object _colors; /// /// /// [JsonPropertyName("colors")] - public object Colors { get; set; } + public object Colors + { + get + { + InitializeProperty("colors", _colors); + return _colors; + } + set + { + _colors = value; + } + } // Property Definition + private object _properties; /// /// /// [JsonPropertyName("properties")] - public object Properties { get; set; } + public object Properties + { + get + { + InitializeProperty("properties", _properties); + return _properties; + } + set + { + _properties = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Manifest/WebExtensionDictionaryManifest.cs b/src/WebExtension.Net/Generated/Manifest/WebExtensionDictionaryManifest.cs index 24c9262..9ef0a26 100644 --- a/src/WebExtension.Net/Generated/Manifest/WebExtensionDictionaryManifest.cs +++ b/src/WebExtension.Net/Generated/Manifest/WebExtensionDictionaryManifest.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,22 +10,46 @@ namespace WebExtension.Net.Manifest /// /// Represents a WebExtension dictionary manifest.json file /// - public class WebExtensionDictionaryManifest + public class WebExtensionDictionaryManifest : BaseObject { // Property Definition + private string _homepage_url; /// /// /// [JsonPropertyName("homepage_url")] - public string Homepage_url { get; set; } + public string Homepage_url + { + get + { + InitializeProperty("homepage_url", _homepage_url); + return _homepage_url; + } + set + { + _homepage_url = value; + } + } // Property Definition + private object _dictionaries; /// /// /// [JsonPropertyName("dictionaries")] - public object Dictionaries { get; set; } + public object Dictionaries + { + get + { + InitializeProperty("dictionaries", _dictionaries); + return _dictionaries; + } + set + { + _dictionaries = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Manifest/WebExtensionLangpackManifest.cs b/src/WebExtension.Net/Generated/Manifest/WebExtensionLangpackManifest.cs index debc435..c4e86c3 100644 --- a/src/WebExtension.Net/Generated/Manifest/WebExtensionLangpackManifest.cs +++ b/src/WebExtension.Net/Generated/Manifest/WebExtensionLangpackManifest.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,36 +10,84 @@ namespace WebExtension.Net.Manifest /// /// Represents a WebExtension language pack manifest.json file /// - public class WebExtensionLangpackManifest + public class WebExtensionLangpackManifest : BaseObject { // Property Definition + private string _homepage_url; /// /// /// [JsonPropertyName("homepage_url")] - public string Homepage_url { get; set; } + public string Homepage_url + { + get + { + InitializeProperty("homepage_url", _homepage_url); + return _homepage_url; + } + set + { + _homepage_url = value; + } + } // Property Definition + private string _langpack_id; /// /// /// [JsonPropertyName("langpack_id")] - public string Langpack_id { get; set; } + public string Langpack_id + { + get + { + InitializeProperty("langpack_id", _langpack_id); + return _langpack_id; + } + set + { + _langpack_id = value; + } + } // Property Definition + private object _languages; /// /// /// [JsonPropertyName("languages")] - public object Languages { get; set; } + public object Languages + { + get + { + InitializeProperty("languages", _languages); + return _languages; + } + set + { + _languages = value; + } + } // Property Definition + private object _sources; /// /// /// [JsonPropertyName("sources")] - public object Sources { get; set; } + public object Sources + { + get + { + InitializeProperty("sources", _sources); + return _sources; + } + set + { + _sources = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Manifest/WebExtensionManifest.cs b/src/WebExtension.Net/Generated/Manifest/WebExtensionManifest.cs index ae2e4ce..a8090ab 100644 --- a/src/WebExtension.Net/Generated/Manifest/WebExtensionManifest.cs +++ b/src/WebExtension.Net/Generated/Manifest/WebExtensionManifest.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,204 +10,540 @@ namespace WebExtension.Net.Manifest /// /// Represents a WebExtension manifest.json file /// - public class WebExtensionManifest + public class WebExtensionManifest : BaseObject { // Property Definition + private string _minimum_chrome_version; /// /// /// [JsonPropertyName("minimum_chrome_version")] - public string Minimum_chrome_version { get; set; } + public string Minimum_chrome_version + { + get + { + InitializeProperty("minimum_chrome_version", _minimum_chrome_version); + return _minimum_chrome_version; + } + set + { + _minimum_chrome_version = value; + } + } // Property Definition + private string _minimum_opera_version; /// /// /// [JsonPropertyName("minimum_opera_version")] - public string Minimum_opera_version { get; set; } + public string Minimum_opera_version + { + get + { + InitializeProperty("minimum_opera_version", _minimum_opera_version); + return _minimum_opera_version; + } + set + { + _minimum_opera_version = value; + } + } // Property Definition + private object _icons; /// /// /// [JsonPropertyName("icons")] - public object Icons { get; set; } + public object Icons + { + get + { + InitializeProperty("icons", _icons); + return _icons; + } + set + { + _icons = value; + } + } // Property Definition + private string _incognito; /// /// /// [JsonPropertyName("incognito")] - public string Incognito { get; set; } + public string Incognito + { + get + { + InitializeProperty("incognito", _incognito); + return _incognito; + } + set + { + _incognito = value; + } + } // Property Definition + private object _background; /// /// /// [JsonPropertyName("background")] - public object Background { get; set; } + public object Background + { + get + { + InitializeProperty("background", _background); + return _background; + } + set + { + _background = value; + } + } // Property Definition + private object _options_ui; /// /// /// [JsonPropertyName("options_ui")] - public object Options_ui { get; set; } + public object Options_ui + { + get + { + InitializeProperty("options_ui", _options_ui); + return _options_ui; + } + set + { + _options_ui = value; + } + } // Property Definition + private IEnumerable _content_scripts; /// /// /// [JsonPropertyName("content_scripts")] - public IEnumerable Content_scripts { get; set; } + public IEnumerable Content_scripts + { + get + { + InitializeProperty("content_scripts", _content_scripts); + return _content_scripts; + } + set + { + _content_scripts = value; + } + } // Property Definition + private object _content_security_policy; /// /// /// [JsonPropertyName("content_security_policy")] - public object Content_security_policy { get; set; } + public object Content_security_policy + { + get + { + InitializeProperty("content_security_policy", _content_security_policy); + return _content_security_policy; + } + set + { + _content_security_policy = value; + } + } // Property Definition + private IEnumerable _permissions; /// /// /// [JsonPropertyName("permissions")] - public IEnumerable Permissions { get; set; } + public IEnumerable Permissions + { + get + { + InitializeProperty("permissions", _permissions); + return _permissions; + } + set + { + _permissions = value; + } + } // Property Definition + private IEnumerable _optional_permissions; /// /// /// [JsonPropertyName("optional_permissions")] - public IEnumerable Optional_permissions { get; set; } + public IEnumerable Optional_permissions + { + get + { + InitializeProperty("optional_permissions", _optional_permissions); + return _optional_permissions; + } + set + { + _optional_permissions = value; + } + } // Property Definition + private IEnumerable _web_accessible_resources; /// /// /// [JsonPropertyName("web_accessible_resources")] - public IEnumerable Web_accessible_resources { get; set; } + public IEnumerable Web_accessible_resources + { + get + { + InitializeProperty("web_accessible_resources", _web_accessible_resources); + return _web_accessible_resources; + } + set + { + _web_accessible_resources = value; + } + } // Property Definition + private object _developer; /// /// /// [JsonPropertyName("developer")] - public object Developer { get; set; } + public object Developer + { + get + { + InitializeProperty("developer", _developer); + return _developer; + } + set + { + _developer = value; + } + } // Property Definition + private bool? _hidden; /// /// /// [JsonPropertyName("hidden")] - public bool? Hidden { get; set; } + public bool? Hidden + { + get + { + InitializeProperty("hidden", _hidden); + return _hidden; + } + set + { + _hidden = value; + } + } + + // Property Definition + private object _experiment_apis; + /// + /// + /// + [JsonPropertyName("experiment_apis")] + public object Experiment_apis + { + get + { + InitializeProperty("experiment_apis", _experiment_apis); + return _experiment_apis; + } + set + { + _experiment_apis = value; + } + } // Property Definition + private ThemeExperiment _theme_experiment; /// /// /// [JsonPropertyName("theme_experiment")] - public ThemeExperiment Theme_experiment { get; set; } + public ThemeExperiment Theme_experiment + { + get + { + InitializeProperty("theme_experiment", _theme_experiment); + return _theme_experiment; + } + set + { + _theme_experiment = value; + } + } // Property Definition + private object _sidebar_action; /// /// /// [JsonPropertyName("sidebar_action")] - public object Sidebar_action { get; set; } + public object Sidebar_action + { + get + { + InitializeProperty("sidebar_action", _sidebar_action); + return _sidebar_action; + } + set + { + _sidebar_action = value; + } + } // Property Definition + private object _chrome_settings_overrides; /// /// /// - [JsonPropertyName("experiment_apis")] - public object Experiment_apis { get; set; } + [JsonPropertyName("chrome_settings_overrides")] + public object Chrome_settings_overrides + { + get + { + InitializeProperty("chrome_settings_overrides", _chrome_settings_overrides); + return _chrome_settings_overrides; + } + set + { + _chrome_settings_overrides = value; + } + } // Property Definition + private object _commands; /// /// /// [JsonPropertyName("commands")] - public object Commands { get; set; } + public object Commands + { + get + { + InitializeProperty("commands", _commands); + return _commands; + } + set + { + _commands = value; + } + } // Property Definition + private object _user_scripts; /// /// /// - [JsonPropertyName("browser_action")] - public object Browser_action { get; set; } + [JsonPropertyName("user_scripts")] + public object User_scripts + { + get + { + InitializeProperty("user_scripts", _user_scripts); + return _user_scripts; + } + set + { + _user_scripts = value; + } + } // Property Definition + private IEnumerable _protocol_handlers; /// /// A list of protocol handler definitions. /// [JsonPropertyName("protocol_handlers")] - public IEnumerable Protocol_handlers { get; set; } + public IEnumerable Protocol_handlers + { + get + { + InitializeProperty("protocol_handlers", _protocol_handlers); + return _protocol_handlers; + } + set + { + _protocol_handlers = value; + } + } // Property Definition + private ExtensionURL _devtools_page; /// /// /// [JsonPropertyName("devtools_page")] - public ExtensionURL Devtools_page { get; set; } + public ExtensionURL Devtools_page + { + get + { + InitializeProperty("devtools_page", _devtools_page); + return _devtools_page; + } + set + { + _devtools_page = value; + } + } // Property Definition + private object _omnibox; /// /// /// - [JsonPropertyName("chrome_settings_overrides")] - public object Chrome_settings_overrides { get; set; } - - // Property Definition - /// - /// - /// - [JsonPropertyName("page_action")] - public object Page_action { get; set; } + [JsonPropertyName("omnibox")] + public object Omnibox + { + get + { + InitializeProperty("omnibox", _omnibox); + return _omnibox; + } + set + { + _omnibox = value; + } + } // Property Definition + private object _chrome_url_overrides; /// /// /// [JsonPropertyName("chrome_url_overrides")] - public object Chrome_url_overrides { get; set; } + public object Chrome_url_overrides + { + get + { + InitializeProperty("chrome_url_overrides", _chrome_url_overrides); + return _chrome_url_overrides; + } + set + { + _chrome_url_overrides = value; + } + } // Property Definition + private object _browser_action; /// /// /// - [JsonPropertyName("user_scripts")] - public object User_scripts { get; set; } + [JsonPropertyName("browser_action")] + public object Browser_action + { + get + { + InitializeProperty("browser_action", _browser_action); + return _browser_action; + } + set + { + _browser_action = value; + } + } // Property Definition + private string _default_locale; /// /// /// - [JsonPropertyName("omnibox")] - public object Omnibox { get; set; } + [JsonPropertyName("default_locale")] + public string Default_locale + { + get + { + InitializeProperty("default_locale", _default_locale); + return _default_locale; + } + set + { + _default_locale = value; + } + } // Property Definition + private IEnumerable _l10n_resources; /// /// /// - [JsonPropertyName("default_locale")] - public string Default_locale { get; set; } + [JsonPropertyName("l10n_resources")] + public IEnumerable L10n_resources + { + get + { + InitializeProperty("l10n_resources", _l10n_resources); + return _l10n_resources; + } + set + { + _l10n_resources = value; + } + } // Property Definition + private object _telemetry; /// /// /// - [JsonPropertyName("l10n_resources")] - public IEnumerable L10n_resources { get; set; } + [JsonPropertyName("telemetry")] + public object Telemetry + { + get + { + InitializeProperty("telemetry", _telemetry); + return _telemetry; + } + set + { + _telemetry = value; + } + } // Property Definition + private object _page_action; /// /// /// - [JsonPropertyName("telemetry")] - public object Telemetry { get; set; } + [JsonPropertyName("page_action")] + public object Page_action + { + get + { + InitializeProperty("page_action", _page_action); + return _page_action; + } + set + { + _page_action = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Manifest/generated.txt b/src/WebExtension.Net/Generated/Manifest/generated.txt index e69de29..a7fc8fc 100644 --- a/src/WebExtension.Net/Generated/Manifest/generated.txt +++ b/src/WebExtension.Net/Generated/Manifest/generated.txt @@ -0,0 +1 @@ +This file is auto generated at 2021-03-26T07:08:47 \ No newline at end of file diff --git a/src/WebExtension.Net/Generated/Notifications/CreateNotificationOptions.cs b/src/WebExtension.Net/Generated/Notifications/CreateNotificationOptions.cs index 75c9e39..265451b 100644 --- a/src/WebExtension.Net/Generated/Notifications/CreateNotificationOptions.cs +++ b/src/WebExtension.Net/Generated/Notifications/CreateNotificationOptions.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,92 +10,236 @@ namespace WebExtension.Net.Notifications /// /// /// - public class CreateNotificationOptions + public class CreateNotificationOptions : BaseObject { // Property Definition + private TemplateType _type; /// /// Which type of notification to display. /// [JsonPropertyName("type")] - public TemplateType Type { get; set; } + public TemplateType Type + { + get + { + InitializeProperty("type", _type); + return _type; + } + set + { + _type = value; + } + } // Property Definition + private string _iconUrl; /// /// A URL to the sender's avatar, app icon, or a thumbnail for image notifications. /// [JsonPropertyName("iconUrl")] - public string IconUrl { get; set; } + public string IconUrl + { + get + { + InitializeProperty("iconUrl", _iconUrl); + return _iconUrl; + } + set + { + _iconUrl = value; + } + } // Property Definition + private string _appIconMaskUrl; /// /// A URL to the app icon mask. /// [JsonPropertyName("appIconMaskUrl")] - public string AppIconMaskUrl { get; set; } + public string AppIconMaskUrl + { + get + { + InitializeProperty("appIconMaskUrl", _appIconMaskUrl); + return _appIconMaskUrl; + } + set + { + _appIconMaskUrl = value; + } + } // Property Definition + private string _title; /// /// Title of the notification (e.g. sender name for email). /// [JsonPropertyName("title")] - public string Title { get; set; } + public string Title + { + get + { + InitializeProperty("title", _title); + return _title; + } + set + { + _title = value; + } + } // Property Definition + private string _message; /// /// Main notification content. /// [JsonPropertyName("message")] - public string Message { get; set; } + public string Message + { + get + { + InitializeProperty("message", _message); + return _message; + } + set + { + _message = value; + } + } // Property Definition + private string _contextMessage; /// /// Alternate notification content with a lower-weight font. /// [JsonPropertyName("contextMessage")] - public string ContextMessage { get; set; } + public string ContextMessage + { + get + { + InitializeProperty("contextMessage", _contextMessage); + return _contextMessage; + } + set + { + _contextMessage = value; + } + } // Property Definition + private int? _priority; /// /// Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default. /// [JsonPropertyName("priority")] - public int? Priority { get; set; } + public int? Priority + { + get + { + InitializeProperty("priority", _priority); + return _priority; + } + set + { + _priority = value; + } + } // Property Definition + private double? _eventTime; /// /// A timestamp associated with the notification, in milliseconds past the epoch. /// [JsonPropertyName("eventTime")] - public double? EventTime { get; set; } + public double? EventTime + { + get + { + InitializeProperty("eventTime", _eventTime); + return _eventTime; + } + set + { + _eventTime = value; + } + } // Property Definition + private string _imageUrl; /// /// A URL to the image thumbnail for image-type notifications. /// [JsonPropertyName("imageUrl")] - public string ImageUrl { get; set; } + public string ImageUrl + { + get + { + InitializeProperty("imageUrl", _imageUrl); + return _imageUrl; + } + set + { + _imageUrl = value; + } + } // Property Definition + private IEnumerable _items; /// /// Items for multi-item notifications. /// [JsonPropertyName("items")] - public IEnumerable Items { get; set; } + public IEnumerable Items + { + get + { + InitializeProperty("items", _items); + return _items; + } + set + { + _items = value; + } + } // Property Definition + private int? _progress; /// /// Current progress ranges from 0 to 100. /// [JsonPropertyName("progress")] - public int? Progress { get; set; } + public int? Progress + { + get + { + InitializeProperty("progress", _progress); + return _progress; + } + set + { + _progress = value; + } + } // Property Definition + private bool? _isClickable; /// /// Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification. /// [JsonPropertyName("isClickable")] - public bool? IsClickable { get; set; } + public bool? IsClickable + { + get + { + InitializeProperty("isClickable", _isClickable); + return _isClickable; + } + set + { + _isClickable = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Notifications/INotificationsAPI.cs b/src/WebExtension.Net/Generated/Notifications/INotificationsAPI.cs index c928f0c..859ff0c 100644 --- a/src/WebExtension.Net/Generated/Notifications/INotificationsAPI.cs +++ b/src/WebExtension.Net/Generated/Notifications/INotificationsAPI.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -13,6 +11,8 @@ namespace WebExtension.Net.Notifications public interface INotificationsAPI { + + // Function Definition Interface /// /// Creates and displays a notification. diff --git a/src/WebExtension.Net/Generated/Notifications/NotificationItem.cs b/src/WebExtension.Net/Generated/Notifications/NotificationItem.cs index 07e95e4..6eb1f5f 100644 --- a/src/WebExtension.Net/Generated/Notifications/NotificationItem.cs +++ b/src/WebExtension.Net/Generated/Notifications/NotificationItem.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,22 +10,46 @@ namespace WebExtension.Net.Notifications /// /// /// - public class NotificationItem + public class NotificationItem : BaseObject { // Property Definition + private string _title; /// /// Title of one item of a list notification. /// [JsonPropertyName("title")] - public string Title { get; set; } + public string Title + { + get + { + InitializeProperty("title", _title); + return _title; + } + set + { + _title = value; + } + } // Property Definition + private string _message; /// /// Additional details about this item. /// [JsonPropertyName("message")] - public string Message { get; set; } + public string Message + { + get + { + InitializeProperty("message", _message); + return _message; + } + set + { + _message = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Notifications/Notifications.json b/src/WebExtension.Net/Generated/Notifications/Notifications.json index 79e4f8e..306ed4a 100644 --- a/src/WebExtension.Net/Generated/Notifications/Notifications.json +++ b/src/WebExtension.Net/Generated/Notifications/Notifications.json @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - [ { "namespace": "notifications", diff --git a/src/WebExtension.Net/Generated/Notifications/NotificationsAPI.cs b/src/WebExtension.Net/Generated/Notifications/NotificationsAPI.cs index 076686d..3959e02 100644 --- a/src/WebExtension.Net/Generated/Notifications/NotificationsAPI.cs +++ b/src/WebExtension.Net/Generated/Notifications/NotificationsAPI.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -8,17 +6,17 @@ namespace WebExtension.Net.Notifications { /// - public class NotificationsAPI : INotificationsAPI + public class NotificationsAPI : BaseAPI, INotificationsAPI { - private readonly WebExtensionJSRuntime webExtensionJSRuntime; /// Creates a new instance of NotificationsAPI. /// Web Extension JS Runtime - public NotificationsAPI(WebExtensionJSRuntime webExtensionJSRuntime) + public NotificationsAPI(WebExtensionJSRuntime webExtensionJSRuntime) : base(webExtensionJSRuntime, "notifications") { - this.webExtensionJSRuntime = webExtensionJSRuntime; } + + // Function Definition /// /// Creates and displays a notification. @@ -28,7 +26,7 @@ public NotificationsAPI(WebExtensionJSRuntime webExtensionJSRuntime) /// public virtual ValueTask Create(string notificationId, CreateNotificationOptions options) { - return webExtensionJSRuntime.InvokeAsync("notifications.create", notificationId, options); + return InvokeAsync("create", notificationId, options); } // Function Definition @@ -39,7 +37,7 @@ public virtual ValueTask Create(string notificationId, CreateNotificatio /// public virtual ValueTask Clear(string notificationId) { - return webExtensionJSRuntime.InvokeAsync("notifications.clear", notificationId); + return InvokeAsync("clear", notificationId); } // Function Definition @@ -49,7 +47,7 @@ public virtual ValueTask Clear(string notificationId) /// public virtual ValueTask GetAll() { - return webExtensionJSRuntime.InvokeAsync("notifications.getAll"); + return InvokeAsync("getAll"); } } } diff --git a/src/WebExtension.Net/Generated/Notifications/PermissionLevel.cs b/src/WebExtension.Net/Generated/Notifications/PermissionLevel.cs index 2e2e6de..ec7c6c3 100644 --- a/src/WebExtension.Net/Generated/Notifications/PermissionLevel.cs +++ b/src/WebExtension.Net/Generated/Notifications/PermissionLevel.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Notifications/TemplateType.cs b/src/WebExtension.Net/Generated/Notifications/TemplateType.cs index 4373bcc..f5dec6f 100644 --- a/src/WebExtension.Net/Generated/Notifications/TemplateType.cs +++ b/src/WebExtension.Net/Generated/Notifications/TemplateType.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Notifications/UpdateNotificationOptions.cs b/src/WebExtension.Net/Generated/Notifications/UpdateNotificationOptions.cs index 1c5cc78..eeab5bf 100644 --- a/src/WebExtension.Net/Generated/Notifications/UpdateNotificationOptions.cs +++ b/src/WebExtension.Net/Generated/Notifications/UpdateNotificationOptions.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,92 +10,236 @@ namespace WebExtension.Net.Notifications /// /// /// - public class UpdateNotificationOptions + public class UpdateNotificationOptions : BaseObject { // Property Definition + private TemplateType _type; /// /// Which type of notification to display. /// [JsonPropertyName("type")] - public TemplateType Type { get; set; } + public TemplateType Type + { + get + { + InitializeProperty("type", _type); + return _type; + } + set + { + _type = value; + } + } // Property Definition + private string _iconUrl; /// /// A URL to the sender's avatar, app icon, or a thumbnail for image notifications. /// [JsonPropertyName("iconUrl")] - public string IconUrl { get; set; } + public string IconUrl + { + get + { + InitializeProperty("iconUrl", _iconUrl); + return _iconUrl; + } + set + { + _iconUrl = value; + } + } // Property Definition + private string _appIconMaskUrl; /// /// A URL to the app icon mask. /// [JsonPropertyName("appIconMaskUrl")] - public string AppIconMaskUrl { get; set; } + public string AppIconMaskUrl + { + get + { + InitializeProperty("appIconMaskUrl", _appIconMaskUrl); + return _appIconMaskUrl; + } + set + { + _appIconMaskUrl = value; + } + } // Property Definition + private string _title; /// /// Title of the notification (e.g. sender name for email). /// [JsonPropertyName("title")] - public string Title { get; set; } + public string Title + { + get + { + InitializeProperty("title", _title); + return _title; + } + set + { + _title = value; + } + } // Property Definition + private string _message; /// /// Main notification content. /// [JsonPropertyName("message")] - public string Message { get; set; } + public string Message + { + get + { + InitializeProperty("message", _message); + return _message; + } + set + { + _message = value; + } + } // Property Definition + private string _contextMessage; /// /// Alternate notification content with a lower-weight font. /// [JsonPropertyName("contextMessage")] - public string ContextMessage { get; set; } + public string ContextMessage + { + get + { + InitializeProperty("contextMessage", _contextMessage); + return _contextMessage; + } + set + { + _contextMessage = value; + } + } // Property Definition + private int? _priority; /// /// Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default. /// [JsonPropertyName("priority")] - public int? Priority { get; set; } + public int? Priority + { + get + { + InitializeProperty("priority", _priority); + return _priority; + } + set + { + _priority = value; + } + } // Property Definition + private double? _eventTime; /// /// A timestamp associated with the notification, in milliseconds past the epoch. /// [JsonPropertyName("eventTime")] - public double? EventTime { get; set; } + public double? EventTime + { + get + { + InitializeProperty("eventTime", _eventTime); + return _eventTime; + } + set + { + _eventTime = value; + } + } // Property Definition + private string _imageUrl; /// /// A URL to the image thumbnail for image-type notifications. /// [JsonPropertyName("imageUrl")] - public string ImageUrl { get; set; } + public string ImageUrl + { + get + { + InitializeProperty("imageUrl", _imageUrl); + return _imageUrl; + } + set + { + _imageUrl = value; + } + } // Property Definition + private IEnumerable _items; /// /// Items for multi-item notifications. /// [JsonPropertyName("items")] - public IEnumerable Items { get; set; } + public IEnumerable Items + { + get + { + InitializeProperty("items", _items); + return _items; + } + set + { + _items = value; + } + } // Property Definition + private int? _progress; /// /// Current progress ranges from 0 to 100. /// [JsonPropertyName("progress")] - public int? Progress { get; set; } + public int? Progress + { + get + { + InitializeProperty("progress", _progress); + return _progress; + } + set + { + _progress = value; + } + } // Property Definition + private bool? _isClickable; /// /// Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification. /// [JsonPropertyName("isClickable")] - public bool? IsClickable { get; set; } + public bool? IsClickable + { + get + { + InitializeProperty("isClickable", _isClickable); + return _isClickable; + } + set + { + _isClickable = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Notifications/generated.txt b/src/WebExtension.Net/Generated/Notifications/generated.txt index e69de29..4c440f6 100644 --- a/src/WebExtension.Net/Generated/Notifications/generated.txt +++ b/src/WebExtension.Net/Generated/Notifications/generated.txt @@ -0,0 +1 @@ +This file is auto generated at 2021-03-26T07:08:48 \ No newline at end of file diff --git a/src/WebExtension.Net/Generated/Runtime/BrowserInfo.cs b/src/WebExtension.Net/Generated/Runtime/BrowserInfo.cs index ceaea4b..97166c9 100644 --- a/src/WebExtension.Net/Generated/Runtime/BrowserInfo.cs +++ b/src/WebExtension.Net/Generated/Runtime/BrowserInfo.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,36 +10,84 @@ namespace WebExtension.Net.Runtime /// /// An object containing information about the current browser. /// - public class BrowserInfo + public class BrowserInfo : BaseObject { // Property Definition + private string _name; /// /// The name of the browser, for example 'Firefox'. /// [JsonPropertyName("name")] - public string Name { get; set; } + public string Name + { + get + { + InitializeProperty("name", _name); + return _name; + } + set + { + _name = value; + } + } // Property Definition + private string _vendor; /// /// The name of the browser vendor, for example 'Mozilla'. /// [JsonPropertyName("vendor")] - public string Vendor { get; set; } + public string Vendor + { + get + { + InitializeProperty("vendor", _vendor); + return _vendor; + } + set + { + _vendor = value; + } + } // Property Definition + private string _version; /// /// The browser's version, for example '42.0.0' or '0.8.1pre'. /// [JsonPropertyName("version")] - public string Version { get; set; } + public string Version + { + get + { + InitializeProperty("version", _version); + return _version; + } + set + { + _version = value; + } + } // Property Definition + private string _buildID; /// /// The browser's build ID/date, for example '20160101'. /// [JsonPropertyName("buildID")] - public string BuildID { get; set; } + public string BuildID + { + get + { + InitializeProperty("buildID", _buildID); + return _buildID; + } + set + { + _buildID = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Runtime/IRuntimeAPI.cs b/src/WebExtension.Net/Generated/Runtime/IRuntimeAPI.cs index dc3a1e5..91ce59f 100644 --- a/src/WebExtension.Net/Generated/Runtime/IRuntimeAPI.cs +++ b/src/WebExtension.Net/Generated/Runtime/IRuntimeAPI.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -13,6 +11,21 @@ namespace WebExtension.Net.Runtime public interface IRuntimeAPI { + + // Property Getter Function Definition Interface + /// + /// This will be defined during an API method callback if there was an error + /// + /// + ValueTask GetLastError(); + + // Property Getter Function Definition Interface + /// + /// The ID of the extension/app. + /// + /// + ValueTask GetId(); + // Function Definition Interface /// /// Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set. diff --git a/src/WebExtension.Net/Generated/Runtime/MessageSender.cs b/src/WebExtension.Net/Generated/Runtime/MessageSender.cs index 259cfd8..0bb0ca5 100644 --- a/src/WebExtension.Net/Generated/Runtime/MessageSender.cs +++ b/src/WebExtension.Net/Generated/Runtime/MessageSender.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,36 +10,84 @@ namespace WebExtension.Net.Runtime /// /// An object containing information about the script context that sent a message or request. /// - public class MessageSender + public class MessageSender : BaseObject { // Property Definition + private Tabs.Tab _tab; /// /// The $(ref:tabs.Tab) which opened the connection, if any. This property will only be present when the connection was opened from a tab (including content scripts), and only if the receiver is an extension, not an app. /// [JsonPropertyName("tab")] - public Tabs.Tab Tab { get; set; } + public Tabs.Tab Tab + { + get + { + InitializeProperty("tab", _tab); + return _tab; + } + set + { + _tab = value; + } + } // Property Definition + private int? _frameId; /// /// 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")] - public int? FrameId { get; set; } + public int? FrameId + { + get + { + InitializeProperty("frameId", _frameId); + return _frameId; + } + set + { + _frameId = value; + } + } // Property Definition + private string _id; /// /// The ID of the extension or app that opened the connection, if any. /// [JsonPropertyName("id")] - public string Id { get; set; } + public string Id + { + get + { + InitializeProperty("id", _id); + return _id; + } + set + { + _id = value; + } + } // Property Definition + private string _url; /// /// 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")] - public string Url { get; set; } + public string Url + { + get + { + InitializeProperty("url", _url); + return _url; + } + set + { + _url = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Runtime/OnInstalledReason.cs b/src/WebExtension.Net/Generated/Runtime/OnInstalledReason.cs index 109b820..f4fea70 100644 --- a/src/WebExtension.Net/Generated/Runtime/OnInstalledReason.cs +++ b/src/WebExtension.Net/Generated/Runtime/OnInstalledReason.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Runtime/OnRestartRequiredReason.cs b/src/WebExtension.Net/Generated/Runtime/OnRestartRequiredReason.cs index 7c6045e..4f34cf2 100644 --- a/src/WebExtension.Net/Generated/Runtime/OnRestartRequiredReason.cs +++ b/src/WebExtension.Net/Generated/Runtime/OnRestartRequiredReason.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Runtime/PlatformArch.cs b/src/WebExtension.Net/Generated/Runtime/PlatformArch.cs index 315e48d..2428b6a 100644 --- a/src/WebExtension.Net/Generated/Runtime/PlatformArch.cs +++ b/src/WebExtension.Net/Generated/Runtime/PlatformArch.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Runtime/PlatformInfo.cs b/src/WebExtension.Net/Generated/Runtime/PlatformInfo.cs index c5eee23..256e30f 100644 --- a/src/WebExtension.Net/Generated/Runtime/PlatformInfo.cs +++ b/src/WebExtension.Net/Generated/Runtime/PlatformInfo.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,22 +10,46 @@ namespace WebExtension.Net.Runtime /// /// An object containing information about the current platform. /// - public class PlatformInfo + public class PlatformInfo : BaseObject { // Property Definition + private PlatformOs _os; /// /// The operating system the browser is running on. /// [JsonPropertyName("os")] - public PlatformOs Os { get; set; } + public PlatformOs Os + { + get + { + InitializeProperty("os", _os); + return _os; + } + set + { + _os = value; + } + } // Property Definition + private PlatformArch _arch; /// /// The machine's processor architecture. /// [JsonPropertyName("arch")] - public PlatformArch Arch { get; set; } + public PlatformArch Arch + { + get + { + InitializeProperty("arch", _arch); + return _arch; + } + set + { + _arch = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Runtime/PlatformOs.cs b/src/WebExtension.Net/Generated/Runtime/PlatformOs.cs index f32dd33..4b0d244 100644 --- a/src/WebExtension.Net/Generated/Runtime/PlatformOs.cs +++ b/src/WebExtension.Net/Generated/Runtime/PlatformOs.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Runtime/Port.cs b/src/WebExtension.Net/Generated/Runtime/Port.cs index f960ac9..6f74352 100644 --- a/src/WebExtension.Net/Generated/Runtime/Port.cs +++ b/src/WebExtension.Net/Generated/Runtime/Port.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,50 +10,122 @@ namespace WebExtension.Net.Runtime /// /// An object which allows two way communication with other pages. /// - public class Port + public class Port : BaseObject { // Property Definition + private string _name; /// /// /// [JsonPropertyName("name")] - public string Name { get; set; } + public string Name + { + get + { + InitializeProperty("name", _name); + return _name; + } + set + { + _name = value; + } + } // Property Definition + private Action _disconnect; /// /// /// [JsonPropertyName("disconnect")] - public Action Disconnect { get; set; } + public Action Disconnect + { + get + { + InitializeProperty("disconnect", _disconnect); + return _disconnect; + } + set + { + _disconnect = value; + } + } // Property Definition + private Events.Event _onDisconnect; /// /// /// [JsonPropertyName("onDisconnect")] - public Events.Event OnDisconnect { get; set; } + public Events.Event OnDisconnect + { + get + { + InitializeProperty("onDisconnect", _onDisconnect); + return _onDisconnect; + } + set + { + _onDisconnect = value; + } + } // Property Definition + private Events.Event _onMessage; /// /// /// [JsonPropertyName("onMessage")] - public Events.Event OnMessage { get; set; } + public Events.Event OnMessage + { + get + { + InitializeProperty("onMessage", _onMessage); + return _onMessage; + } + set + { + _onMessage = value; + } + } // Property Definition + private Action _postMessage; /// /// /// [JsonPropertyName("postMessage")] - public Action PostMessage { get; set; } + public Action PostMessage + { + get + { + InitializeProperty("postMessage", _postMessage); + return _postMessage; + } + set + { + _postMessage = value; + } + } // Property Definition + private MessageSender _sender; /// /// This property will only be present on ports passed to onConnect/onConnectExternal listeners. /// [JsonPropertyName("sender")] - public MessageSender Sender { get; set; } + public MessageSender Sender + { + get + { + InitializeProperty("sender", _sender); + return _sender; + } + set + { + _sender = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Runtime/RequestUpdateCheckStatus.cs b/src/WebExtension.Net/Generated/Runtime/RequestUpdateCheckStatus.cs index 84c62bf..cb7350f 100644 --- a/src/WebExtension.Net/Generated/Runtime/RequestUpdateCheckStatus.cs +++ b/src/WebExtension.Net/Generated/Runtime/RequestUpdateCheckStatus.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Runtime/Runtime.json b/src/WebExtension.Net/Generated/Runtime/Runtime.json index eb75414..e4db4dd 100644 --- a/src/WebExtension.Net/Generated/Runtime/Runtime.json +++ b/src/WebExtension.Net/Generated/Runtime/Runtime.json @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - [ { "namespace": "runtime", diff --git a/src/WebExtension.Net/Generated/Runtime/RuntimeAPI.cs b/src/WebExtension.Net/Generated/Runtime/RuntimeAPI.cs index d1494c2..bf7232b 100644 --- a/src/WebExtension.Net/Generated/Runtime/RuntimeAPI.cs +++ b/src/WebExtension.Net/Generated/Runtime/RuntimeAPI.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -8,17 +6,36 @@ namespace WebExtension.Net.Runtime { /// - public class RuntimeAPI : IRuntimeAPI + public class RuntimeAPI : BaseAPI, IRuntimeAPI { - private readonly WebExtensionJSRuntime webExtensionJSRuntime; /// Creates a new instance of RuntimeAPI. /// Web Extension JS Runtime - public RuntimeAPI(WebExtensionJSRuntime webExtensionJSRuntime) + public RuntimeAPI(WebExtensionJSRuntime webExtensionJSRuntime) : base(webExtensionJSRuntime, "runtime") { - this.webExtensionJSRuntime = webExtensionJSRuntime; } + + // Property Getter Function Definition + /// + /// This will be defined during an API method callback if there was an error + /// + /// + public virtual ValueTask GetLastError() + { + return GetPropertyAsync("lastError"); + } + + // Property Getter Function Definition + /// + /// The ID of the extension/app. + /// + /// + public virtual ValueTask GetId() + { + return GetPropertyAsync("id"); + } + // Function Definition /// /// Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set. @@ -26,7 +43,7 @@ public RuntimeAPI(WebExtensionJSRuntime webExtensionJSRuntime) /// public virtual ValueTask GetBackgroundPage() { - return webExtensionJSRuntime.InvokeAsync("runtime.getBackgroundPage"); + return InvokeAsync("getBackgroundPage"); } // Function Definition @@ -35,7 +52,7 @@ public virtual ValueTask GetBackgroundPage() /// public virtual ValueTask OpenOptionsPage() { - return webExtensionJSRuntime.InvokeVoidAsync("runtime.openOptionsPage"); + return InvokeVoidAsync("openOptionsPage"); } // Function Definition @@ -45,7 +62,7 @@ public virtual ValueTask OpenOptionsPage() /// public virtual ValueTask GetManifest() { - return webExtensionJSRuntime.InvokeAsync("runtime.getManifest"); + return InvokeAsync("getManifest"); } // Function Definition @@ -56,7 +73,7 @@ public virtual ValueTask GetManifest() /// public virtual ValueTask GetURL(string path) { - return webExtensionJSRuntime.InvokeAsync("runtime.getURL", path); + return InvokeAsync("getURL", path); } // Function Definition @@ -66,7 +83,7 @@ public virtual ValueTask GetURL(string path) /// URL to be opened after the extension is uninstalled. This URL must have an http: or https: scheme. Set an empty string to not open a new tab upon uninstallation. public virtual ValueTask SetUninstallURL(string url) { - return webExtensionJSRuntime.InvokeVoidAsync("runtime.setUninstallURL", url); + return InvokeVoidAsync("setUninstallURL", url); } // Function Definition @@ -75,7 +92,7 @@ public virtual ValueTask SetUninstallURL(string url) /// public virtual ValueTask Reload() { - return webExtensionJSRuntime.InvokeVoidAsync("runtime.reload"); + return InvokeVoidAsync("reload"); } // Function Definition @@ -87,7 +104,7 @@ public virtual ValueTask Reload() /// public virtual ValueTask Connect(string extensionId, object connectInfo) { - return webExtensionJSRuntime.InvokeAsync("runtime.connect", extensionId, connectInfo); + return InvokeAsync("connect", extensionId, connectInfo); } // Function Definition @@ -98,7 +115,7 @@ public virtual ValueTask Connect(string extensionId, object connectInfo) /// public virtual ValueTask ConnectNative(string application) { - return webExtensionJSRuntime.InvokeAsync("runtime.connectNative", application); + return InvokeAsync("connectNative", application); } // Function Definition @@ -111,7 +128,7 @@ public virtual ValueTask ConnectNative(string application) /// public virtual ValueTask SendMessage(string extensionId, object message, object options, Action responseCallback) { - return webExtensionJSRuntime.InvokeVoidAsync("runtime.sendMessage", extensionId, message, options, responseCallback); + return InvokeVoidAsync("sendMessage", extensionId, message, options, responseCallback); } // Function Definition @@ -123,7 +140,7 @@ public virtual ValueTask SendMessage(string extensionId, object message, object /// public virtual ValueTask SendNativeMessage(string application, object message, Action responseCallback) { - return webExtensionJSRuntime.InvokeVoidAsync("runtime.sendNativeMessage", application, message, responseCallback); + return InvokeVoidAsync("sendNativeMessage", application, message, responseCallback); } // Function Definition @@ -133,7 +150,7 @@ public virtual ValueTask SendNativeMessage(string application, object message, A /// public virtual ValueTask GetBrowserInfo() { - return webExtensionJSRuntime.InvokeAsync("runtime.getBrowserInfo"); + return InvokeAsync("getBrowserInfo"); } // Function Definition @@ -143,7 +160,7 @@ public virtual ValueTask GetBrowserInfo() /// public virtual ValueTask GetPlatformInfo() { - return webExtensionJSRuntime.InvokeAsync("runtime.getPlatformInfo"); + return InvokeAsync("getPlatformInfo"); } } } diff --git a/src/WebExtension.Net/Generated/Runtime/generated.txt b/src/WebExtension.Net/Generated/Runtime/generated.txt index e69de29..a7fc8fc 100644 --- a/src/WebExtension.Net/Generated/Runtime/generated.txt +++ b/src/WebExtension.Net/Generated/Runtime/generated.txt @@ -0,0 +1 @@ +This file is auto generated at 2021-03-26T07:08:47 \ No newline at end of file diff --git a/src/WebExtension.Net/Generated/Storage/IStorageAPI.cs b/src/WebExtension.Net/Generated/Storage/IStorageAPI.cs new file mode 100644 index 0000000..4c3f329 --- /dev/null +++ b/src/WebExtension.Net/Generated/Storage/IStorageAPI.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading.Tasks; + +namespace WebExtension.Net.Storage +{ + /// + /// Use the browser.storage API to store, retrieve, and track changes to user data. + /// + public interface IStorageAPI + { + + + // Property Getter Function Definition Interface + /// + /// Items in the sync storage area are synced by the browser. + /// + /// + ValueTask GetSync(); + + // Property Getter Function Definition Interface + /// + /// Items in the local storage area are local to each machine. + /// + /// + ValueTask GetLocal(); + + // Property Getter Function Definition Interface + /// + /// Items in the managed storage area are set by administrators or native applications, and are read-only for the extension; trying to modify this namespace results in an error. + /// + /// + ValueTask GetManaged(); + + } +} diff --git a/src/WebExtension.Net/Generated/Storage/Storage.json b/src/WebExtension.Net/Generated/Storage/Storage.json index e312a00..6ccc69f 100644 --- a/src/WebExtension.Net/Generated/Storage/Storage.json +++ b/src/WebExtension.Net/Generated/Storage/Storage.json @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - [ { "namespace": "storage", diff --git a/src/WebExtension.Net/Generated/Storage/StorageAPI.cs b/src/WebExtension.Net/Generated/Storage/StorageAPI.cs new file mode 100644 index 0000000..c9ac945 --- /dev/null +++ b/src/WebExtension.Net/Generated/Storage/StorageAPI.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading.Tasks; + +namespace WebExtension.Net.Storage +{ + /// + public class StorageAPI : BaseAPI, IStorageAPI + { + /// Creates a new instance of StorageAPI. + /// Web Extension JS Runtime + public StorageAPI(WebExtensionJSRuntime webExtensionJSRuntime) : base(webExtensionJSRuntime, "storage") + { + } + + + + // Property Getter Function Definition + /// + /// Items in the sync storage area are synced by the browser. + /// + /// + public virtual ValueTask GetSync() + { + return GetPropertyAsync("sync"); + } + + // Property Getter Function Definition + /// + /// Items in the local storage area are local to each machine. + /// + /// + public virtual ValueTask GetLocal() + { + return GetPropertyAsync("local"); + } + + // Property Getter Function Definition + /// + /// Items in the managed storage area are set by administrators or native applications, and are read-only for the extension; trying to modify this namespace results in an error. + /// + /// + public virtual ValueTask GetManaged() + { + return GetPropertyAsync("managed"); + } + + } +} diff --git a/src/WebExtension.Net/Generated/Storage/StorageArea.cs b/src/WebExtension.Net/Generated/Storage/StorageArea.cs index b8a5bee..a455421 100644 --- a/src/WebExtension.Net/Generated/Storage/StorageArea.cs +++ b/src/WebExtension.Net/Generated/Storage/StorageArea.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -23,7 +21,7 @@ public class StorageArea : BaseObject /// public virtual ValueTask Get(string keys) { - return webExtensionJSRuntime.InvokeAsync("", keys); + return InvokeAsync("get", keys); } // Function Definition @@ -34,7 +32,7 @@ public virtual ValueTask Get(string keys) /// public virtual ValueTask Get(IEnumerable keys) { - return webExtensionJSRuntime.InvokeAsync("", keys); + return InvokeAsync("get", keys); } // Function Definition @@ -45,7 +43,7 @@ public virtual ValueTask Get(IEnumerable keys) /// public virtual ValueTask Get(object keys) { - return webExtensionJSRuntime.InvokeAsync("", keys); + return InvokeAsync("get", keys); } // Function Definition @@ -55,7 +53,7 @@ public virtual ValueTask Get(object keys) ///

An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected.

Primitive values such as numbers will serialize as expected. Values with a typeof "object" and "function" will typically serialize to {}, with the exception of Array (serializes as expected), Date, and Regex (serialize using their String representation).

public virtual ValueTask Set(object items) { - return webExtensionJSRuntime.InvokeVoidAsync("", items); + return InvokeVoidAsync("set", items); } // Function Definition @@ -65,7 +63,7 @@ public virtual ValueTask Set(object items) /// A single key or a list of keys for items to remove. public virtual ValueTask Remove(string keys) { - return webExtensionJSRuntime.InvokeVoidAsync("", keys); + return InvokeVoidAsync("remove", keys); } // Function Definition @@ -75,7 +73,7 @@ public virtual ValueTask Remove(string keys) /// A single key or a list of keys for items to remove. public virtual ValueTask Remove(IEnumerable keys) { - return webExtensionJSRuntime.InvokeVoidAsync("", keys); + return InvokeVoidAsync("remove", keys); } // Function Definition @@ -84,7 +82,7 @@ public virtual ValueTask Remove(IEnumerable keys) ///
public virtual ValueTask Clear() { - return webExtensionJSRuntime.InvokeVoidAsync(""); + return InvokeVoidAsync("clear"); } } } diff --git a/src/WebExtension.Net/Generated/Storage/StorageAreaSync.cs b/src/WebExtension.Net/Generated/Storage/StorageAreaSync.cs index d686d04..d417e25 100644 --- a/src/WebExtension.Net/Generated/Storage/StorageAreaSync.cs +++ b/src/WebExtension.Net/Generated/Storage/StorageAreaSync.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -23,7 +21,7 @@ public class StorageAreaSync : BaseObject /// public virtual ValueTask Get(string keys) { - return webExtensionJSRuntime.InvokeAsync("", keys); + return InvokeAsync("get", keys); } // Function Definition @@ -34,7 +32,7 @@ public virtual ValueTask Get(string keys) /// public virtual ValueTask Get(IEnumerable keys) { - return webExtensionJSRuntime.InvokeAsync("", keys); + return InvokeAsync("get", keys); } // Function Definition @@ -45,7 +43,7 @@ public virtual ValueTask Get(IEnumerable keys) /// public virtual ValueTask Get(object keys) { - return webExtensionJSRuntime.InvokeAsync("", keys); + return InvokeAsync("get", keys); } // Function Definition @@ -56,7 +54,7 @@ public virtual ValueTask Get(object keys) /// public virtual ValueTask GetBytesInUse(string keys) { - return webExtensionJSRuntime.InvokeAsync("", keys); + return InvokeAsync("getBytesInUse", keys); } // Function Definition @@ -67,7 +65,7 @@ public virtual ValueTask GetBytesInUse(string keys) /// public virtual ValueTask GetBytesInUse(IEnumerable keys) { - return webExtensionJSRuntime.InvokeAsync("", keys); + return InvokeAsync("getBytesInUse", keys); } // Function Definition @@ -77,7 +75,7 @@ public virtual ValueTask GetBytesInUse(IEnumerable keys) ///

An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected.

Primitive values such as numbers will serialize as expected. Values with a typeof "object" and "function" will typically serialize to {}, with the exception of Array (serializes as expected), Date, and Regex (serialize using their String representation).

public virtual ValueTask Set(object items) { - return webExtensionJSRuntime.InvokeVoidAsync("", items); + return InvokeVoidAsync("set", items); } // Function Definition @@ -87,7 +85,7 @@ public virtual ValueTask Set(object items) /// A single key or a list of keys for items to remove. public virtual ValueTask Remove(string keys) { - return webExtensionJSRuntime.InvokeVoidAsync("", keys); + return InvokeVoidAsync("remove", keys); } // Function Definition @@ -97,7 +95,7 @@ public virtual ValueTask Remove(string keys) /// A single key or a list of keys for items to remove. public virtual ValueTask Remove(IEnumerable keys) { - return webExtensionJSRuntime.InvokeVoidAsync("", keys); + return InvokeVoidAsync("remove", keys); } // Function Definition @@ -106,7 +104,7 @@ public virtual ValueTask Remove(IEnumerable keys) ///
public virtual ValueTask Clear() { - return webExtensionJSRuntime.InvokeVoidAsync(""); + return InvokeVoidAsync("clear"); } } } diff --git a/src/WebExtension.Net/Generated/Storage/StorageChange.cs b/src/WebExtension.Net/Generated/Storage/StorageChange.cs index c8376f0..c6c9a6a 100644 --- a/src/WebExtension.Net/Generated/Storage/StorageChange.cs +++ b/src/WebExtension.Net/Generated/Storage/StorageChange.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,22 +10,46 @@ namespace WebExtension.Net.Storage /// /// /// - public class StorageChange + public class StorageChange : BaseObject { // Property Definition + private object _oldValue; /// /// The old value of the item, if there was an old value. /// [JsonPropertyName("oldValue")] - public object OldValue { get; set; } + public object OldValue + { + get + { + InitializeProperty("oldValue", _oldValue); + return _oldValue; + } + set + { + _oldValue = value; + } + } // Property Definition + private object _newValue; /// /// The new value of the item, if there is a new value. /// [JsonPropertyName("newValue")] - public object NewValue { get; set; } + public object NewValue + { + get + { + InitializeProperty("newValue", _newValue); + return _newValue; + } + set + { + _newValue = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Storage/generated.txt b/src/WebExtension.Net/Generated/Storage/generated.txt index e69de29..4c440f6 100644 --- a/src/WebExtension.Net/Generated/Storage/generated.txt +++ b/src/WebExtension.Net/Generated/Storage/generated.txt @@ -0,0 +1 @@ +This file is auto generated at 2021-03-26T07:08:48 \ No newline at end of file diff --git a/src/WebExtension.Net/Generated/Tabs/ITabsAPI.cs b/src/WebExtension.Net/Generated/Tabs/ITabsAPI.cs index 937fdab..f7d1d4e 100644 --- a/src/WebExtension.Net/Generated/Tabs/ITabsAPI.cs +++ b/src/WebExtension.Net/Generated/Tabs/ITabsAPI.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -13,6 +11,13 @@ namespace WebExtension.Net.Tabs public interface ITabsAPI { + // Property Definition Interface + /// + /// An ID which represents the absence of a browser tab. + /// + int TAB_ID_NONE { get; } + + // Function Definition Interface /// /// Retrieves details about the specified tab. diff --git a/src/WebExtension.Net/Generated/Tabs/MutedInfo.cs b/src/WebExtension.Net/Generated/Tabs/MutedInfo.cs index d51605b..cbfb7ce 100644 --- a/src/WebExtension.Net/Generated/Tabs/MutedInfo.cs +++ b/src/WebExtension.Net/Generated/Tabs/MutedInfo.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,29 +10,65 @@ namespace WebExtension.Net.Tabs /// /// Tab muted state and the reason for the last state change. /// - public class MutedInfo + public class MutedInfo : BaseObject { // Property Definition + private bool _muted; /// /// 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; set; } + public bool Muted + { + get + { + InitializeProperty("muted", _muted); + return _muted; + } + set + { + _muted = value; + } + } // Property Definition + private MutedInfoReason _reason; /// /// The reason the tab was muted or unmuted. Not set if the tab's mute state has never been changed. /// [JsonPropertyName("reason")] - public MutedInfoReason Reason { get; set; } + public MutedInfoReason Reason + { + get + { + InitializeProperty("reason", _reason); + return _reason; + } + set + { + _reason = value; + } + } // Property Definition + private string _extensionId; /// /// 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")] - public string ExtensionId { get; set; } + public string ExtensionId + { + get + { + InitializeProperty("extensionId", _extensionId); + return _extensionId; + } + set + { + _extensionId = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Tabs/MutedInfoReason.cs b/src/WebExtension.Net/Generated/Tabs/MutedInfoReason.cs index f71dbf1..bb807a2 100644 --- a/src/WebExtension.Net/Generated/Tabs/MutedInfoReason.cs +++ b/src/WebExtension.Net/Generated/Tabs/MutedInfoReason.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Tabs/PageSettings.cs b/src/WebExtension.Net/Generated/Tabs/PageSettings.cs index 5b112bc..bebe5c0 100644 --- a/src/WebExtension.Net/Generated/Tabs/PageSettings.cs +++ b/src/WebExtension.Net/Generated/Tabs/PageSettings.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,169 +10,445 @@ namespace WebExtension.Net.Tabs /// /// Defines the page settings to be used when saving a page as a pdf file. /// - public class PageSettings + public class PageSettings : BaseObject { // Property Definition + private string _toFileName; /// /// The name of the file. May include optional .pdf extension. /// [JsonPropertyName("toFileName")] - public string ToFileName { get; set; } + public string ToFileName + { + get + { + InitializeProperty("toFileName", _toFileName); + return _toFileName; + } + set + { + _toFileName = value; + } + } // Property Definition + private int? _paperSizeUnit; /// /// The page size unit: 0 = inches, 1 = millimeters. Default: 0. /// [JsonPropertyName("paperSizeUnit")] - public int? PaperSizeUnit { get; set; } + public int? PaperSizeUnit + { + get + { + InitializeProperty("paperSizeUnit", _paperSizeUnit); + return _paperSizeUnit; + } + set + { + _paperSizeUnit = value; + } + } // Property Definition + private double? _paperWidth; /// /// The paper width in paper size units. Default: 8.5. /// [JsonPropertyName("paperWidth")] - public double? PaperWidth { get; set; } + public double? PaperWidth + { + get + { + InitializeProperty("paperWidth", _paperWidth); + return _paperWidth; + } + set + { + _paperWidth = value; + } + } // Property Definition + private double? _paperHeight; /// /// The paper height in paper size units. Default: 11.0. /// [JsonPropertyName("paperHeight")] - public double? PaperHeight { get; set; } + public double? PaperHeight + { + get + { + InitializeProperty("paperHeight", _paperHeight); + return _paperHeight; + } + set + { + _paperHeight = value; + } + } // Property Definition + private int? _orientation; /// /// The page content orientation: 0 = portrait, 1 = landscape. Default: 0. /// [JsonPropertyName("orientation")] - public int? Orientation { get; set; } + public int? Orientation + { + get + { + InitializeProperty("orientation", _orientation); + return _orientation; + } + set + { + _orientation = value; + } + } // Property Definition + private double? _scaling; /// /// The page content scaling factor: 1.0 = 100% = normal size. Default: 1.0. /// [JsonPropertyName("scaling")] - public double? Scaling { get; set; } + public double? Scaling + { + get + { + InitializeProperty("scaling", _scaling); + return _scaling; + } + set + { + _scaling = value; + } + } // Property Definition + private bool? _shrinkToFit; /// /// Whether the page content should shrink to fit the page width (overrides scaling). Default: true. /// [JsonPropertyName("shrinkToFit")] - public bool? ShrinkToFit { get; set; } + public bool? ShrinkToFit + { + get + { + InitializeProperty("shrinkToFit", _shrinkToFit); + return _shrinkToFit; + } + set + { + _shrinkToFit = value; + } + } // Property Definition + private bool? _showBackgroundColors; /// /// Whether the page background colors should be shown. Default: false. /// [JsonPropertyName("showBackgroundColors")] - public bool? ShowBackgroundColors { get; set; } + public bool? ShowBackgroundColors + { + get + { + InitializeProperty("showBackgroundColors", _showBackgroundColors); + return _showBackgroundColors; + } + set + { + _showBackgroundColors = value; + } + } // Property Definition + private bool? _showBackgroundImages; /// /// Whether the page background images should be shown. Default: false. /// [JsonPropertyName("showBackgroundImages")] - public bool? ShowBackgroundImages { get; set; } + public bool? ShowBackgroundImages + { + get + { + InitializeProperty("showBackgroundImages", _showBackgroundImages); + return _showBackgroundImages; + } + set + { + _showBackgroundImages = value; + } + } // Property Definition + private double? _edgeLeft; /// /// The spacing between the left header/footer and the left edge of the paper (inches). Default: 0. /// [JsonPropertyName("edgeLeft")] - public double? EdgeLeft { get; set; } + public double? EdgeLeft + { + get + { + InitializeProperty("edgeLeft", _edgeLeft); + return _edgeLeft; + } + set + { + _edgeLeft = value; + } + } // Property Definition + private double? _edgeRight; /// /// The spacing between the right header/footer and the right edge of the paper (inches). Default: 0. /// [JsonPropertyName("edgeRight")] - public double? EdgeRight { get; set; } + public double? EdgeRight + { + get + { + InitializeProperty("edgeRight", _edgeRight); + return _edgeRight; + } + set + { + _edgeRight = value; + } + } // Property Definition + private double? _edgeTop; /// /// The spacing between the top of the headers and the top edge of the paper (inches). Default: 0 /// [JsonPropertyName("edgeTop")] - public double? EdgeTop { get; set; } + public double? EdgeTop + { + get + { + InitializeProperty("edgeTop", _edgeTop); + return _edgeTop; + } + set + { + _edgeTop = value; + } + } // Property Definition + private double? _edgeBottom; /// /// The spacing between the bottom of the footers and the bottom edge of the paper (inches). Default: 0. /// [JsonPropertyName("edgeBottom")] - public double? EdgeBottom { get; set; } + public double? EdgeBottom + { + get + { + InitializeProperty("edgeBottom", _edgeBottom); + return _edgeBottom; + } + set + { + _edgeBottom = value; + } + } // Property Definition + private double? _marginLeft; /// /// The margin between the page content and the left edge of the paper (inches). Default: 0.5. /// [JsonPropertyName("marginLeft")] - public double? MarginLeft { get; set; } + public double? MarginLeft + { + get + { + InitializeProperty("marginLeft", _marginLeft); + return _marginLeft; + } + set + { + _marginLeft = value; + } + } // Property Definition + private double? _marginRight; /// /// The margin between the page content and the right edge of the paper (inches). Default: 0.5. /// [JsonPropertyName("marginRight")] - public double? MarginRight { get; set; } + public double? MarginRight + { + get + { + InitializeProperty("marginRight", _marginRight); + return _marginRight; + } + set + { + _marginRight = value; + } + } // Property Definition + private double? _marginTop; /// /// The margin between the page content and the top edge of the paper (inches). Default: 0.5. /// [JsonPropertyName("marginTop")] - public double? MarginTop { get; set; } + public double? MarginTop + { + get + { + InitializeProperty("marginTop", _marginTop); + return _marginTop; + } + set + { + _marginTop = value; + } + } // Property Definition + private double? _marginBottom; /// /// The margin between the page content and the bottom edge of the paper (inches). Default: 0.5. /// [JsonPropertyName("marginBottom")] - public double? MarginBottom { get; set; } + public double? MarginBottom + { + get + { + InitializeProperty("marginBottom", _marginBottom); + return _marginBottom; + } + set + { + _marginBottom = value; + } + } // Property Definition + private string _headerLeft; /// /// The text for the page's left header. Default: '&T'. /// [JsonPropertyName("headerLeft")] - public string HeaderLeft { get; set; } + public string HeaderLeft + { + get + { + InitializeProperty("headerLeft", _headerLeft); + return _headerLeft; + } + set + { + _headerLeft = value; + } + } // Property Definition + private string _headerCenter; /// /// The text for the page's center header. Default: ''. /// [JsonPropertyName("headerCenter")] - public string HeaderCenter { get; set; } + public string HeaderCenter + { + get + { + InitializeProperty("headerCenter", _headerCenter); + return _headerCenter; + } + set + { + _headerCenter = value; + } + } // Property Definition + private string _headerRight; /// /// The text for the page's right header. Default: '&U'. /// [JsonPropertyName("headerRight")] - public string HeaderRight { get; set; } + public string HeaderRight + { + get + { + InitializeProperty("headerRight", _headerRight); + return _headerRight; + } + set + { + _headerRight = value; + } + } // Property Definition + private string _footerLeft; /// /// The text for the page's left footer. Default: '&PT'. /// [JsonPropertyName("footerLeft")] - public string FooterLeft { get; set; } + public string FooterLeft + { + get + { + InitializeProperty("footerLeft", _footerLeft); + return _footerLeft; + } + set + { + _footerLeft = value; + } + } // Property Definition + private string _footerCenter; /// /// The text for the page's center footer. Default: ''. /// [JsonPropertyName("footerCenter")] - public string FooterCenter { get; set; } + public string FooterCenter + { + get + { + InitializeProperty("footerCenter", _footerCenter); + return _footerCenter; + } + set + { + _footerCenter = value; + } + } // Property Definition + private string _footerRight; /// /// The text for the page's right footer. Default: '&D'. /// [JsonPropertyName("footerRight")] - public string FooterRight { get; set; } + public string FooterRight + { + get + { + InitializeProperty("footerRight", _footerRight); + return _footerRight; + } + set + { + _footerRight = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Tabs/SharingState.cs b/src/WebExtension.Net/Generated/Tabs/SharingState.cs index 0787265..18337e9 100644 --- a/src/WebExtension.Net/Generated/Tabs/SharingState.cs +++ b/src/WebExtension.Net/Generated/Tabs/SharingState.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,29 +10,65 @@ namespace WebExtension.Net.Tabs /// /// Tab sharing state for screen, microphone and camera. /// - public class SharingState + public class SharingState : BaseObject { // Property Definition + private string _screen; /// /// 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")] - public string Screen { get; set; } + public string Screen + { + get + { + InitializeProperty("screen", _screen); + return _screen; + } + set + { + _screen = value; + } + } // Property Definition + private bool _camera; /// /// True if the tab is using the camera. /// [JsonPropertyName("camera")] - public bool Camera { get; set; } + public bool Camera + { + get + { + InitializeProperty("camera", _camera); + return _camera; + } + set + { + _camera = value; + } + } // Property Definition + private bool _microphone; /// /// True if the tab is using the microphone. /// [JsonPropertyName("microphone")] - public bool Microphone { get; set; } + public bool Microphone + { + get + { + InitializeProperty("microphone", _microphone); + return _microphone; + } + set + { + _microphone = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Tabs/Tab.cs b/src/WebExtension.Net/Generated/Tabs/Tab.cs index 6a6be04..744f1e8 100644 --- a/src/WebExtension.Net/Generated/Tabs/Tab.cs +++ b/src/WebExtension.Net/Generated/Tabs/Tab.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,190 +10,502 @@ namespace WebExtension.Net.Tabs /// /// /// - public class Tab + public class Tab : BaseObject { // Property Definition + private int? _id; /// /// 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")] - public int? Id { get; set; } + public int? Id + { + get + { + InitializeProperty("id", _id); + return _id; + } + set + { + _id = value; + } + } // Property Definition + private int _index; /// /// The zero-based index of the tab within its window. /// [JsonPropertyName("index")] - public int Index { get; set; } + public int Index + { + get + { + InitializeProperty("index", _index); + return _index; + } + set + { + _index = value; + } + } // Property Definition + private int? _windowId; /// /// The ID of the window the tab is contained within. /// [JsonPropertyName("windowId")] - public int? WindowId { get; set; } + public int? WindowId + { + get + { + InitializeProperty("windowId", _windowId); + return _windowId; + } + set + { + _windowId = value; + } + } // Property Definition + private int? _openerTabId; /// /// The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists. /// [JsonPropertyName("openerTabId")] - public int? OpenerTabId { get; set; } + public int? OpenerTabId + { + get + { + InitializeProperty("openerTabId", _openerTabId); + return _openerTabId; + } + set + { + _openerTabId = value; + } + } // Property Definition + private bool _highlighted; /// /// Whether the tab is highlighted. Works as an alias of active /// [JsonPropertyName("highlighted")] - public bool Highlighted { get; set; } + public bool Highlighted + { + get + { + InitializeProperty("highlighted", _highlighted); + return _highlighted; + } + set + { + _highlighted = value; + } + } // Property Definition + private bool _active; /// /// Whether the tab is active in its window. (Does not necessarily mean the window is focused.) /// [JsonPropertyName("active")] - public bool Active { get; set; } + public bool Active + { + get + { + InitializeProperty("active", _active); + return _active; + } + set + { + _active = value; + } + } // Property Definition + private bool _pinned; /// /// Whether the tab is pinned. /// [JsonPropertyName("pinned")] - public bool Pinned { get; set; } + public bool Pinned + { + get + { + InitializeProperty("pinned", _pinned); + return _pinned; + } + set + { + _pinned = value; + } + } // Property Definition + private int? _lastAccessed; /// /// The last time the tab was accessed as the number of milliseconds since epoch. /// [JsonPropertyName("lastAccessed")] - public int? LastAccessed { get; set; } + public int? LastAccessed + { + get + { + InitializeProperty("lastAccessed", _lastAccessed); + return _lastAccessed; + } + set + { + _lastAccessed = value; + } + } // Property Definition + private bool? _audible; /// /// 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")] - public bool? Audible { get; set; } + public bool? Audible + { + get + { + InitializeProperty("audible", _audible); + return _audible; + } + set + { + _audible = value; + } + } // Property Definition + private MutedInfo _mutedInfo; /// /// Current tab muted state and the reason for the last state change. /// [JsonPropertyName("mutedInfo")] - public MutedInfo MutedInfo { get; set; } + public MutedInfo MutedInfo + { + get + { + InitializeProperty("mutedInfo", _mutedInfo); + return _mutedInfo; + } + set + { + _mutedInfo = value; + } + } // Property Definition + private string _url; /// /// The URL the tab is displaying. This property is only present if the extension's manifest includes the "tabs" permission. /// [JsonPropertyName("url")] - public string Url { get; set; } + public string Url + { + get + { + InitializeProperty("url", _url); + return _url; + } + set + { + _url = value; + } + } // Property Definition + private string _title; /// /// The title of the tab. This property is only present if the extension's manifest includes the "tabs" permission. /// [JsonPropertyName("title")] - public string Title { get; set; } + public string Title + { + get + { + InitializeProperty("title", _title); + return _title; + } + set + { + _title = value; + } + } // Property Definition + private string _favIconUrl; /// /// 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")] - public string FavIconUrl { get; set; } + public string FavIconUrl + { + get + { + InitializeProperty("favIconUrl", _favIconUrl); + return _favIconUrl; + } + set + { + _favIconUrl = value; + } + } // Property Definition + private string _status; /// /// Either loading or complete. /// [JsonPropertyName("status")] - public string Status { get; set; } + public string Status + { + get + { + InitializeProperty("status", _status); + return _status; + } + set + { + _status = value; + } + } // Property Definition + private bool? _discarded; /// /// True while the tab is not loaded with content. /// [JsonPropertyName("discarded")] - public bool? Discarded { get; set; } + public bool? Discarded + { + get + { + InitializeProperty("discarded", _discarded); + return _discarded; + } + set + { + _discarded = value; + } + } // Property Definition + private bool _incognito; /// /// Whether the tab is in an incognito window. /// [JsonPropertyName("incognito")] - public bool Incognito { get; set; } + public bool Incognito + { + get + { + InitializeProperty("incognito", _incognito); + return _incognito; + } + set + { + _incognito = value; + } + } // Property Definition + private int? _width; /// /// The width of the tab in pixels. /// [JsonPropertyName("width")] - public int? Width { get; set; } + public int? Width + { + get + { + InitializeProperty("width", _width); + return _width; + } + set + { + _width = value; + } + } // Property Definition + private int? _height; /// /// The height of the tab in pixels. /// [JsonPropertyName("height")] - public int? Height { get; set; } + public int? Height + { + get + { + InitializeProperty("height", _height); + return _height; + } + set + { + _height = value; + } + } // Property Definition + private bool? _hidden; /// /// True if the tab is hidden. /// [JsonPropertyName("hidden")] - public bool? Hidden { get; set; } + public bool? Hidden + { + get + { + InitializeProperty("hidden", _hidden); + return _hidden; + } + set + { + _hidden = value; + } + } // Property Definition + private string _sessionId; /// /// The session ID used to uniquely identify a Tab obtained from the $(ref:sessions) API. /// [JsonPropertyName("sessionId")] - public string SessionId { get; set; } + public string SessionId + { + get + { + InitializeProperty("sessionId", _sessionId); + return _sessionId; + } + set + { + _sessionId = value; + } + } // Property Definition + private string _cookieStoreId; /// /// The CookieStoreId used for the tab. /// [JsonPropertyName("cookieStoreId")] - public string CookieStoreId { get; set; } + public string CookieStoreId + { + get + { + InitializeProperty("cookieStoreId", _cookieStoreId); + return _cookieStoreId; + } + set + { + _cookieStoreId = value; + } + } // Property Definition + private bool? _isArticle; /// /// Whether the document in the tab can be rendered in reader mode. /// [JsonPropertyName("isArticle")] - public bool? IsArticle { get; set; } + public bool? IsArticle + { + get + { + InitializeProperty("isArticle", _isArticle); + return _isArticle; + } + set + { + _isArticle = value; + } + } // Property Definition + private bool? _isInReaderMode; /// /// Whether the document in the tab is being rendered in reader mode. /// [JsonPropertyName("isInReaderMode")] - public bool? IsInReaderMode { get; set; } + public bool? IsInReaderMode + { + get + { + InitializeProperty("isInReaderMode", _isInReaderMode); + return _isInReaderMode; + } + set + { + _isInReaderMode = value; + } + } // Property Definition + private SharingState _sharingState; /// /// Current tab sharing state for screen, microphone and camera. /// [JsonPropertyName("sharingState")] - public SharingState SharingState { get; set; } + public SharingState SharingState + { + get + { + InitializeProperty("sharingState", _sharingState); + return _sharingState; + } + set + { + _sharingState = value; + } + } // Property Definition + private bool? _attention; /// /// Whether the tab is drawing attention. /// [JsonPropertyName("attention")] - public bool? Attention { get; set; } + public bool? Attention + { + get + { + InitializeProperty("attention", _attention); + return _attention; + } + set + { + _attention = value; + } + } // Property Definition + private int? _successorTabId; /// /// The ID of this tab's successor, if any; $(ref:tabs.TAB_ID_NONE) otherwise. /// [JsonPropertyName("successorTabId")] - public int? SuccessorTabId { get; set; } + public int? SuccessorTabId + { + get + { + InitializeProperty("successorTabId", _successorTabId); + return _successorTabId; + } + set + { + _successorTabId = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Tabs/TabStatus.cs b/src/WebExtension.Net/Generated/Tabs/TabStatus.cs index de3c9e5..06fa193 100644 --- a/src/WebExtension.Net/Generated/Tabs/TabStatus.cs +++ b/src/WebExtension.Net/Generated/Tabs/TabStatus.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Tabs/Tabs.json b/src/WebExtension.Net/Generated/Tabs/Tabs.json index 381631a..339e716 100644 --- a/src/WebExtension.Net/Generated/Tabs/Tabs.json +++ b/src/WebExtension.Net/Generated/Tabs/Tabs.json @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - [ { "namespace": "tabs", diff --git a/src/WebExtension.Net/Generated/Tabs/TabsAPI.cs b/src/WebExtension.Net/Generated/Tabs/TabsAPI.cs index 55af703..785bf94 100644 --- a/src/WebExtension.Net/Generated/Tabs/TabsAPI.cs +++ b/src/WebExtension.Net/Generated/Tabs/TabsAPI.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -8,17 +6,23 @@ namespace WebExtension.Net.Tabs { /// - public class TabsAPI : ITabsAPI + public class TabsAPI : BaseAPI, ITabsAPI { - private readonly WebExtensionJSRuntime webExtensionJSRuntime; /// Creates a new instance of TabsAPI. /// Web Extension JS Runtime - public TabsAPI(WebExtensionJSRuntime webExtensionJSRuntime) + public TabsAPI(WebExtensionJSRuntime webExtensionJSRuntime) : base(webExtensionJSRuntime, "tabs") { - this.webExtensionJSRuntime = webExtensionJSRuntime; } + // Property Definition + private const int _TAB_ID_NONE = -1; + /// + /// An ID which represents the absence of a browser tab. + /// + public int TAB_ID_NONE => _TAB_ID_NONE; + + // Function Definition /// /// Retrieves details about the specified tab. @@ -27,7 +31,7 @@ public TabsAPI(WebExtensionJSRuntime webExtensionJSRuntime) /// public virtual ValueTask Get(int tabId) { - return webExtensionJSRuntime.InvokeAsync("tabs.get", tabId); + return InvokeAsync("get", tabId); } // Function Definition @@ -37,7 +41,7 @@ public virtual ValueTask Get(int tabId) /// public virtual ValueTask GetCurrent() { - return webExtensionJSRuntime.InvokeAsync("tabs.getCurrent"); + return InvokeAsync("getCurrent"); } // Function Definition @@ -49,7 +53,7 @@ public virtual ValueTask GetCurrent() /// public virtual ValueTask Connect(int tabId, object connectInfo) { - return webExtensionJSRuntime.InvokeAsync("tabs.connect", tabId, connectInfo); + return InvokeAsync("connect", tabId, connectInfo); } // Function Definition @@ -62,7 +66,7 @@ public virtual ValueTask GetCurrent() /// public virtual ValueTask SendMessage(int tabId, object message, object options, Action responseCallback) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.sendMessage", tabId, message, options, responseCallback); + return InvokeVoidAsync("sendMessage", tabId, message, options, responseCallback); } // Function Definition @@ -73,7 +77,7 @@ public virtual ValueTask SendMessage(int tabId, object message, object options, /// public virtual ValueTask Create(object createProperties) { - return webExtensionJSRuntime.InvokeAsync("tabs.create", createProperties); + return InvokeAsync("create", createProperties); } // Function Definition @@ -85,7 +89,7 @@ public virtual ValueTask Create(object createProperties) /// public virtual ValueTask Duplicate(int tabId, object duplicateProperties) { - return webExtensionJSRuntime.InvokeAsync("tabs.duplicate", tabId, duplicateProperties); + return InvokeAsync("duplicate", tabId, duplicateProperties); } // Function Definition @@ -96,7 +100,7 @@ public virtual ValueTask Duplicate(int tabId, object duplicateProperties) /// public virtual ValueTask> Query(object queryInfo) { - return webExtensionJSRuntime.InvokeAsync>("tabs.query", queryInfo); + return InvokeAsync>("query", queryInfo); } // Function Definition @@ -107,7 +111,7 @@ public virtual ValueTask> Query(object queryInfo) /// public virtual ValueTask Highlight(object highlightInfo) { - return webExtensionJSRuntime.InvokeAsync("tabs.highlight", highlightInfo); + return InvokeAsync("highlight", highlightInfo); } // Function Definition @@ -119,7 +123,7 @@ public virtual ValueTask> Query(object queryInfo) /// public virtual ValueTask Update(int? tabId, object updateProperties) { - return webExtensionJSRuntime.InvokeAsync("tabs.update", tabId, updateProperties); + return InvokeAsync("update", tabId, updateProperties); } // Function Definition @@ -131,7 +135,7 @@ public virtual ValueTask Update(int? tabId, object updateProperties) /// public virtual ValueTask Move(int tabIds, object moveProperties) { - return webExtensionJSRuntime.InvokeAsync("tabs.move", tabIds, moveProperties); + return InvokeAsync("move", tabIds, moveProperties); } // Function Definition @@ -143,7 +147,7 @@ public virtual ValueTask Move(int tabIds, object moveProperties) /// public virtual ValueTask Move(IEnumerable tabIds, object moveProperties) { - return webExtensionJSRuntime.InvokeAsync("tabs.move", tabIds, moveProperties); + return InvokeAsync("move", tabIds, moveProperties); } // Function Definition @@ -154,7 +158,7 @@ public virtual ValueTask Move(IEnumerable tabIds, object moveP /// public virtual ValueTask Reload(int? tabId, object reloadProperties) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.reload", tabId, reloadProperties); + return InvokeVoidAsync("reload", tabId, reloadProperties); } // Function Definition @@ -164,7 +168,7 @@ public virtual ValueTask Reload(int? tabId, object reloadProperties) /// The ID of the tab to warm up. public virtual ValueTask Warmup(int tabId) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.warmup", tabId); + return InvokeVoidAsync("warmup", tabId); } // Function Definition @@ -174,7 +178,7 @@ public virtual ValueTask Warmup(int tabId) /// The tab or list of tabs to close. public virtual ValueTask Remove(int tabIds) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.remove", tabIds); + return InvokeVoidAsync("remove", tabIds); } // Function Definition @@ -184,7 +188,7 @@ public virtual ValueTask Remove(int tabIds) /// The tab or list of tabs to close. public virtual ValueTask Remove(IEnumerable tabIds) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.remove", tabIds); + return InvokeVoidAsync("remove", tabIds); } // Function Definition @@ -194,7 +198,7 @@ public virtual ValueTask Remove(IEnumerable tabIds) /// The tab or list of tabs to discard. public virtual ValueTask Discard(int tabIds) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.discard", tabIds); + return InvokeVoidAsync("discard", tabIds); } // Function Definition @@ -204,7 +208,7 @@ public virtual ValueTask Discard(int tabIds) /// The tab or list of tabs to discard. public virtual ValueTask Discard(IEnumerable tabIds) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.discard", tabIds); + return InvokeVoidAsync("discard", tabIds); } // Function Definition @@ -215,7 +219,7 @@ public virtual ValueTask Discard(IEnumerable tabIds) /// public virtual ValueTask DetectLanguage(int? tabId) { - return webExtensionJSRuntime.InvokeAsync("tabs.detectLanguage", tabId); + return InvokeAsync("detectLanguage", tabId); } // Function Definition @@ -225,7 +229,7 @@ public virtual ValueTask DetectLanguage(int? tabId) /// Defaults to the active tab of the $(topic:current-window)[current window]. public virtual ValueTask ToggleReaderMode(int? tabId) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.toggleReaderMode", tabId); + return InvokeVoidAsync("toggleReaderMode", tabId); } // Function Definition @@ -236,7 +240,7 @@ public virtual ValueTask ToggleReaderMode(int? tabId) /// public virtual ValueTask CaptureTab(int? tabId, ExtensionTypes.ImageDetails options) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.captureTab", tabId, options); + return InvokeVoidAsync("captureTab", tabId, options); } // Function Definition @@ -248,7 +252,7 @@ public virtual ValueTask CaptureTab(int? tabId, ExtensionTypes.ImageDetails opti /// public virtual ValueTask CaptureVisibleTab(int? windowId, ExtensionTypes.ImageDetails options) { - return webExtensionJSRuntime.InvokeAsync("tabs.captureVisibleTab", windowId, options); + return InvokeAsync("captureVisibleTab", windowId, options); } // Function Definition @@ -260,7 +264,7 @@ public virtual ValueTask CaptureVisibleTab(int? windowId, ExtensionTypes /// public virtual ValueTask> ExecuteScript(int? tabId, ExtensionTypes.InjectDetails details) { - return webExtensionJSRuntime.InvokeAsync>("tabs.executeScript", tabId, details); + return InvokeAsync>("executeScript", tabId, details); } // Function Definition @@ -271,7 +275,7 @@ public virtual ValueTask> ExecuteScript(int? tabId, Extensio /// Details of the CSS text to insert. public virtual ValueTask InsertCSS(int? tabId, ExtensionTypes.InjectDetails details) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.insertCSS", tabId, details); + return InvokeVoidAsync("insertCSS", tabId, details); } // Function Definition @@ -282,7 +286,7 @@ public virtual ValueTask InsertCSS(int? tabId, ExtensionTypes.InjectDetails deta /// Details of the CSS text to remove. public virtual ValueTask RemoveCSS(int? tabId, ExtensionTypes.InjectDetails details) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.removeCSS", tabId, details); + return InvokeVoidAsync("removeCSS", tabId, details); } // Function Definition @@ -293,7 +297,7 @@ public virtual ValueTask RemoveCSS(int? tabId, ExtensionTypes.InjectDetails deta /// The new zoom factor. Use a value of 0 here to set the tab to its current default zoom factor. Values greater than zero specify a (possibly non-default) zoom factor for the tab. public virtual ValueTask SetZoom(int? tabId, double zoomFactor) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.setZoom", tabId, zoomFactor); + return InvokeVoidAsync("setZoom", tabId, zoomFactor); } // Function Definition @@ -304,7 +308,7 @@ public virtual ValueTask SetZoom(int? tabId, double zoomFactor) /// public virtual ValueTask GetZoom(int? tabId) { - return webExtensionJSRuntime.InvokeAsync("tabs.getZoom", tabId); + return InvokeAsync("getZoom", tabId); } // Function Definition @@ -315,7 +319,7 @@ public virtual ValueTask GetZoom(int? tabId) /// Defines how zoom changes are handled and at what scope. public virtual ValueTask SetZoomSettings(int? tabId, ZoomSettings zoomSettings) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.setZoomSettings", tabId, zoomSettings); + return InvokeVoidAsync("setZoomSettings", tabId, zoomSettings); } // Function Definition @@ -326,7 +330,7 @@ public virtual ValueTask SetZoomSettings(int? tabId, ZoomSettings zoomSettings) /// public virtual ValueTask GetZoomSettings(int? tabId) { - return webExtensionJSRuntime.InvokeAsync("tabs.getZoomSettings", tabId); + return InvokeAsync("getZoomSettings", tabId); } // Function Definition @@ -335,7 +339,7 @@ public virtual ValueTask GetZoomSettings(int? tabId) /// public virtual ValueTask Print() { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.print"); + return InvokeVoidAsync("print"); } // Function Definition @@ -344,7 +348,7 @@ public virtual ValueTask Print() /// public virtual ValueTask PrintPreview() { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.printPreview"); + return InvokeVoidAsync("printPreview"); } // Function Definition @@ -355,7 +359,7 @@ public virtual ValueTask PrintPreview() /// public virtual ValueTask SaveAsPDF(PageSettings pageSettings) { - return webExtensionJSRuntime.InvokeAsync("tabs.saveAsPDF", pageSettings); + return InvokeAsync("saveAsPDF", pageSettings); } // Function Definition @@ -365,7 +369,7 @@ public virtual ValueTask SaveAsPDF(PageSettings pageSettings) /// The TAB ID or list of TAB IDs to show. public virtual ValueTask Show(int tabIds) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.show", tabIds); + return InvokeVoidAsync("show", tabIds); } // Function Definition @@ -375,7 +379,7 @@ public virtual ValueTask Show(int tabIds) /// The TAB ID or list of TAB IDs to show. public virtual ValueTask Show(IEnumerable tabIds) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.show", tabIds); + return InvokeVoidAsync("show", tabIds); } // Function Definition @@ -385,7 +389,7 @@ public virtual ValueTask Show(IEnumerable tabIds) /// The TAB ID or list of TAB IDs to hide. public virtual ValueTask Hide(int tabIds) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.hide", tabIds); + return InvokeVoidAsync("hide", tabIds); } // Function Definition @@ -395,7 +399,7 @@ public virtual ValueTask Hide(int tabIds) /// The TAB ID or list of TAB IDs to hide. public virtual ValueTask Hide(IEnumerable tabIds) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.hide", tabIds); + return InvokeVoidAsync("hide", tabIds); } // Function Definition @@ -407,7 +411,7 @@ public virtual ValueTask Hide(IEnumerable tabIds) /// public virtual ValueTask MoveInSuccession(IEnumerable tabIds, int? tabId, object options) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.moveInSuccession", tabIds, tabId, options); + return InvokeVoidAsync("moveInSuccession", tabIds, tabId, options); } // Function Definition @@ -417,7 +421,7 @@ public virtual ValueTask MoveInSuccession(IEnumerable tabIds, int? tabId, o /// The ID of the tab to navigate forward. public virtual ValueTask GoForward(int? tabId) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.goForward", tabId); + return InvokeVoidAsync("goForward", tabId); } // Function Definition @@ -427,7 +431,7 @@ public virtual ValueTask GoForward(int? tabId) /// The ID of the tab to navigate backward. public virtual ValueTask GoBack(int? tabId) { - return webExtensionJSRuntime.InvokeVoidAsync("tabs.goBack", tabId); + return InvokeVoidAsync("goBack", tabId); } } } diff --git a/src/WebExtension.Net/Generated/Tabs/UpdateFilter.cs b/src/WebExtension.Net/Generated/Tabs/UpdateFilter.cs index d64f67c..b348a24 100644 --- a/src/WebExtension.Net/Generated/Tabs/UpdateFilter.cs +++ b/src/WebExtension.Net/Generated/Tabs/UpdateFilter.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,36 +10,84 @@ namespace WebExtension.Net.Tabs /// /// An object describing filters to apply to tabs.onUpdated events. /// - public class UpdateFilter + public class UpdateFilter : BaseObject { // Property Definition + private IEnumerable _urls; /// /// 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")] - public IEnumerable Urls { get; set; } + public IEnumerable Urls + { + get + { + InitializeProperty("urls", _urls); + return _urls; + } + set + { + _urls = value; + } + } // Property Definition + private IEnumerable _properties; /// /// A list of property names. Events that do not match any of the names will be filtered out. /// [JsonPropertyName("properties")] - public IEnumerable Properties { get; set; } + public IEnumerable Properties + { + get + { + InitializeProperty("properties", _properties); + return _properties; + } + set + { + _properties = value; + } + } // Property Definition + private int? _tabId; /// /// /// [JsonPropertyName("tabId")] - public int? TabId { get; set; } + public int? TabId + { + get + { + InitializeProperty("tabId", _tabId); + return _tabId; + } + set + { + _tabId = value; + } + } // Property Definition + private int? _windowId; /// /// /// [JsonPropertyName("windowId")] - public int? WindowId { get; set; } + public int? WindowId + { + get + { + InitializeProperty("windowId", _windowId); + return _windowId; + } + set + { + _windowId = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Tabs/UpdatePropertyName.cs b/src/WebExtension.Net/Generated/Tabs/UpdatePropertyName.cs index d2cc2d9..d71ee5f 100644 --- a/src/WebExtension.Net/Generated/Tabs/UpdatePropertyName.cs +++ b/src/WebExtension.Net/Generated/Tabs/UpdatePropertyName.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Tabs/WindowType.cs b/src/WebExtension.Net/Generated/Tabs/WindowType.cs index 4d98a78..6b11958 100644 --- a/src/WebExtension.Net/Generated/Tabs/WindowType.cs +++ b/src/WebExtension.Net/Generated/Tabs/WindowType.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Tabs/ZoomSettings.cs b/src/WebExtension.Net/Generated/Tabs/ZoomSettings.cs index 9e61d46..5597cc6 100644 --- a/src/WebExtension.Net/Generated/Tabs/ZoomSettings.cs +++ b/src/WebExtension.Net/Generated/Tabs/ZoomSettings.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,29 +10,65 @@ namespace WebExtension.Net.Tabs /// /// Defines how zoom changes in a tab are handled and at what scope. /// - public class ZoomSettings + public class ZoomSettings : BaseObject { // Property Definition + private ZoomSettingsMode _mode; /// /// Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to automatic. /// [JsonPropertyName("mode")] - public ZoomSettingsMode Mode { get; set; } + public ZoomSettingsMode Mode + { + get + { + InitializeProperty("mode", _mode); + return _mode; + } + set + { + _mode = value; + } + } // Property Definition + private ZoomSettingsScope _scope; /// /// 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")] - public ZoomSettingsScope Scope { get; set; } + public ZoomSettingsScope Scope + { + get + { + InitializeProperty("scope", _scope); + return _scope; + } + set + { + _scope = value; + } + } // Property Definition + private double? _defaultZoomFactor; /// /// Used to return the default zoom level for the current tab in calls to tabs.getZoomSettings. /// [JsonPropertyName("defaultZoomFactor")] - public double? DefaultZoomFactor { get; set; } + public double? DefaultZoomFactor + { + get + { + InitializeProperty("defaultZoomFactor", _defaultZoomFactor); + return _defaultZoomFactor; + } + set + { + _defaultZoomFactor = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Tabs/ZoomSettingsMode.cs b/src/WebExtension.Net/Generated/Tabs/ZoomSettingsMode.cs index 57a34bb..697dd9e 100644 --- a/src/WebExtension.Net/Generated/Tabs/ZoomSettingsMode.cs +++ b/src/WebExtension.Net/Generated/Tabs/ZoomSettingsMode.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Tabs/ZoomSettingsScope.cs b/src/WebExtension.Net/Generated/Tabs/ZoomSettingsScope.cs index d777d77..462aee2 100644 --- a/src/WebExtension.Net/Generated/Tabs/ZoomSettingsScope.cs +++ b/src/WebExtension.Net/Generated/Tabs/ZoomSettingsScope.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Tabs/generated.txt b/src/WebExtension.Net/Generated/Tabs/generated.txt index e69de29..a7fc8fc 100644 --- a/src/WebExtension.Net/Generated/Tabs/generated.txt +++ b/src/WebExtension.Net/Generated/Tabs/generated.txt @@ -0,0 +1 @@ +This file is auto generated at 2021-03-26T07:08:47 \ No newline at end of file diff --git a/src/WebExtension.Net/Generated/WebExtensionAPI.cs b/src/WebExtension.Net/Generated/WebExtensionAPI.cs index 4ff878a..a812fcf 100644 --- a/src/WebExtension.Net/Generated/WebExtensionAPI.cs +++ b/src/WebExtension.Net/Generated/WebExtensionAPI.cs @@ -1,11 +1,10 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using WebExtension.Net.Windows; using WebExtension.Net.ContentScripts; using WebExtension.Net.Tabs; -using WebExtension.Net.Notifications; using WebExtension.Net.Runtime; using WebExtension.Net.WebNavigation; +using WebExtension.Net.Storage; +using WebExtension.Net.Notifications; using WebExtension.Net.WebRequest; namespace WebExtension.Net @@ -63,20 +62,6 @@ public ITabsAPI Tabs } } - private NotificationsAPI _notifications; - /// - public INotificationsAPI Notifications - { - get - { - if (_notifications is null) - { - _notifications = new NotificationsAPI(webExtensionJSRuntime); - } - return _notifications; - } - } - private RuntimeAPI _runtime; /// public IRuntimeAPI Runtime @@ -105,6 +90,34 @@ public IWebNavigationAPI WebNavigation } } + private StorageAPI _storage; + /// + public IStorageAPI Storage + { + get + { + if (_storage is null) + { + _storage = new StorageAPI(webExtensionJSRuntime); + } + return _storage; + } + } + + private NotificationsAPI _notifications; + /// + public INotificationsAPI Notifications + { + get + { + if (_notifications is null) + { + _notifications = new NotificationsAPI(webExtensionJSRuntime); + } + return _notifications; + } + } + private WebRequestAPI _webRequest; /// public IWebRequestAPI WebRequest diff --git a/src/WebExtension.Net/Generated/WebNavigation/EventUrlFilters.cs b/src/WebExtension.Net/Generated/WebNavigation/EventUrlFilters.cs index e26e764..3c541d4 100644 --- a/src/WebExtension.Net/Generated/WebNavigation/EventUrlFilters.cs +++ b/src/WebExtension.Net/Generated/WebNavigation/EventUrlFilters.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,15 +10,27 @@ namespace WebExtension.Net.WebNavigation /// /// /// - public class EventUrlFilters + public class EventUrlFilters : BaseObject { // Property Definition + private IEnumerable _url; /// /// /// [JsonPropertyName("url")] - public IEnumerable Url { get; set; } + public IEnumerable Url + { + get + { + InitializeProperty("url", _url); + return _url; + } + set + { + _url = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/WebNavigation/IWebNavigationAPI.cs b/src/WebExtension.Net/Generated/WebNavigation/IWebNavigationAPI.cs index 85e613f..5848eb0 100644 --- a/src/WebExtension.Net/Generated/WebNavigation/IWebNavigationAPI.cs +++ b/src/WebExtension.Net/Generated/WebNavigation/IWebNavigationAPI.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -13,6 +11,8 @@ namespace WebExtension.Net.WebNavigation public interface IWebNavigationAPI { + + // Function Definition Interface /// /// Retrieves information about the given frame. A frame refers to an <iframe> or a <frame> of a web page and is identified by a tab ID and a frame ID. diff --git a/src/WebExtension.Net/Generated/WebNavigation/TransitionQualifier.cs b/src/WebExtension.Net/Generated/WebNavigation/TransitionQualifier.cs index 090bb78..87e31d1 100644 --- a/src/WebExtension.Net/Generated/WebNavigation/TransitionQualifier.cs +++ b/src/WebExtension.Net/Generated/WebNavigation/TransitionQualifier.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/WebNavigation/TransitionType.cs b/src/WebExtension.Net/Generated/WebNavigation/TransitionType.cs index ca4d667..f1d7f53 100644 --- a/src/WebExtension.Net/Generated/WebNavigation/TransitionType.cs +++ b/src/WebExtension.Net/Generated/WebNavigation/TransitionType.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/WebNavigation/WebNavigation.json b/src/WebExtension.Net/Generated/WebNavigation/WebNavigation.json index 8e789de..0db09ab 100644 --- a/src/WebExtension.Net/Generated/WebNavigation/WebNavigation.json +++ b/src/WebExtension.Net/Generated/WebNavigation/WebNavigation.json @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - [ { "namespace": "webNavigation", diff --git a/src/WebExtension.Net/Generated/WebNavigation/WebNavigationAPI.cs b/src/WebExtension.Net/Generated/WebNavigation/WebNavigationAPI.cs index 501ec50..c1527ba 100644 --- a/src/WebExtension.Net/Generated/WebNavigation/WebNavigationAPI.cs +++ b/src/WebExtension.Net/Generated/WebNavigation/WebNavigationAPI.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -8,17 +6,17 @@ namespace WebExtension.Net.WebNavigation { /// - public class WebNavigationAPI : IWebNavigationAPI + public class WebNavigationAPI : BaseAPI, IWebNavigationAPI { - private readonly WebExtensionJSRuntime webExtensionJSRuntime; /// Creates a new instance of WebNavigationAPI. /// Web Extension JS Runtime - public WebNavigationAPI(WebExtensionJSRuntime webExtensionJSRuntime) + public WebNavigationAPI(WebExtensionJSRuntime webExtensionJSRuntime) : base(webExtensionJSRuntime, "webNavigation") { - this.webExtensionJSRuntime = webExtensionJSRuntime; } + + // Function Definition /// /// Retrieves information about the given frame. A frame refers to an <iframe> or a <frame> of a web page and is identified by a tab ID and a frame ID. @@ -27,7 +25,7 @@ public WebNavigationAPI(WebExtensionJSRuntime webExtensionJSRuntime) /// public virtual ValueTask GetFrame(object details) { - return webExtensionJSRuntime.InvokeAsync("webNavigation.getFrame", details); + return InvokeAsync("getFrame", details); } // Function Definition @@ -38,7 +36,7 @@ public virtual ValueTask GetFrame(object details) /// public virtual ValueTask> GetAllFrames(object details) { - return webExtensionJSRuntime.InvokeAsync>("webNavigation.getAllFrames", details); + return InvokeAsync>("getAllFrames", details); } } } diff --git a/src/WebExtension.Net/Generated/WebNavigation/generated.txt b/src/WebExtension.Net/Generated/WebNavigation/generated.txt index e69de29..4c440f6 100644 --- a/src/WebExtension.Net/Generated/WebNavigation/generated.txt +++ b/src/WebExtension.Net/Generated/WebNavigation/generated.txt @@ -0,0 +1 @@ +This file is auto generated at 2021-03-26T07:08:48 \ No newline at end of file diff --git a/src/WebExtension.Net/Generated/WebRequest/BlockingResponse.cs b/src/WebExtension.Net/Generated/WebRequest/BlockingResponse.cs index 29a6af1..a02dc6b 100644 --- a/src/WebExtension.Net/Generated/WebRequest/BlockingResponse.cs +++ b/src/WebExtension.Net/Generated/WebRequest/BlockingResponse.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,50 +10,122 @@ namespace WebExtension.Net.WebRequest /// /// Returns value for event handlers that have the 'blocking' extraInfoSpec applied. Allows the event handler to modify network requests. /// - public class BlockingResponse + public class BlockingResponse : BaseObject { // Property Definition + private bool? _cancel; /// /// If true, the request is cancelled. Used in onBeforeRequest, this prevents the request from being sent. /// [JsonPropertyName("cancel")] - public bool? Cancel { get; set; } + public bool? Cancel + { + get + { + InitializeProperty("cancel", _cancel); + return _cancel; + } + set + { + _cancel = value; + } + } // Property Definition + private string _redirectUrl; /// /// 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")] - public string RedirectUrl { get; set; } + public string RedirectUrl + { + get + { + InitializeProperty("redirectUrl", _redirectUrl); + return _redirectUrl; + } + set + { + _redirectUrl = value; + } + } // Property Definition + private bool? _upgradeToSecure; /// /// 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")] - public bool? UpgradeToSecure { get; set; } + public bool? UpgradeToSecure + { + get + { + InitializeProperty("upgradeToSecure", _upgradeToSecure); + return _upgradeToSecure; + } + set + { + _upgradeToSecure = value; + } + } // Property Definition + private HttpHeaders _requestHeaders; /// /// Only used as a response to the onBeforeSendHeaders event. If set, the request is made with these request headers instead. /// [JsonPropertyName("requestHeaders")] - public HttpHeaders RequestHeaders { get; set; } + public HttpHeaders RequestHeaders + { + get + { + InitializeProperty("requestHeaders", _requestHeaders); + return _requestHeaders; + } + set + { + _requestHeaders = value; + } + } // Property Definition + private HttpHeaders _responseHeaders; /// /// 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")] - public HttpHeaders ResponseHeaders { get; set; } + public HttpHeaders ResponseHeaders + { + get + { + InitializeProperty("responseHeaders", _responseHeaders); + return _responseHeaders; + } + set + { + _responseHeaders = value; + } + } // Property Definition + private object _authCredentials; /// /// Only used as a response to the onAuthRequired event. If set, the request is made using the supplied credentials. /// [JsonPropertyName("authCredentials")] - public object AuthCredentials { get; set; } + public object AuthCredentials + { + get + { + InitializeProperty("authCredentials", _authCredentials); + return _authCredentials; + } + set + { + _authCredentials = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/WebRequest/CertificateInfo.cs b/src/WebExtension.Net/Generated/WebRequest/CertificateInfo.cs index 29c5e85..e3087ce 100644 --- a/src/WebExtension.Net/Generated/WebRequest/CertificateInfo.cs +++ b/src/WebExtension.Net/Generated/WebRequest/CertificateInfo.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,64 +10,160 @@ namespace WebExtension.Net.WebRequest /// /// Contains the certificate properties of the request if it is a secure request. /// - public class CertificateInfo + public class CertificateInfo : BaseObject { // Property Definition + private string _subject; /// /// /// [JsonPropertyName("subject")] - public string Subject { get; set; } + public string Subject + { + get + { + InitializeProperty("subject", _subject); + return _subject; + } + set + { + _subject = value; + } + } // Property Definition + private string _issuer; /// /// /// [JsonPropertyName("issuer")] - public string Issuer { get; set; } + public string Issuer + { + get + { + InitializeProperty("issuer", _issuer); + return _issuer; + } + set + { + _issuer = value; + } + } // Property Definition + private object _validity; /// /// Contains start and end timestamps. /// [JsonPropertyName("validity")] - public object Validity { get; set; } + public object Validity + { + get + { + InitializeProperty("validity", _validity); + return _validity; + } + set + { + _validity = value; + } + } // Property Definition + private object _fingerprint; /// /// /// [JsonPropertyName("fingerprint")] - public object Fingerprint { get; set; } + public object Fingerprint + { + get + { + InitializeProperty("fingerprint", _fingerprint); + return _fingerprint; + } + set + { + _fingerprint = value; + } + } // Property Definition + private string _serialNumber; /// /// /// [JsonPropertyName("serialNumber")] - public string SerialNumber { get; set; } + public string SerialNumber + { + get + { + InitializeProperty("serialNumber", _serialNumber); + return _serialNumber; + } + set + { + _serialNumber = value; + } + } // Property Definition + private bool _isBuiltInRoot; /// /// /// [JsonPropertyName("isBuiltInRoot")] - public bool IsBuiltInRoot { get; set; } + public bool IsBuiltInRoot + { + get + { + InitializeProperty("isBuiltInRoot", _isBuiltInRoot); + return _isBuiltInRoot; + } + set + { + _isBuiltInRoot = value; + } + } // Property Definition + private object _subjectPublicKeyInfoDigest; /// /// /// [JsonPropertyName("subjectPublicKeyInfoDigest")] - public object SubjectPublicKeyInfoDigest { get; set; } + public object SubjectPublicKeyInfoDigest + { + get + { + InitializeProperty("subjectPublicKeyInfoDigest", _subjectPublicKeyInfoDigest); + return _subjectPublicKeyInfoDigest; + } + set + { + _subjectPublicKeyInfoDigest = value; + } + } // Property Definition + private IEnumerable _rawDER; /// /// /// [JsonPropertyName("rawDER")] - public IEnumerable RawDER { get; set; } + public IEnumerable RawDER + { + get + { + InitializeProperty("rawDER", _rawDER); + return _rawDER; + } + set + { + _rawDER = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/WebRequest/CertificateTransparencyStatus.cs b/src/WebExtension.Net/Generated/WebRequest/CertificateTransparencyStatus.cs index be77850..9c66c8b 100644 --- a/src/WebExtension.Net/Generated/WebRequest/CertificateTransparencyStatus.cs +++ b/src/WebExtension.Net/Generated/WebRequest/CertificateTransparencyStatus.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/WebRequest/HttpHeaders.cs b/src/WebExtension.Net/Generated/WebRequest/HttpHeaders.cs index d88dcde..bdd3649 100644 --- a/src/WebExtension.Net/Generated/WebRequest/HttpHeaders.cs +++ b/src/WebExtension.Net/Generated/WebRequest/HttpHeaders.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/WebRequest/IWebRequestAPI.cs b/src/WebExtension.Net/Generated/WebRequest/IWebRequestAPI.cs index 01652e8..7fa1073 100644 --- a/src/WebExtension.Net/Generated/WebRequest/IWebRequestAPI.cs +++ b/src/WebExtension.Net/Generated/WebRequest/IWebRequestAPI.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -13,6 +11,13 @@ namespace WebExtension.Net.WebRequest public interface IWebRequestAPI { + // Property Definition Interface + /// + /// The maximum number of times that handlerBehaviorChanged can be called per 10 minute sustained interval. handlerBehaviorChanged is an expensive function call that shouldn't be called often. + /// + int MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES { get; } + + // Function Definition Interface /// /// Needs to be called when the behavior of the webRequest handlers has changed to prevent incorrect handling due to caching. This function call is expensive. Don't call it often. diff --git a/src/WebExtension.Net/Generated/WebRequest/OnAuthRequiredOptions.cs b/src/WebExtension.Net/Generated/WebRequest/OnAuthRequiredOptions.cs index dd8fdb7..6e684f1 100644 --- a/src/WebExtension.Net/Generated/WebRequest/OnAuthRequiredOptions.cs +++ b/src/WebExtension.Net/Generated/WebRequest/OnAuthRequiredOptions.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/WebRequest/OnBeforeRedirectOptions.cs b/src/WebExtension.Net/Generated/WebRequest/OnBeforeRedirectOptions.cs index 5c81cfc..1b6ef5d 100644 --- a/src/WebExtension.Net/Generated/WebRequest/OnBeforeRedirectOptions.cs +++ b/src/WebExtension.Net/Generated/WebRequest/OnBeforeRedirectOptions.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/WebRequest/OnBeforeRequestOptions.cs b/src/WebExtension.Net/Generated/WebRequest/OnBeforeRequestOptions.cs index 1fa480a..cac2c1c 100644 --- a/src/WebExtension.Net/Generated/WebRequest/OnBeforeRequestOptions.cs +++ b/src/WebExtension.Net/Generated/WebRequest/OnBeforeRequestOptions.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/WebRequest/OnBeforeSendHeadersOptions.cs b/src/WebExtension.Net/Generated/WebRequest/OnBeforeSendHeadersOptions.cs index bca73dc..70bfeb3 100644 --- a/src/WebExtension.Net/Generated/WebRequest/OnBeforeSendHeadersOptions.cs +++ b/src/WebExtension.Net/Generated/WebRequest/OnBeforeSendHeadersOptions.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/WebRequest/OnCompletedOptions.cs b/src/WebExtension.Net/Generated/WebRequest/OnCompletedOptions.cs index b220c0c..7e93f8b 100644 --- a/src/WebExtension.Net/Generated/WebRequest/OnCompletedOptions.cs +++ b/src/WebExtension.Net/Generated/WebRequest/OnCompletedOptions.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/WebRequest/OnHeadersReceivedOptions.cs b/src/WebExtension.Net/Generated/WebRequest/OnHeadersReceivedOptions.cs index f374ce1..44ee850 100644 --- a/src/WebExtension.Net/Generated/WebRequest/OnHeadersReceivedOptions.cs +++ b/src/WebExtension.Net/Generated/WebRequest/OnHeadersReceivedOptions.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/WebRequest/OnResponseStartedOptions.cs b/src/WebExtension.Net/Generated/WebRequest/OnResponseStartedOptions.cs index fd16aa9..0f617dd 100644 --- a/src/WebExtension.Net/Generated/WebRequest/OnResponseStartedOptions.cs +++ b/src/WebExtension.Net/Generated/WebRequest/OnResponseStartedOptions.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/WebRequest/OnSendHeadersOptions.cs b/src/WebExtension.Net/Generated/WebRequest/OnSendHeadersOptions.cs index 339dbfd..ab78694 100644 --- a/src/WebExtension.Net/Generated/WebRequest/OnSendHeadersOptions.cs +++ b/src/WebExtension.Net/Generated/WebRequest/OnSendHeadersOptions.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/WebRequest/RequestFilter.cs b/src/WebExtension.Net/Generated/WebRequest/RequestFilter.cs index ad65a0e..3b1f4f7 100644 --- a/src/WebExtension.Net/Generated/WebRequest/RequestFilter.cs +++ b/src/WebExtension.Net/Generated/WebRequest/RequestFilter.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,43 +10,103 @@ namespace WebExtension.Net.WebRequest /// /// An object describing filters to apply to webRequest events. /// - public class RequestFilter + public class RequestFilter : BaseObject { // Property Definition + private IEnumerable _urls; /// /// A list of URLs or URL patterns. Requests that cannot match any of the URLs will be filtered out. /// [JsonPropertyName("urls")] - public IEnumerable Urls { get; set; } + public IEnumerable Urls + { + get + { + InitializeProperty("urls", _urls); + return _urls; + } + set + { + _urls = value; + } + } // Property Definition + private IEnumerable _types; /// /// A list of request types. Requests that cannot match any of the types will be filtered out. /// [JsonPropertyName("types")] - public IEnumerable Types { get; set; } + public IEnumerable Types + { + get + { + InitializeProperty("types", _types); + return _types; + } + set + { + _types = value; + } + } // Property Definition + private int? _tabId; /// /// /// [JsonPropertyName("tabId")] - public int? TabId { get; set; } + public int? TabId + { + get + { + InitializeProperty("tabId", _tabId); + return _tabId; + } + set + { + _tabId = value; + } + } // Property Definition + private int? _windowId; /// /// /// [JsonPropertyName("windowId")] - public int? WindowId { get; set; } + public int? WindowId + { + get + { + InitializeProperty("windowId", _windowId); + return _windowId; + } + set + { + _windowId = value; + } + } // Property Definition + private bool? _incognito; /// /// If provided, requests that do not match the incognito state will be filtered out. /// [JsonPropertyName("incognito")] - public bool? Incognito { get; set; } + public bool? Incognito + { + get + { + InitializeProperty("incognito", _incognito); + return _incognito; + } + set + { + _incognito = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/WebRequest/ResourceType.cs b/src/WebExtension.Net/Generated/WebRequest/ResourceType.cs index 0220481..bbc384e 100644 --- a/src/WebExtension.Net/Generated/WebRequest/ResourceType.cs +++ b/src/WebExtension.Net/Generated/WebRequest/ResourceType.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/WebRequest/SecurityInfo.cs b/src/WebExtension.Net/Generated/WebRequest/SecurityInfo.cs index ce85a39..2795661 100644 --- a/src/WebExtension.Net/Generated/WebRequest/SecurityInfo.cs +++ b/src/WebExtension.Net/Generated/WebRequest/SecurityInfo.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,113 +10,293 @@ namespace WebExtension.Net.WebRequest /// /// Contains the security properties of the request (ie. SSL/TLS information). /// - public class SecurityInfo + public class SecurityInfo : BaseObject { // Property Definition + private string _state; /// /// /// [JsonPropertyName("state")] - public string State { get; set; } + public string State + { + get + { + InitializeProperty("state", _state); + return _state; + } + set + { + _state = value; + } + } // Property Definition + private string _errorMessage; /// /// Error message if state is "broken" /// [JsonPropertyName("errorMessage")] - public string ErrorMessage { get; set; } + public string ErrorMessage + { + get + { + InitializeProperty("errorMessage", _errorMessage); + return _errorMessage; + } + set + { + _errorMessage = value; + } + } // Property Definition + private string _protocolVersion; /// /// Protocol version if state is "secure" /// [JsonPropertyName("protocolVersion")] - public string ProtocolVersion { get; set; } + public string ProtocolVersion + { + get + { + InitializeProperty("protocolVersion", _protocolVersion); + return _protocolVersion; + } + set + { + _protocolVersion = value; + } + } // Property Definition + private string _cipherSuite; /// /// The cipher suite used in this request if state is "secure". /// [JsonPropertyName("cipherSuite")] - public string CipherSuite { get; set; } + public string CipherSuite + { + get + { + InitializeProperty("cipherSuite", _cipherSuite); + return _cipherSuite; + } + set + { + _cipherSuite = value; + } + } // Property Definition + private string _keaGroupName; /// /// The key exchange algorithm used in this request if state is "secure". /// [JsonPropertyName("keaGroupName")] - public string KeaGroupName { get; set; } + public string KeaGroupName + { + get + { + InitializeProperty("keaGroupName", _keaGroupName); + return _keaGroupName; + } + set + { + _keaGroupName = value; + } + } // Property Definition + private string _signatureSchemeName; /// /// The signature scheme used in this request if state is "secure". /// [JsonPropertyName("signatureSchemeName")] - public string SignatureSchemeName { get; set; } + public string SignatureSchemeName + { + get + { + InitializeProperty("signatureSchemeName", _signatureSchemeName); + return _signatureSchemeName; + } + set + { + _signatureSchemeName = value; + } + } // Property Definition + private IEnumerable _certificates; /// /// Certificate data if state is "secure". Will only contain one entry unless certificateChain is passed as an option. /// [JsonPropertyName("certificates")] - public IEnumerable Certificates { get; set; } + public IEnumerable Certificates + { + get + { + InitializeProperty("certificates", _certificates); + return _certificates; + } + set + { + _certificates = value; + } + } // Property Definition + private bool? _isDomainMismatch; /// /// The domain name does not match the certificate domain. /// [JsonPropertyName("isDomainMismatch")] - public bool? IsDomainMismatch { get; set; } + public bool? IsDomainMismatch + { + get + { + InitializeProperty("isDomainMismatch", _isDomainMismatch); + return _isDomainMismatch; + } + set + { + _isDomainMismatch = value; + } + } // Property Definition + private bool? _isExtendedValidation; /// /// /// [JsonPropertyName("isExtendedValidation")] - public bool? IsExtendedValidation { get; set; } + public bool? IsExtendedValidation + { + get + { + InitializeProperty("isExtendedValidation", _isExtendedValidation); + return _isExtendedValidation; + } + set + { + _isExtendedValidation = value; + } + } // Property Definition + private bool? _isNotValidAtThisTime; /// /// The certificate is either expired or is not yet valid. See CertificateInfo.validity for start and end dates. /// [JsonPropertyName("isNotValidAtThisTime")] - public bool? IsNotValidAtThisTime { get; set; } + public bool? IsNotValidAtThisTime + { + get + { + InitializeProperty("isNotValidAtThisTime", _isNotValidAtThisTime); + return _isNotValidAtThisTime; + } + set + { + _isNotValidAtThisTime = value; + } + } // Property Definition + private bool? _isUntrusted; /// /// /// [JsonPropertyName("isUntrusted")] - public bool? IsUntrusted { get; set; } + public bool? IsUntrusted + { + get + { + InitializeProperty("isUntrusted", _isUntrusted); + return _isUntrusted; + } + set + { + _isUntrusted = value; + } + } // Property Definition + private CertificateTransparencyStatus _certificateTransparencyStatus; /// /// Certificate transparency compliance per RFC 6962. See https://www.certificate-transparency.org/what-is-ct for more information. /// [JsonPropertyName("certificateTransparencyStatus")] - public CertificateTransparencyStatus CertificateTransparencyStatus { get; set; } + public CertificateTransparencyStatus CertificateTransparencyStatus + { + get + { + InitializeProperty("certificateTransparencyStatus", _certificateTransparencyStatus); + return _certificateTransparencyStatus; + } + set + { + _certificateTransparencyStatus = value; + } + } // Property Definition + private bool? _hsts; /// /// True if host uses Strict Transport Security and state is "secure". /// [JsonPropertyName("hsts")] - public bool? Hsts { get; set; } + public bool? Hsts + { + get + { + InitializeProperty("hsts", _hsts); + return _hsts; + } + set + { + _hsts = value; + } + } // Property Definition + private string _hpkp; /// /// True if host uses Public Key Pinning and state is "secure". /// [JsonPropertyName("hpkp")] - public string Hpkp { get; set; } + public string Hpkp + { + get + { + InitializeProperty("hpkp", _hpkp); + return _hpkp; + } + set + { + _hpkp = value; + } + } // Property Definition + private IEnumerable _weaknessReasons; /// /// list of reasons that cause the request to be considered weak, if state is "weak" /// [JsonPropertyName("weaknessReasons")] - public IEnumerable WeaknessReasons { get; set; } + public IEnumerable WeaknessReasons + { + get + { + InitializeProperty("weaknessReasons", _weaknessReasons); + return _weaknessReasons; + } + set + { + _weaknessReasons = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/WebRequest/TransportWeaknessReasons.cs b/src/WebExtension.Net/Generated/WebRequest/TransportWeaknessReasons.cs index 1793299..173daa9 100644 --- a/src/WebExtension.Net/Generated/WebRequest/TransportWeaknessReasons.cs +++ b/src/WebExtension.Net/Generated/WebRequest/TransportWeaknessReasons.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/WebRequest/UploadData.cs b/src/WebExtension.Net/Generated/WebRequest/UploadData.cs index bec7fc6..dcc1aa8 100644 --- a/src/WebExtension.Net/Generated/WebRequest/UploadData.cs +++ b/src/WebExtension.Net/Generated/WebRequest/UploadData.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,22 +10,46 @@ namespace WebExtension.Net.WebRequest /// /// Contains data uploaded in a URL request. /// - public class UploadData + public class UploadData : BaseObject { // Property Definition + private object _bytes; /// /// An ArrayBuffer with a copy of the data. /// [JsonPropertyName("bytes")] - public object Bytes { get; set; } + public object Bytes + { + get + { + InitializeProperty("bytes", _bytes); + return _bytes; + } + set + { + _bytes = value; + } + } // Property Definition + private string _file; /// /// A string with the file's path and name. /// [JsonPropertyName("file")] - public string File { get; set; } + public string File + { + get + { + InitializeProperty("file", _file); + return _file; + } + set + { + _file = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/WebRequest/UrlClassification.cs b/src/WebExtension.Net/Generated/WebRequest/UrlClassification.cs index db3e434..e2c8a4e 100644 --- a/src/WebExtension.Net/Generated/WebRequest/UrlClassification.cs +++ b/src/WebExtension.Net/Generated/WebRequest/UrlClassification.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,22 +10,46 @@ namespace WebExtension.Net.WebRequest /// /// /// - public class UrlClassification + public class UrlClassification : BaseObject { // Property Definition + private UrlClassificationParty _firstParty; /// /// Classification flags if the request has been classified and it is first party. /// [JsonPropertyName("firstParty")] - public UrlClassificationParty FirstParty { get; set; } + public UrlClassificationParty FirstParty + { + get + { + InitializeProperty("firstParty", _firstParty); + return _firstParty; + } + set + { + _firstParty = value; + } + } // Property Definition + private UrlClassificationParty _thirdParty; /// /// Classification flags if the request has been classified and it or its window hierarchy is third party. /// [JsonPropertyName("thirdParty")] - public UrlClassificationParty ThirdParty { get; set; } + public UrlClassificationParty ThirdParty + { + get + { + InitializeProperty("thirdParty", _thirdParty); + return _thirdParty; + } + set + { + _thirdParty = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/WebRequest/UrlClassificationFlags.cs b/src/WebExtension.Net/Generated/WebRequest/UrlClassificationFlags.cs index cf14fae..5330b88 100644 --- a/src/WebExtension.Net/Generated/WebRequest/UrlClassificationFlags.cs +++ b/src/WebExtension.Net/Generated/WebRequest/UrlClassificationFlags.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/WebRequest/UrlClassificationParty.cs b/src/WebExtension.Net/Generated/WebRequest/UrlClassificationParty.cs index 95d59b1..3537eac 100644 --- a/src/WebExtension.Net/Generated/WebRequest/UrlClassificationParty.cs +++ b/src/WebExtension.Net/Generated/WebRequest/UrlClassificationParty.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/WebRequest/WebRequest.json b/src/WebExtension.Net/Generated/WebRequest/WebRequest.json index b770736..ca468e5 100644 --- a/src/WebExtension.Net/Generated/WebRequest/WebRequest.json +++ b/src/WebExtension.Net/Generated/WebRequest/WebRequest.json @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - [ { "namespace": "webRequest", diff --git a/src/WebExtension.Net/Generated/WebRequest/WebRequestAPI.cs b/src/WebExtension.Net/Generated/WebRequest/WebRequestAPI.cs index 69487f1..3cb5db2 100644 --- a/src/WebExtension.Net/Generated/WebRequest/WebRequestAPI.cs +++ b/src/WebExtension.Net/Generated/WebRequest/WebRequestAPI.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -8,24 +6,30 @@ namespace WebExtension.Net.WebRequest { /// - public class WebRequestAPI : IWebRequestAPI + public class WebRequestAPI : BaseAPI, IWebRequestAPI { - private readonly WebExtensionJSRuntime webExtensionJSRuntime; /// Creates a new instance of WebRequestAPI. /// Web Extension JS Runtime - public WebRequestAPI(WebExtensionJSRuntime webExtensionJSRuntime) + public WebRequestAPI(WebExtensionJSRuntime webExtensionJSRuntime) : base(webExtensionJSRuntime, "webRequest") { - this.webExtensionJSRuntime = webExtensionJSRuntime; } + // Property Definition + private const int _MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES = 20; + /// + /// The maximum number of times that handlerBehaviorChanged can be called per 10 minute sustained interval. handlerBehaviorChanged is an expensive function call that shouldn't be called often. + /// + public int MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES => _MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES; + + // Function Definition /// /// Needs to be called when the behavior of the webRequest handlers has changed to prevent incorrect handling due to caching. This function call is expensive. Don't call it often. /// public virtual ValueTask HandlerBehaviorChanged() { - return webExtensionJSRuntime.InvokeVoidAsync("webRequest.handlerBehaviorChanged"); + return InvokeVoidAsync("handlerBehaviorChanged"); } // Function Definition @@ -36,7 +40,7 @@ public virtual ValueTask HandlerBehaviorChanged() /// public virtual ValueTask FilterResponseData(string requestId) { - return webExtensionJSRuntime.InvokeAsync("webRequest.filterResponseData", requestId); + return InvokeAsync("filterResponseData", requestId); } // Function Definition @@ -47,7 +51,7 @@ public virtual ValueTask FilterResponseData(string requestId) /// public virtual ValueTask GetSecurityInfo(string requestId, object options) { - return webExtensionJSRuntime.InvokeVoidAsync("webRequest.getSecurityInfo", requestId, options); + return InvokeVoidAsync("getSecurityInfo", requestId, options); } } } diff --git a/src/WebExtension.Net/Generated/WebRequest/generated.txt b/src/WebExtension.Net/Generated/WebRequest/generated.txt deleted file mode 100644 index e69de29..0000000 diff --git a/src/WebExtension.Net/Generated/Windows/CreateType.cs b/src/WebExtension.Net/Generated/Windows/CreateType.cs index 43b7f9d..da8c7cf 100644 --- a/src/WebExtension.Net/Generated/Windows/CreateType.cs +++ b/src/WebExtension.Net/Generated/Windows/CreateType.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Windows/GetInfo.cs b/src/WebExtension.Net/Generated/Windows/GetInfo.cs index 973512b..2bdd91d 100644 --- a/src/WebExtension.Net/Generated/Windows/GetInfo.cs +++ b/src/WebExtension.Net/Generated/Windows/GetInfo.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,23 +10,47 @@ namespace WebExtension.Net.Windows /// /// Specifies whether the $(ref:windows.Window) returned should contain a list of the $(ref:tabs.Tab) objects. /// - public class GetInfo + public class GetInfo : BaseObject { // Property Definition + private bool? _populate; /// /// 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")] - public bool? Populate { get; set; } + public bool? Populate + { + get + { + InitializeProperty("populate", _populate); + return _populate; + } + set + { + _populate = value; + } + } // Property Definition + private IEnumerable _windowTypes; /// /// windowTypes is deprecated and ignored on Firefox. /// [Obsolete("")] [JsonPropertyName("windowTypes")] - public IEnumerable WindowTypes { get; set; } + public IEnumerable WindowTypes + { + get + { + InitializeProperty("windowTypes", _windowTypes); + return _windowTypes; + } + set + { + _windowTypes = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Windows/IWindowsAPI.cs b/src/WebExtension.Net/Generated/Windows/IWindowsAPI.cs index 5970418..c62f1dc 100644 --- a/src/WebExtension.Net/Generated/Windows/IWindowsAPI.cs +++ b/src/WebExtension.Net/Generated/Windows/IWindowsAPI.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -13,6 +11,19 @@ namespace WebExtension.Net.Windows public interface IWindowsAPI { + // Property Definition Interface + /// + /// The windowId value that represents the absence of a browser window. + /// + int WINDOW_ID_NONE { get; } + + // Property Definition Interface + /// + /// The windowId value that represents the $(topic:current-window)[current window]. + /// + int WINDOW_ID_CURRENT { get; } + + // Function Definition Interface /// /// Gets details about a window. diff --git a/src/WebExtension.Net/Generated/Windows/Window.cs b/src/WebExtension.Net/Generated/Windows/Window.cs index 69b9b84..a013223 100644 --- a/src/WebExtension.Net/Generated/Windows/Window.cs +++ b/src/WebExtension.Net/Generated/Windows/Window.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -12,99 +10,255 @@ namespace WebExtension.Net.Windows /// /// /// - public class Window + public class Window : BaseObject { // Property Definition + private int? _id; /// /// 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")] - public int? Id { get; set; } + public int? Id + { + get + { + InitializeProperty("id", _id); + return _id; + } + set + { + _id = value; + } + } // Property Definition + private bool _focused; /// /// Whether the window is currently the focused window. /// [JsonPropertyName("focused")] - public bool Focused { get; set; } + public bool Focused + { + get + { + InitializeProperty("focused", _focused); + return _focused; + } + set + { + _focused = value; + } + } // Property Definition + private int? _top; /// /// 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")] - public int? Top { get; set; } + public int? Top + { + get + { + InitializeProperty("top", _top); + return _top; + } + set + { + _top = value; + } + } // Property Definition + private int? _left; /// /// 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")] - public int? Left { get; set; } + public int? Left + { + get + { + InitializeProperty("left", _left); + return _left; + } + set + { + _left = value; + } + } // Property Definition + private int? _width; /// /// 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")] - public int? Width { get; set; } + public int? Width + { + get + { + InitializeProperty("width", _width); + return _width; + } + set + { + _width = value; + } + } // Property Definition + private int? _height; /// /// 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")] - public int? Height { get; set; } + public int? Height + { + get + { + InitializeProperty("height", _height); + return _height; + } + set + { + _height = value; + } + } // Property Definition + private IEnumerable _tabs; /// /// Array of $(ref:tabs.Tab) objects representing the current tabs in the window. /// [JsonPropertyName("tabs")] - public IEnumerable Tabs { get; set; } + public IEnumerable Tabs + { + get + { + InitializeProperty("tabs", _tabs); + return _tabs; + } + set + { + _tabs = value; + } + } // Property Definition + private bool _incognito; /// /// Whether the window is incognito. /// [JsonPropertyName("incognito")] - public bool Incognito { get; set; } + public bool Incognito + { + get + { + InitializeProperty("incognito", _incognito); + return _incognito; + } + set + { + _incognito = value; + } + } // Property Definition + private WindowType _type; /// /// The type of browser window this is. /// [JsonPropertyName("type")] - public WindowType Type { get; set; } + public WindowType Type + { + get + { + InitializeProperty("type", _type); + return _type; + } + set + { + _type = value; + } + } // Property Definition + private WindowState _state; /// /// The state of this browser window. /// [JsonPropertyName("state")] - public WindowState State { get; set; } + public WindowState State + { + get + { + InitializeProperty("state", _state); + return _state; + } + set + { + _state = value; + } + } // Property Definition + private bool _alwaysOnTop; /// /// Whether the window is set to be always on top. /// [JsonPropertyName("alwaysOnTop")] - public bool AlwaysOnTop { get; set; } + public bool AlwaysOnTop + { + get + { + InitializeProperty("alwaysOnTop", _alwaysOnTop); + return _alwaysOnTop; + } + set + { + _alwaysOnTop = value; + } + } // Property Definition + private string _sessionId; /// /// The session ID used to uniquely identify a Window obtained from the $(ref:sessions) API. /// [JsonPropertyName("sessionId")] - public string SessionId { get; set; } + public string SessionId + { + get + { + InitializeProperty("sessionId", _sessionId); + return _sessionId; + } + set + { + _sessionId = value; + } + } // Property Definition + private string _title; /// /// The title of the window. Read-only. /// [JsonPropertyName("title")] - public string Title { get; set; } + public string Title + { + get + { + InitializeProperty("title", _title); + return _title; + } + set + { + _title = value; + } + } } } diff --git a/src/WebExtension.Net/Generated/Windows/WindowState.cs b/src/WebExtension.Net/Generated/Windows/WindowState.cs index 7f8e7eb..8db05c3 100644 --- a/src/WebExtension.Net/Generated/Windows/WindowState.cs +++ b/src/WebExtension.Net/Generated/Windows/WindowState.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Windows/WindowType.cs b/src/WebExtension.Net/Generated/Windows/WindowType.cs index edad9d2..e4ffd30 100644 --- a/src/WebExtension.Net/Generated/Windows/WindowType.cs +++ b/src/WebExtension.Net/Generated/Windows/WindowType.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; diff --git a/src/WebExtension.Net/Generated/Windows/Windows.json b/src/WebExtension.Net/Generated/Windows/Windows.json index 872da14..2de059f 100644 --- a/src/WebExtension.Net/Generated/Windows/Windows.json +++ b/src/WebExtension.Net/Generated/Windows/Windows.json @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - [ { "namespace": "windows", diff --git a/src/WebExtension.Net/Generated/Windows/WindowsAPI.cs b/src/WebExtension.Net/Generated/Windows/WindowsAPI.cs index d9eb696..2d3bb57 100644 --- a/src/WebExtension.Net/Generated/Windows/WindowsAPI.cs +++ b/src/WebExtension.Net/Generated/Windows/WindowsAPI.cs @@ -1,5 +1,3 @@ -// This file is auto generated at 2021-03-24T04:51:22 - using System; using System.Collections.Generic; using System.Text.Json; @@ -8,17 +6,30 @@ namespace WebExtension.Net.Windows { /// - public class WindowsAPI : IWindowsAPI + public class WindowsAPI : BaseAPI, IWindowsAPI { - private readonly WebExtensionJSRuntime webExtensionJSRuntime; /// Creates a new instance of WindowsAPI. /// Web Extension JS Runtime - public WindowsAPI(WebExtensionJSRuntime webExtensionJSRuntime) + public WindowsAPI(WebExtensionJSRuntime webExtensionJSRuntime) : base(webExtensionJSRuntime, "windows") { - this.webExtensionJSRuntime = webExtensionJSRuntime; } + // Property Definition + private const int _WINDOW_ID_NONE = -1; + /// + /// The windowId value that represents the absence of a browser window. + /// + public int WINDOW_ID_NONE => _WINDOW_ID_NONE; + + // Property Definition + private const int _WINDOW_ID_CURRENT = -2; + /// + /// The windowId value that represents the $(topic:current-window)[current window]. + /// + public int WINDOW_ID_CURRENT => _WINDOW_ID_CURRENT; + + // Function Definition /// /// Gets details about a window. @@ -28,7 +39,7 @@ public WindowsAPI(WebExtensionJSRuntime webExtensionJSRuntime) /// public virtual ValueTask Get(int windowId, GetInfo getInfo) { - return webExtensionJSRuntime.InvokeAsync("windows.get", windowId, getInfo); + return InvokeAsync("get", windowId, getInfo); } // Function Definition @@ -39,7 +50,7 @@ public virtual ValueTask Get(int windowId, GetInfo getInfo) /// public virtual ValueTask GetCurrent(GetInfo getInfo) { - return webExtensionJSRuntime.InvokeAsync("windows.getCurrent", getInfo); + return InvokeAsync("getCurrent", getInfo); } // Function Definition @@ -50,7 +61,7 @@ public virtual ValueTask GetCurrent(GetInfo getInfo) /// public virtual ValueTask GetLastFocused(GetInfo getInfo) { - return webExtensionJSRuntime.InvokeAsync("windows.getLastFocused", getInfo); + return InvokeAsync("getLastFocused", getInfo); } // Function Definition @@ -61,7 +72,7 @@ public virtual ValueTask GetLastFocused(GetInfo getInfo) /// public virtual ValueTask> GetAll(object getInfo) { - return webExtensionJSRuntime.InvokeAsync>("windows.getAll", getInfo); + return InvokeAsync>("getAll", getInfo); } // Function Definition @@ -72,7 +83,7 @@ public virtual ValueTask> GetAll(object getInfo) /// public virtual ValueTask Create(object createData) { - return webExtensionJSRuntime.InvokeAsync("windows.create", createData); + return InvokeAsync("create", createData); } // Function Definition @@ -84,7 +95,7 @@ public virtual ValueTask Create(object createData) /// public virtual ValueTask Update(int windowId, object updateInfo) { - return webExtensionJSRuntime.InvokeAsync("windows.update", windowId, updateInfo); + return InvokeAsync("update", windowId, updateInfo); } // Function Definition @@ -94,7 +105,7 @@ public virtual ValueTask Update(int windowId, object updateInfo) /// public virtual ValueTask Remove(int windowId) { - return webExtensionJSRuntime.InvokeVoidAsync("windows.remove", windowId); + return InvokeVoidAsync("remove", windowId); } } } diff --git a/src/WebExtension.Net/Generated/Windows/generated.txt b/src/WebExtension.Net/Generated/Windows/generated.txt index e69de29..a7fc8fc 100644 --- a/src/WebExtension.Net/Generated/Windows/generated.txt +++ b/src/WebExtension.Net/Generated/Windows/generated.txt @@ -0,0 +1 @@ +This file is auto generated at 2021-03-26T07:08:47 \ No newline at end of file