diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6fc20f0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +bin/ +libs/ +node_modules/ +*.zip +.DS_Store diff --git a/.haxerc b/.haxerc new file mode 100644 index 0000000..dc3cec2 --- /dev/null +++ b/.haxerc @@ -0,0 +1,4 @@ +{ + "version": "4.3.1", + "resolveLibs": "scoped" +} \ No newline at end of file diff --git a/build.hxml b/build.hxml new file mode 100644 index 0000000..9d36797 --- /dev/null +++ b/build.hxml @@ -0,0 +1,14 @@ +-lib kiss +-lib kiss-firefox +-cp externs +-cp src +-dce full +--each + +--main shortcutter.Main +--js bin/main.js +--next + +--main shortcutter.Background +--js bin/background.js +-cmd cp node_modules/webextension-polyfill/dist/browser-polyfill.js* bin/ && zip -r shortcutter.zip . -x *.git* -x *.hxml -x *.zip -x src/\* -x node_modules/\* -x libs/\* -x test.sh -x externs/\* \ No newline at end of file diff --git a/externs/WebextensionPolyfill.hx b/externs/WebextensionPolyfill.hx new file mode 100644 index 0000000..429b067 --- /dev/null +++ b/externs/WebextensionPolyfill.hx @@ -0,0 +1,57 @@ +@:jsRequire("webextension-polyfill") @valueModuleOnly extern class WebextensionPolyfill { + static final activityLog : webextension_polyfill.activitylog.Static; + static final alarms : webextension_polyfill.alarms.Static; + static final bookmarks : webextension_polyfill.bookmarks.Static; + static final action : webextension_polyfill.action.Static; + static final browserAction : webextension_polyfill.browseraction.Static; + static final browserSettings : webextension_polyfill.browsersettings.Static; + static final browsingData : webextension_polyfill.browsingdata.Static; + static final captivePortal : webextension_polyfill.captiveportal.Static; + static final clipboard : webextension_polyfill.clipboard.Static; + static final commands : webextension_polyfill.commands.Static; + static final contentScripts : webextension_polyfill.contentscripts.Static; + static final contextualIdentities : webextension_polyfill.contextualidentities.Static; + static final cookies : webextension_polyfill.cookies.Static; + static final declarativeNetRequest : webextension_polyfill.declarativenetrequest.Static; + static final devtools : webextension_polyfill.devtools.Static; + static final dns : webextension_polyfill.dns.Static; + static final downloads : webextension_polyfill.downloads.Static; + static final events : webextension_polyfill.events.Static; + static final experiments : webextension_polyfill.experiments.Static; + static final extension : webextension_polyfill.extension.Static; + static final extensionTypes : webextension_polyfill.extensiontypes.Static; + static final find : webextension_polyfill.find.Static; + static final geckoProfiler : webextension_polyfill.geckoprofiler.Static; + static final history : webextension_polyfill.history.Static; + static final i18n : webextension_polyfill.i18n.Static; + static final identity : webextension_polyfill.identity.Static; + static final idle : webextension_polyfill.idle.Static; + static final management : webextension_polyfill.management.Static; + static final manifest : webextension_polyfill.manifest.Static; + static final contextMenus : webextension_polyfill.contextmenus.Static; + static final menus : webextension_polyfill.menus.Static; + static final networkStatus : webextension_polyfill.networkstatus.Static; + static final normandyAddonStudy : webextension_polyfill.normandyaddonstudy.Static; + static final notifications : webextension_polyfill.notifications.Static; + static final omnibox : webextension_polyfill.omnibox.Static; + static final pageAction : webextension_polyfill.pageaction.Static; + static final permissions : webextension_polyfill.permissions.Static; + static final pkcs11 : webextension_polyfill.pkcs11.Static; + static final privacy : webextension_polyfill.privacy.Static; + static final proxy : webextension_polyfill.proxy.Static; + static final runtime : webextension_polyfill.runtime.Static; + static final scripting : webextension_polyfill.scripting.Static; + static final search : webextension_polyfill.search.Static; + static final sessions : webextension_polyfill.sessions.Static; + static final sidebarAction : webextension_polyfill.sidebaraction.Static; + static final storage : webextension_polyfill.storage.Static; + static final tabs : webextension_polyfill.tabs.Static; + static final theme : webextension_polyfill.theme.Static; + static final topSites : webextension_polyfill.topsites.Static; + static final types : webextension_polyfill.types.Static; + static final urlbar : webextension_polyfill.urlbar.Static; + static final userScripts : webextension_polyfill.userscripts.Static; + static final webNavigation : webextension_polyfill.webnavigation.Static; + static final webRequest : webextension_polyfill.webrequest.Static; + static final windows : webextension_polyfill.windows.Static; +} \ No newline at end of file diff --git a/externs/ts/AnyOf2.hx b/externs/ts/AnyOf2.hx new file mode 100644 index 0000000..cc5aa9d --- /dev/null +++ b/externs/ts/AnyOf2.hx @@ -0,0 +1,11 @@ +package ts; + +/** + AnyOf implementation generated by dts2hx +**/ +@:transitive extern abstract AnyOf2(Dynamic) from T0 from T1 to T0 to T1 { + var asType0(get, never) : T0; + private inline function get_asType0():T0 return this; + var asType1(get, never) : T1; + private inline function get_asType1():T1 return this; +} \ No newline at end of file diff --git a/externs/ts/AnyOf3.hx b/externs/ts/AnyOf3.hx new file mode 100644 index 0000000..2061cc9 --- /dev/null +++ b/externs/ts/AnyOf3.hx @@ -0,0 +1,13 @@ +package ts; + +/** + AnyOf implementation generated by dts2hx +**/ +@:transitive extern abstract AnyOf3(Dynamic) from T0 from T1 from T2 to T0 to T1 to T2 { + var asType0(get, never) : T0; + private inline function get_asType0():T0 return this; + var asType1(get, never) : T1; + private inline function get_asType1():T1 return this; + var asType2(get, never) : T2; + private inline function get_asType2():T2 return this; +} \ No newline at end of file diff --git a/externs/ts/Tuple1.hx b/externs/ts/Tuple1.hx new file mode 100644 index 0000000..3196a44 --- /dev/null +++ b/externs/ts/Tuple1.hx @@ -0,0 +1,13 @@ +package ts; + +/** + Tuple type implementation generated by dts2hx +**/ +@:forward @:forwardStatics extern abstract Tuple1(std.Array) from std.Array to std.Array { + public inline function new(element0:T0) { + this = [element0]; + } + public var element0(get, set) : T0; + inline function get_element0():T0 return cast this[0]; + inline function set_element0(v:T0):T0 return cast this[0] = cast v; +} \ No newline at end of file diff --git a/externs/ts/Tuple2.hx b/externs/ts/Tuple2.hx new file mode 100644 index 0000000..0931f74 --- /dev/null +++ b/externs/ts/Tuple2.hx @@ -0,0 +1,16 @@ +package ts; + +/** + Tuple type implementation generated by dts2hx +**/ +@:forward @:forwardStatics extern abstract Tuple2(std.Array) from std.Array to std.Array { + public inline function new(element0:T0, element1:T1) { + this = [element0, element1]; + } + public var element0(get, set) : T0; + inline function get_element0():T0 return cast this[0]; + inline function set_element0(v:T0):T0 return cast this[0] = cast v; + public var element1(get, set) : T1; + inline function get_element1():T1 return cast this[1]; + inline function set_element1(v:T1):T1 return cast this[1] = cast v; +} \ No newline at end of file diff --git a/externs/ts/Tuple3.hx b/externs/ts/Tuple3.hx new file mode 100644 index 0000000..712a6d7 --- /dev/null +++ b/externs/ts/Tuple3.hx @@ -0,0 +1,19 @@ +package ts; + +/** + Tuple type implementation generated by dts2hx +**/ +@:forward @:forwardStatics extern abstract Tuple3(std.Array) from std.Array to std.Array { + public inline function new(element0:T0, element1:T1, element2:T2) { + this = [element0, element1, element2]; + } + public var element0(get, set) : T0; + inline function get_element0():T0 return cast this[0]; + inline function set_element0(v:T0):T0 return cast this[0] = cast v; + public var element1(get, set) : T1; + inline function get_element1():T1 return cast this[1]; + inline function set_element1(v:T1):T1 return cast this[1] = cast v; + public var element2(get, set) : T2; + inline function get_element2():T2 return cast this[2]; + inline function set_element2(v:T2):T2 return cast this[2] = cast v; +} \ No newline at end of file diff --git a/externs/ts/Tuple4.hx b/externs/ts/Tuple4.hx new file mode 100644 index 0000000..84cf893 --- /dev/null +++ b/externs/ts/Tuple4.hx @@ -0,0 +1,22 @@ +package ts; + +/** + Tuple type implementation generated by dts2hx +**/ +@:forward @:forwardStatics extern abstract Tuple4(std.Array) from std.Array to std.Array { + public inline function new(element0:T0, element1:T1, element2:T2, element3:T3) { + this = [element0, element1, element2, element3]; + } + public var element0(get, set) : T0; + inline function get_element0():T0 return cast this[0]; + inline function set_element0(v:T0):T0 return cast this[0] = cast v; + public var element1(get, set) : T1; + inline function get_element1():T1 return cast this[1]; + inline function set_element1(v:T1):T1 return cast this[1] = cast v; + public var element2(get, set) : T2; + inline function get_element2():T2 return cast this[2]; + inline function set_element2(v:T2):T2 return cast this[2] = cast v; + public var element3(get, set) : T3; + inline function get_element3():T3 return cast this[3]; + inline function set_element3(v:T3):T3 return cast this[3] = cast v; +} \ No newline at end of file diff --git a/externs/ts/Undefined.hx b/externs/ts/Undefined.hx new file mode 100644 index 0000000..dd1e17c --- /dev/null +++ b/externs/ts/Undefined.hx @@ -0,0 +1,6 @@ +package ts; + +/** + `Undefined` corresponds to `void` in TypeScript; in haxe `Void` cannot be used as a field type (only function return) so we must use `Any` instead. This alias serves as documentation that the type is `void` and therefore value is `undefined` +**/ +typedef Undefined = Any; \ No newline at end of file diff --git a/externs/webextension_polyfill/Browser.hx b/externs/webextension_polyfill/Browser.hx new file mode 100644 index 0000000..4e4f872 --- /dev/null +++ b/externs/webextension_polyfill/Browser.hx @@ -0,0 +1,59 @@ +package webextension_polyfill; + +typedef Browser = { + var activityLog : webextension_polyfill.activitylog.Static; + var alarms : webextension_polyfill.alarms.Static; + var bookmarks : webextension_polyfill.bookmarks.Static; + var action : webextension_polyfill.action.Static; + var browserAction : webextension_polyfill.browseraction.Static; + var browserSettings : webextension_polyfill.browsersettings.Static; + var browsingData : webextension_polyfill.browsingdata.Static; + var captivePortal : webextension_polyfill.captiveportal.Static; + var clipboard : webextension_polyfill.clipboard.Static; + var commands : webextension_polyfill.commands.Static; + var contentScripts : webextension_polyfill.contentscripts.Static; + var contextualIdentities : webextension_polyfill.contextualidentities.Static; + var cookies : webextension_polyfill.cookies.Static; + var declarativeNetRequest : webextension_polyfill.declarativenetrequest.Static; + var devtools : webextension_polyfill.devtools.Static; + var dns : webextension_polyfill.dns.Static; + var downloads : webextension_polyfill.downloads.Static; + var events : webextension_polyfill.events.Static; + var experiments : webextension_polyfill.experiments.Static; + var extension : webextension_polyfill.extension.Static; + var extensionTypes : webextension_polyfill.extensiontypes.Static; + var find : webextension_polyfill.find.Static; + var geckoProfiler : webextension_polyfill.geckoprofiler.Static; + var history : webextension_polyfill.history.Static; + var i18n : webextension_polyfill.i18n.Static; + var identity : webextension_polyfill.identity.Static; + var idle : webextension_polyfill.idle.Static; + var management : webextension_polyfill.management.Static; + var manifest : webextension_polyfill.manifest.Static; + var contextMenus : webextension_polyfill.contextmenus.Static; + var menus : webextension_polyfill.menus.Static; + var networkStatus : webextension_polyfill.networkstatus.Static; + var normandyAddonStudy : webextension_polyfill.normandyaddonstudy.Static; + var notifications : webextension_polyfill.notifications.Static; + var omnibox : webextension_polyfill.omnibox.Static; + var pageAction : webextension_polyfill.pageaction.Static; + var permissions : webextension_polyfill.permissions.Static; + var pkcs11 : webextension_polyfill.pkcs11.Static; + var privacy : webextension_polyfill.privacy.Static; + var proxy : webextension_polyfill.proxy.Static; + var runtime : webextension_polyfill.runtime.Static; + var scripting : webextension_polyfill.scripting.Static; + var search : webextension_polyfill.search.Static; + var sessions : webextension_polyfill.sessions.Static; + var sidebarAction : webextension_polyfill.sidebaraction.Static; + var storage : webextension_polyfill.storage.Static; + var tabs : webextension_polyfill.tabs.Static; + var theme : webextension_polyfill.theme.Static; + var topSites : webextension_polyfill.topsites.Static; + var types : webextension_polyfill.types.Static; + var urlbar : webextension_polyfill.urlbar.Static; + var userScripts : webextension_polyfill.userscripts.Static; + var webNavigation : webextension_polyfill.webnavigation.Static; + var webRequest : webextension_polyfill.webrequest.Static; + var windows : webextension_polyfill.windows.Static; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/action/ColorArray.hx b/externs/webextension_polyfill/action/ColorArray.hx new file mode 100644 index 0000000..3ee5923 --- /dev/null +++ b/externs/webextension_polyfill/action/ColorArray.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.action; + +typedef ColorArray = ts.Tuple4; \ No newline at end of file diff --git a/externs/webextension_polyfill/action/ColorValue.hx b/externs/webextension_polyfill/action/ColorValue.hx new file mode 100644 index 0000000..ac0763e --- /dev/null +++ b/externs/webextension_polyfill/action/ColorValue.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.action; + +/** + An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, + opaque red is [255, 0, 0, 255]. Can also be a string with a CSS value, with opaque red being + #FF0000 or #F00. +**/ +typedef ColorValue = Null>; \ No newline at end of file diff --git a/externs/webextension_polyfill/action/Details.hx b/externs/webextension_polyfill/action/Details.hx new file mode 100644 index 0000000..c6bcfd0 --- /dev/null +++ b/externs/webextension_polyfill/action/Details.hx @@ -0,0 +1,23 @@ +package webextension_polyfill.action; + +/** + Specifies to which tab or window the value should be set, or from which one it should be retrieved. + If no tab nor window is specified, the global value is set or retrieved. +**/ +typedef Details = { + /** + When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. + When getting, specifies the tab to get the value from; if there is no tab-specific value, + the window one will be inherited. + Optional. + **/ + @:optional + var tabId : Float; + /** + When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value + from; if there is no window-specific value, the global one will be inherited. + Optional. + **/ + @:optional + var windowId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/action/GetUserSettingsCallbackUserSettingsType.hx b/externs/webextension_polyfill/action/GetUserSettingsCallbackUserSettingsType.hx new file mode 100644 index 0000000..a15786b --- /dev/null +++ b/externs/webextension_polyfill/action/GetUserSettingsCallbackUserSettingsType.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.action; + +/** + The collection of user-specified settings relating to an extension's action. +**/ +typedef GetUserSettingsCallbackUserSettingsType = { + /** + Whether the extension's action icon is visible on browser windows' top-level toolbar (i.e., + whether the extension has been 'pinned' by the user). + Optional. + **/ + @:optional + var isOnToolbar : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/action/ImageDataType.hx b/externs/webextension_polyfill/action/ImageDataType.hx new file mode 100644 index 0000000..d58cbb5 --- /dev/null +++ b/externs/webextension_polyfill/action/ImageDataType.hx @@ -0,0 +1,19 @@ +package webextension_polyfill.action; + +/** + Pixel data for an image. Must be an ImageData object (for example, from a canvas element). +**/ +typedef ImageDataType = { + /** + Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255. + **/ + final data : js.lib.Uint8ClampedArray; + /** + Returns the actual dimensions of the data in the ImageData object, in pixels. + **/ + final height : Float; + /** + Returns the actual dimensions of the data in the ImageData object, in pixels. + **/ + final width : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/action/OnClickData.hx b/externs/webextension_polyfill/action/OnClickData.hx new file mode 100644 index 0000000..337b345 --- /dev/null +++ b/externs/webextension_polyfill/action/OnClickData.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.action; + +/** + Information sent when a browser action is clicked. +**/ +typedef OnClickData = { + /** + An array of keyboard modifiers that were held while the menu item was clicked. + **/ + var modifiers : Array; + /** + An integer value of button by which menu item was clicked. + Optional. + **/ + @:optional + var button : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/action/OnClickDataModifiersItemEnum.hx b/externs/webextension_polyfill/action/OnClickDataModifiersItemEnum.hx new file mode 100644 index 0000000..531867a --- /dev/null +++ b/externs/webextension_polyfill/action/OnClickDataModifiersItemEnum.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.action; + +typedef OnClickDataModifiersItemEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/action/OpenPopupOptionsType.hx b/externs/webextension_polyfill/action/OpenPopupOptionsType.hx new file mode 100644 index 0000000..e31decd --- /dev/null +++ b/externs/webextension_polyfill/action/OpenPopupOptionsType.hx @@ -0,0 +1,13 @@ +package webextension_polyfill.action; + +/** + An object with information about the popup to open. +**/ +typedef OpenPopupOptionsType = { + /** + Defaults to the $(topic:current-window)[current window]. + Optional. + **/ + @:optional + var windowId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/action/SetBadgeBackgroundColorDetailsType.hx b/externs/webextension_polyfill/action/SetBadgeBackgroundColorDetailsType.hx new file mode 100644 index 0000000..8bb563e --- /dev/null +++ b/externs/webextension_polyfill/action/SetBadgeBackgroundColorDetailsType.hx @@ -0,0 +1,20 @@ +package webextension_polyfill.action; + +typedef SetBadgeBackgroundColorDetailsType = { + var color : ColorValue; + /** + When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. + When getting, specifies the tab to get the value from; if there is no tab-specific value, + the window one will be inherited. + Optional. + **/ + @:optional + var tabId : Float; + /** + When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value + from; if there is no window-specific value, the global one will be inherited. + Optional. + **/ + @:optional + var windowId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/action/SetBadgeTextColorDetailsType.hx b/externs/webextension_polyfill/action/SetBadgeTextColorDetailsType.hx new file mode 100644 index 0000000..0bbd537 --- /dev/null +++ b/externs/webextension_polyfill/action/SetBadgeTextColorDetailsType.hx @@ -0,0 +1,20 @@ +package webextension_polyfill.action; + +typedef SetBadgeTextColorDetailsType = { + var color : ColorValue; + /** + When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. + When getting, specifies the tab to get the value from; if there is no tab-specific value, + the window one will be inherited. + Optional. + **/ + @:optional + var tabId : Float; + /** + When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value + from; if there is no window-specific value, the global one will be inherited. + Optional. + **/ + @:optional + var windowId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/action/SetBadgeTextDetailsType.hx b/externs/webextension_polyfill/action/SetBadgeTextDetailsType.hx new file mode 100644 index 0000000..3359602 --- /dev/null +++ b/externs/webextension_polyfill/action/SetBadgeTextDetailsType.hx @@ -0,0 +1,23 @@ +package webextension_polyfill.action; + +typedef SetBadgeTextDetailsType = { + /** + Any number of characters can be passed, but only about four can fit in the space. + **/ + var text : Null; + /** + When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. + When getting, specifies the tab to get the value from; if there is no tab-specific value, + the window one will be inherited. + Optional. + **/ + @:optional + var tabId : Float; + /** + When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value + from; if there is no window-specific value, the global one will be inherited. + Optional. + **/ + @:optional + var windowId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/action/SetIconDetailsType.hx b/externs/webextension_polyfill/action/SetIconDetailsType.hx new file mode 100644 index 0000000..78c884f --- /dev/null +++ b/externs/webextension_polyfill/action/SetIconDetailsType.hx @@ -0,0 +1,40 @@ +package webextension_polyfill.action; + +typedef SetIconDetailsType = { + /** + Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. + If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. + If the number of image pixels that fit into one screen space unit equals scale, then image with size + scale * 19 will be selected. Initially only scales 1 and 2 will be supported. + At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details. + imageData = {'19': foo}' + Optional. + **/ + @:optional + var imageData : ts.AnyOf2>; + /** + Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. + If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. + If the number of image pixels that fit into one screen space unit equals scale, then image with size + scale * 19 will be selected. Initially only scales 1 and 2 will be supported. + At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}' + Optional. + **/ + @:optional + var path : ts.AnyOf2>; + /** + When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. + When getting, specifies the tab to get the value from; if there is no tab-specific value, + the window one will be inherited. + Optional. + **/ + @:optional + var tabId : Float; + /** + When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value + from; if there is no window-specific value, the global one will be inherited. + Optional. + **/ + @:optional + var windowId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/action/SetPopupDetailsType.hx b/externs/webextension_polyfill/action/SetPopupDetailsType.hx new file mode 100644 index 0000000..e0ae669 --- /dev/null +++ b/externs/webextension_polyfill/action/SetPopupDetailsType.hx @@ -0,0 +1,23 @@ +package webextension_polyfill.action; + +typedef SetPopupDetailsType = { + /** + The html file to show in a popup. If set to the empty string (''), no popup is shown. + **/ + var popup : Null; + /** + When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. + When getting, specifies the tab to get the value from; if there is no tab-specific value, + the window one will be inherited. + Optional. + **/ + @:optional + var tabId : Float; + /** + When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value + from; if there is no window-specific value, the global one will be inherited. + Optional. + **/ + @:optional + var windowId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/action/SetTitleDetailsType.hx b/externs/webextension_polyfill/action/SetTitleDetailsType.hx new file mode 100644 index 0000000..51fae4d --- /dev/null +++ b/externs/webextension_polyfill/action/SetTitleDetailsType.hx @@ -0,0 +1,23 @@ +package webextension_polyfill.action; + +typedef SetTitleDetailsType = { + /** + The string the browser action should display when moused over. + **/ + var title : Null; + /** + When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. + When getting, specifies the tab to get the value from; if there is no tab-specific value, + the window one will be inherited. + Optional. + **/ + @:optional + var tabId : Float; + /** + When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value + from; if there is no window-specific value, the global one will be inherited. + Optional. + **/ + @:optional + var windowId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/action/Static.hx b/externs/webextension_polyfill/action/Static.hx new file mode 100644 index 0000000..7926c14 --- /dev/null +++ b/externs/webextension_polyfill/action/Static.hx @@ -0,0 +1,75 @@ +package webextension_polyfill.action; + +typedef Static = { + /** + Sets the title of the browser action. This shows up in the tooltip. + **/ + function setTitle(details:SetTitleDetailsType):js.lib.Promise; + /** + Gets the title of the browser action. + **/ + function getTitle(details:Details):js.lib.Promise; + /** + Returns the user-specified settings relating to an extension's action. + **/ + function getUserSettings():js.lib.Promise; + /** + Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data + from a canvas element, or as dictionary of either one of those. Either the path or the imageData + property must be specified. + **/ + function setIcon(details:SetIconDetailsType):js.lib.Promise; + /** + Sets the html document to be opened as a popup when the user clicks on the browser action's icon. + **/ + function setPopup(details:SetPopupDetailsType):js.lib.Promise; + /** + Gets the html document set as the popup for this browser action. + **/ + function getPopup(details:Details):js.lib.Promise; + /** + Sets the badge text for the browser action. The badge is displayed on top of the icon. + **/ + function setBadgeText(details:SetBadgeTextDetailsType):js.lib.Promise; + /** + Gets the badge text of the browser action. If no tab nor window is specified is specified, + the global badge text is returned. + **/ + function getBadgeText(details:Details):js.lib.Promise; + /** + Sets the background color for the badge. + **/ + function setBadgeBackgroundColor(details:SetBadgeBackgroundColorDetailsType):js.lib.Promise; + /** + Gets the background color of the browser action badge. + **/ + function getBadgeBackgroundColor(details:Details):js.lib.Promise; + /** + Sets the text color for the badge. + **/ + function setBadgeTextColor(details:SetBadgeTextColorDetailsType):Void; + /** + Gets the text color of the browser action badge. + **/ + function getBadgeTextColor(details:Details):Void; + /** + Enables the browser action for a tab. By default, browser actions are enabled. + **/ + function enable(?tabId:Float):js.lib.Promise; + /** + Disables the browser action for a tab. + **/ + function disable(?tabId:Float):js.lib.Promise; + /** + Checks whether the browser action is enabled. + **/ + function isEnabled(details:Details):js.lib.Promise; + /** + Opens the extension popup window in the specified window. + **/ + function openPopup(?options:OpenPopupOptionsType):js.lib.Promise; + /** + Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup. + **/ + var onClicked : webextension_polyfill.events.Event<(tab:webextension_polyfill.tabs.Tab, info:Null) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/activitylog/OnExtensionActivityDetailsType.hx b/externs/webextension_polyfill/activitylog/OnExtensionActivityDetailsType.hx new file mode 100644 index 0000000..6b0fe4a --- /dev/null +++ b/externs/webextension_polyfill/activitylog/OnExtensionActivityDetailsType.hx @@ -0,0 +1,24 @@ +package webextension_polyfill.activitylog; + +typedef OnExtensionActivityDetailsType = { + /** + The date string when this call is triggered. + **/ + var timeStamp : webextension_polyfill.extensiontypes.DateType; + /** + The type of log entry. api_call is a function call made by the extension and api_event is an event callback to the + extension. content_script is logged when a content script is injected. + **/ + var type : OnExtensionActivityDetailsTypeTypeEnum; + /** + The type of view where the activity occurred. Content scripts will not have a viewType. + Optional. + **/ + @:optional + var viewType : OnExtensionActivityDetailsTypeViewTypeEnum; + /** + The name of the api call or event, or the script url if this is a content or user script event. + **/ + var name : String; + var data : OnExtensionActivityDetailsTypeDataType; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/activitylog/OnExtensionActivityDetailsTypeDataResultType.hx b/externs/webextension_polyfill/activitylog/OnExtensionActivityDetailsTypeDataResultType.hx new file mode 100644 index 0000000..a0e6e4f --- /dev/null +++ b/externs/webextension_polyfill/activitylog/OnExtensionActivityDetailsTypeDataResultType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.activitylog; + +/** + The result of the call. +**/ +typedef OnExtensionActivityDetailsTypeDataResultType = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/activitylog/OnExtensionActivityDetailsTypeDataType.hx b/externs/webextension_polyfill/activitylog/OnExtensionActivityDetailsTypeDataType.hx new file mode 100644 index 0000000..f9d8709 --- /dev/null +++ b/externs/webextension_polyfill/activitylog/OnExtensionActivityDetailsTypeDataType.hx @@ -0,0 +1,28 @@ +package webextension_polyfill.activitylog; + +typedef OnExtensionActivityDetailsTypeDataType = { + /** + A list of arguments passed to the call. + Optional. + **/ + @:optional + var args : Array; + /** + The result of the call. + Optional. + **/ + @:optional + var result : OnExtensionActivityDetailsTypeDataResultType; + /** + The tab associated with this event if it is a tab or content script. + Optional. + **/ + @:optional + var tabId : Float; + /** + If the type is content_script, this is the url of the script that was injected. + Optional. + **/ + @:optional + var url : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/activitylog/OnExtensionActivityDetailsTypeTypeEnum.hx b/externs/webextension_polyfill/activitylog/OnExtensionActivityDetailsTypeTypeEnum.hx new file mode 100644 index 0000000..9b0965b --- /dev/null +++ b/externs/webextension_polyfill/activitylog/OnExtensionActivityDetailsTypeTypeEnum.hx @@ -0,0 +1,7 @@ +package webextension_polyfill.activitylog; + +/** + The type of log entry. api_call is a function call made by the extension and api_event is an event callback to the + extension. content_script is logged when a content script is injected. +**/ +typedef OnExtensionActivityDetailsTypeTypeEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/activitylog/OnExtensionActivityDetailsTypeViewTypeEnum.hx b/externs/webextension_polyfill/activitylog/OnExtensionActivityDetailsTypeViewTypeEnum.hx new file mode 100644 index 0000000..c4aa246 --- /dev/null +++ b/externs/webextension_polyfill/activitylog/OnExtensionActivityDetailsTypeViewTypeEnum.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.activitylog; + +/** + The type of view where the activity occurred. Content scripts will not have a viewType. +**/ +typedef OnExtensionActivityDetailsTypeViewTypeEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/activitylog/OnExtensionActivityEvent.hx b/externs/webextension_polyfill/activitylog/OnExtensionActivityEvent.hx new file mode 100644 index 0000000..49cf97f --- /dev/null +++ b/externs/webextension_polyfill/activitylog/OnExtensionActivityEvent.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.activitylog; + +/** + Receives an activityItem for each logging event. +**/ +typedef OnExtensionActivityEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnExtensionActivityDetailsType) -> Void, id:String):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnExtensionActivityDetailsType) -> Void):Void; + function hasListener(callback:(details:OnExtensionActivityDetailsType) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/activitylog/Static.hx b/externs/webextension_polyfill/activitylog/Static.hx new file mode 100644 index 0000000..8aba581 --- /dev/null +++ b/externs/webextension_polyfill/activitylog/Static.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.activitylog; + +typedef Static = { + /** + Receives an activityItem for each logging event. + **/ + var onExtensionActivity : OnExtensionActivityEvent; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/alarms/Alarm.hx b/externs/webextension_polyfill/alarms/Alarm.hx new file mode 100644 index 0000000..56d6eb0 --- /dev/null +++ b/externs/webextension_polyfill/alarms/Alarm.hx @@ -0,0 +1,18 @@ +package webextension_polyfill.alarms; + +typedef Alarm = { + /** + Name of this alarm. + **/ + var name : String; + /** + Time when the alarm is scheduled to fire, in milliseconds past the epoch. + **/ + var scheduledTime : Float; + /** + When present, signals that the alarm triggers periodically after so many minutes. + Optional. + **/ + @:optional + var periodInMinutes : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/alarms/CreateAlarmInfoType.hx b/externs/webextension_polyfill/alarms/CreateAlarmInfoType.hx new file mode 100644 index 0000000..69e464a --- /dev/null +++ b/externs/webextension_polyfill/alarms/CreateAlarmInfoType.hx @@ -0,0 +1,29 @@ +package webextension_polyfill.alarms; + +/** + Details about the alarm. The alarm first fires either at 'when' milliseconds past the epoch (if 'when' is provided), + after 'delayInMinutes' minutes from the current time (if 'delayInMinutes' is provided instead), + or after 'periodInMinutes' minutes from the current time (if only 'periodInMinutes' is provided). + Users should never provide both 'when' and 'delayInMinutes'. If 'periodInMinutes' is provided, + then the alarm recurs repeatedly after that many minutes. +**/ +typedef CreateAlarmInfoType = { + /** + Time when the alarm is scheduled to first fire, in milliseconds past the epoch. + Optional. + **/ + @:optional + var when : Float; + /** + Number of minutes from the current time after which the alarm should first fire. + Optional. + **/ + @:optional + var delayInMinutes : Float; + /** + Number of minutes after which the alarm should recur repeatedly. + Optional. + **/ + @:optional + var periodInMinutes : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/alarms/Static.hx b/externs/webextension_polyfill/alarms/Static.hx new file mode 100644 index 0000000..1138c07 --- /dev/null +++ b/externs/webextension_polyfill/alarms/Static.hx @@ -0,0 +1,33 @@ +package webextension_polyfill.alarms; + +typedef Static = { + /** + Creates an alarm. After the delay is expired, the onAlarm event is fired. If there is another alarm with the same name + (or no name if none is specified), it will be cancelled and replaced by this alarm. + + Creates an alarm. After the delay is expired, the onAlarm event is fired. If there is another alarm with the same name + (or no name if none is specified), it will be cancelled and replaced by this alarm. + **/ + @:overload(function(alarmInfo:CreateAlarmInfoType):Void { }) + function create(name:Null, alarmInfo:CreateAlarmInfoType):Void; + /** + Retrieves details about the specified alarm. + **/ + function get(?name:String):js.lib.Promise>; + /** + Gets an array of all the alarms. + **/ + function getAll():js.lib.Promise>; + /** + Clears the alarm with the given name. + **/ + function clear(?name:String):js.lib.Promise; + /** + Clears all alarms. + **/ + function clearAll():js.lib.Promise; + /** + Fired when an alarm has expired. Useful for transient background pages. + **/ + var onAlarm : webextension_polyfill.events.Event<(name:Alarm) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/bookmarks/BookmarkTreeNode.hx b/externs/webextension_polyfill/bookmarks/BookmarkTreeNode.hx new file mode 100644 index 0000000..4c58f81 --- /dev/null +++ b/externs/webextension_polyfill/bookmarks/BookmarkTreeNode.hx @@ -0,0 +1,66 @@ +package webextension_polyfill.bookmarks; + +/** + A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder. +**/ +typedef BookmarkTreeNode = { + /** + The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the + browser is restarted. + **/ + var id : String; + /** + The id of the parent folder. Omitted for the root node. + Optional. + **/ + @:optional + var parentId : String; + /** + The 0-based position of this node within its parent folder. + Optional. + **/ + @:optional + var index : Float; + /** + The URL navigated to when a user clicks the bookmark. Omitted for folders. + Optional. + **/ + @:optional + var url : String; + /** + The text displayed for the node. + **/ + var title : String; + /** + When this node was created, in milliseconds since the epoch (new Date(dateAdded)). + Optional. + **/ + @:optional + var dateAdded : Float; + /** + When the contents of this folder last changed, in milliseconds since the epoch. + Optional. + **/ + @:optional + var dateGroupModified : Float; + /** + Indicates the reason why this node is unmodifiable. The managed value indicates that this node was configured + by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user + and the extension (default). + Optional. + **/ + @:optional + var unmodifiable : String; + /** + Indicates the type of the BookmarkTreeNode, which can be one of bookmark, folder or separator. + Optional. + **/ + @:optional + var type : BookmarkTreeNodeType; + /** + An ordered list of children of this node. + Optional. + **/ + @:optional + var children : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/bookmarks/BookmarkTreeNodeType.hx b/externs/webextension_polyfill/bookmarks/BookmarkTreeNodeType.hx new file mode 100644 index 0000000..b07b4f1 --- /dev/null +++ b/externs/webextension_polyfill/bookmarks/BookmarkTreeNodeType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.bookmarks; + +/** + Indicates the type of a BookmarkTreeNode, which can be one of bookmark, folder or separator. +**/ +typedef BookmarkTreeNodeType = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/bookmarks/BookmarkTreeNodeUnmodifiable.hx b/externs/webextension_polyfill/bookmarks/BookmarkTreeNodeUnmodifiable.hx new file mode 100644 index 0000000..7e6c276 --- /dev/null +++ b/externs/webextension_polyfill/bookmarks/BookmarkTreeNodeUnmodifiable.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.bookmarks; + +/** + Indicates the reason why this node is unmodifiable. The managed value indicates that this node was configured + by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user + and the extension (default). +**/ +typedef BookmarkTreeNodeUnmodifiable = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/bookmarks/CreateDetails.hx b/externs/webextension_polyfill/bookmarks/CreateDetails.hx new file mode 100644 index 0000000..bae5a05 --- /dev/null +++ b/externs/webextension_polyfill/bookmarks/CreateDetails.hx @@ -0,0 +1,34 @@ +package webextension_polyfill.bookmarks; + +/** + Object passed to the create() function. +**/ +typedef CreateDetails = { + /** + Defaults to the Other Bookmarks folder. + Optional. + **/ + @:optional + var parentId : String; + /** + Optional. + **/ + @:optional + var index : Float; + /** + Optional. + **/ + @:optional + var title : String; + /** + Optional. + **/ + @:optional + var url : String; + /** + Indicates the type of BookmarkTreeNode to create, which can be one of bookmark, folder or separator. + Optional. + **/ + @:optional + var type : BookmarkTreeNodeType; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/bookmarks/MoveDestinationType.hx b/externs/webextension_polyfill/bookmarks/MoveDestinationType.hx new file mode 100644 index 0000000..e14605a --- /dev/null +++ b/externs/webextension_polyfill/bookmarks/MoveDestinationType.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.bookmarks; + +typedef MoveDestinationType = { + /** + Optional. + **/ + @:optional + var parentId : String; + /** + Optional. + **/ + @:optional + var index : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/bookmarks/OnChangedChangeInfoType.hx b/externs/webextension_polyfill/bookmarks/OnChangedChangeInfoType.hx new file mode 100644 index 0000000..c6329bf --- /dev/null +++ b/externs/webextension_polyfill/bookmarks/OnChangedChangeInfoType.hx @@ -0,0 +1,10 @@ +package webextension_polyfill.bookmarks; + +typedef OnChangedChangeInfoType = { + var title : String; + /** + Optional. + **/ + @:optional + var url : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/bookmarks/OnMovedMoveInfoType.hx b/externs/webextension_polyfill/bookmarks/OnMovedMoveInfoType.hx new file mode 100644 index 0000000..df0498f --- /dev/null +++ b/externs/webextension_polyfill/bookmarks/OnMovedMoveInfoType.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.bookmarks; + +typedef OnMovedMoveInfoType = { + var parentId : String; + var index : Float; + var oldParentId : String; + var oldIndex : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/bookmarks/OnRemovedRemoveInfoType.hx b/externs/webextension_polyfill/bookmarks/OnRemovedRemoveInfoType.hx new file mode 100644 index 0000000..2bed160 --- /dev/null +++ b/externs/webextension_polyfill/bookmarks/OnRemovedRemoveInfoType.hx @@ -0,0 +1,7 @@ +package webextension_polyfill.bookmarks; + +typedef OnRemovedRemoveInfoType = { + var parentId : String; + var index : Float; + var node : BookmarkTreeNode; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/bookmarks/SearchQueryC2Type.hx b/externs/webextension_polyfill/bookmarks/SearchQueryC2Type.hx new file mode 100644 index 0000000..ef84d85 --- /dev/null +++ b/externs/webextension_polyfill/bookmarks/SearchQueryC2Type.hx @@ -0,0 +1,25 @@ +package webextension_polyfill.bookmarks; + +/** + An object specifying properties and values to match when searching. Produces bookmarks matching all properties. +**/ +typedef SearchQueryC2Type = { + /** + A string of words that are matched against bookmark URLs and titles. + Optional. + **/ + @:optional + var query : String; + /** + The URL of the bookmark; matches verbatim. Note that folders have no URL. + Optional. + **/ + @:optional + var url : String; + /** + The title of the bookmark; matches verbatim. + Optional. + **/ + @:optional + var title : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/bookmarks/Static.hx b/externs/webextension_polyfill/bookmarks/Static.hx new file mode 100644 index 0000000..dbde408 --- /dev/null +++ b/externs/webextension_polyfill/bookmarks/Static.hx @@ -0,0 +1,67 @@ +package webextension_polyfill.bookmarks; + +typedef Static = { + /** + Retrieves the specified BookmarkTreeNode(s). + **/ + function get(idOrIdList:ts.AnyOf2>):js.lib.Promise>; + /** + Retrieves the children of the specified BookmarkTreeNode id. + **/ + function getChildren(id:String):js.lib.Promise>; + /** + Retrieves the recently added bookmarks. + **/ + function getRecent(numberOfItems:Float):js.lib.Promise>; + /** + Retrieves the entire Bookmarks hierarchy. + **/ + function getTree():js.lib.Promise>; + /** + Retrieves part of the Bookmarks hierarchy, starting at the specified node. + **/ + function getSubTree(id:String):js.lib.Promise>; + /** + Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes + matching all specified properties. + **/ + function search(query:ts.AnyOf2):js.lib.Promise>; + /** + Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder. + **/ + function create(bookmark:CreateDetails):js.lib.Promise; + /** + Moves the specified BookmarkTreeNode to the provided location. + **/ + function move(id:String, destination:MoveDestinationType):js.lib.Promise; + /** + Updates the properties of a bookmark or folder. Specify only the properties that you want to change; unspecified + properties will be left unchanged. Note: Currently, only 'title' and 'url' are supported. + **/ + function update(id:String, changes:UpdateChangesType):js.lib.Promise; + /** + Removes a bookmark or an empty bookmark folder. + **/ + function remove(id:String):js.lib.Promise; + /** + Recursively removes a bookmark folder. + **/ + function removeTree(id:String):js.lib.Promise; + /** + Fired when a bookmark or folder is created. + **/ + var onCreated : webextension_polyfill.events.Event<(id:String, bookmark:BookmarkTreeNode) -> Void>; + /** + Fired when a bookmark or folder is removed. When a folder is removed recursively, + a single notification is fired for the folder, and none for its contents. + **/ + var onRemoved : webextension_polyfill.events.Event<(id:String, removeInfo:OnRemovedRemoveInfoType) -> Void>; + /** + Fired when a bookmark or folder changes. Note: Currently, only title and url changes trigger this. + **/ + var onChanged : webextension_polyfill.events.Event<(id:String, changeInfo:OnChangedChangeInfoType) -> Void>; + /** + Fired when a bookmark or folder is moved to a different parent folder. + **/ + var onMoved : webextension_polyfill.events.Event<(id:String, moveInfo:OnMovedMoveInfoType) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/bookmarks/UpdateChangesType.hx b/externs/webextension_polyfill/bookmarks/UpdateChangesType.hx new file mode 100644 index 0000000..8e32bd7 --- /dev/null +++ b/externs/webextension_polyfill/bookmarks/UpdateChangesType.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.bookmarks; + +typedef UpdateChangesType = { + /** + Optional. + **/ + @:optional + var title : String; + /** + Optional. + **/ + @:optional + var url : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/browseraction/Static.hx b/externs/webextension_polyfill/browseraction/Static.hx new file mode 100644 index 0000000..15a849a --- /dev/null +++ b/externs/webextension_polyfill/browseraction/Static.hx @@ -0,0 +1,75 @@ +package webextension_polyfill.browseraction; + +typedef Static = { + /** + Sets the title of the browser action. This shows up in the tooltip. + **/ + function setTitle(details:webextension_polyfill.action.SetTitleDetailsType):js.lib.Promise; + /** + Gets the title of the browser action. + **/ + function getTitle(details:webextension_polyfill.action.Details):js.lib.Promise; + /** + Returns the user-specified settings relating to an extension's action. + **/ + function getUserSettings():js.lib.Promise; + /** + Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data + from a canvas element, or as dictionary of either one of those. Either the path or the imageData + property must be specified. + **/ + function setIcon(details:webextension_polyfill.action.SetIconDetailsType):js.lib.Promise; + /** + Sets the html document to be opened as a popup when the user clicks on the browser action's icon. + **/ + function setPopup(details:webextension_polyfill.action.SetPopupDetailsType):js.lib.Promise; + /** + Gets the html document set as the popup for this browser action. + **/ + function getPopup(details:webextension_polyfill.action.Details):js.lib.Promise; + /** + Sets the badge text for the browser action. The badge is displayed on top of the icon. + **/ + function setBadgeText(details:webextension_polyfill.action.SetBadgeTextDetailsType):js.lib.Promise; + /** + Gets the badge text of the browser action. If no tab nor window is specified is specified, + the global badge text is returned. + **/ + function getBadgeText(details:webextension_polyfill.action.Details):js.lib.Promise; + /** + Sets the background color for the badge. + **/ + function setBadgeBackgroundColor(details:webextension_polyfill.action.SetBadgeBackgroundColorDetailsType):js.lib.Promise; + /** + Gets the background color of the browser action badge. + **/ + function getBadgeBackgroundColor(details:webextension_polyfill.action.Details):js.lib.Promise; + /** + Sets the text color for the badge. + **/ + function setBadgeTextColor(details:webextension_polyfill.action.SetBadgeTextColorDetailsType):Void; + /** + Gets the text color of the browser action badge. + **/ + function getBadgeTextColor(details:webextension_polyfill.action.Details):Void; + /** + Enables the browser action for a tab. By default, browser actions are enabled. + **/ + function enable(?tabId:Float):js.lib.Promise; + /** + Disables the browser action for a tab. + **/ + function disable(?tabId:Float):js.lib.Promise; + /** + Checks whether the browser action is enabled. + **/ + function isEnabled(details:webextension_polyfill.action.Details):js.lib.Promise; + /** + Opens the extension popup window in the specified window. + **/ + function openPopup(?options:webextension_polyfill.action.OpenPopupOptionsType):js.lib.Promise; + /** + Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup. + **/ + var onClicked : webextension_polyfill.events.Event<(tab:webextension_polyfill.tabs.Tab, info:Null) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/browsersettings/ColorManagementMode.hx b/externs/webextension_polyfill/browsersettings/ColorManagementMode.hx new file mode 100644 index 0000000..012afcb --- /dev/null +++ b/externs/webextension_polyfill/browsersettings/ColorManagementMode.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.browsersettings; + +/** + Color management mode. +**/ +typedef ColorManagementMode = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/browsersettings/ContextMenuMouseEvent.hx b/externs/webextension_polyfill/browsersettings/ContextMenuMouseEvent.hx new file mode 100644 index 0000000..94fff55 --- /dev/null +++ b/externs/webextension_polyfill/browsersettings/ContextMenuMouseEvent.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.browsersettings; + +/** + After which mouse event context menus should popup. +**/ +typedef ContextMenuMouseEvent = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/browsersettings/ImageAnimationBehavior.hx b/externs/webextension_polyfill/browsersettings/ImageAnimationBehavior.hx new file mode 100644 index 0000000..139e725 --- /dev/null +++ b/externs/webextension_polyfill/browsersettings/ImageAnimationBehavior.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.browsersettings; + +/** + How images should be animated in the browser. +**/ +typedef ImageAnimationBehavior = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/browsersettings/Static.hx b/externs/webextension_polyfill/browsersettings/Static.hx new file mode 100644 index 0000000..5a954c3 --- /dev/null +++ b/externs/webextension_polyfill/browsersettings/Static.hx @@ -0,0 +1,78 @@ +package webextension_polyfill.browsersettings; + +typedef Static = { + /** + Allows or disallows pop-up windows from opening in response to user events. + **/ + var allowPopupsForUserEvents : webextension_polyfill.types.Setting; + /** + Enables or disables the browser cache. + **/ + var cacheEnabled : webextension_polyfill.types.Setting; + /** + This boolean setting controls whether the selected tab can be closed with a double click. + **/ + var closeTabsByDoubleClick : webextension_polyfill.types.Setting; + /** + Controls after which mouse event context menus popup. This setting's value is of type ContextMenuMouseEvent, + which has possible values of mouseup and mousedown. + **/ + var contextMenuShowEvent : webextension_polyfill.types.Setting; + /** + Returns the value of the overridden home page. Read-only. + **/ + var homepageOverride : webextension_polyfill.types.Setting; + /** + Controls the behaviour of image animation in the browser. This setting's value is of type ImageAnimationBehavior, + defaulting to normal. + **/ + var imageAnimationBehavior : webextension_polyfill.types.Setting; + /** + Returns the value of the overridden new tab page. Read-only. + **/ + var newTabPageOverride : webextension_polyfill.types.Setting; + /** + Controls where new tabs are opened. `afterCurrent` will open all new tabs next to the current tab, + `relatedAfterCurrent` will open only related tabs next to the current tab, and `atEnd` will open all tabs at the end of + the tab strip. The default is `relatedAfterCurrent`. + **/ + var newTabPosition : webextension_polyfill.types.Setting; + /** + This boolean setting controls whether bookmarks are opened in the current tab or in a new tab. + **/ + var openBookmarksInNewTabs : webextension_polyfill.types.Setting; + /** + This boolean setting controls whether search results are opened in the current tab or in a new tab. + **/ + var openSearchResultsInNewTabs : webextension_polyfill.types.Setting; + /** + This boolean setting controls whether urlbar results are opened in the current tab or in a new tab. + **/ + var openUrlbarResultsInNewTabs : webextension_polyfill.types.Setting; + /** + Disables webAPI notifications. + **/ + var webNotificationsDisabled : webextension_polyfill.types.Setting; + /** + This setting controls whether the user-chosen colors override the page's colors. + **/ + var overrideDocumentColors : webextension_polyfill.types.Setting; + /** + This setting controls whether a light or dark color scheme overrides the page's preferred color scheme. + **/ + var overrideContentColorScheme : webextension_polyfill.types.Setting; + /** + This setting controls whether the document's fonts are used. + **/ + var useDocumentFonts : webextension_polyfill.types.Setting; + /** + This boolean setting controls whether zoom is applied to the full page or to text only. + **/ + var zoomFullPage : webextension_polyfill.types.Setting; + /** + This boolean setting controls whether zoom is applied on a per-site basis or to the current tab only. If privacy. + resistFingerprinting is true, this setting has no effect and zoom is applied to the current tab only. + **/ + var zoomSiteSpecific : webextension_polyfill.types.Setting; + var colorManagement : webextension_polyfill.namespaces.browsersettings_colormanagement.browsersettingscolormanagement.Static; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/browsingdata/DataTypeSet.hx b/externs/webextension_polyfill/browsingdata/DataTypeSet.hx new file mode 100644 index 0000000..2ffe11b --- /dev/null +++ b/externs/webextension_polyfill/browsingdata/DataTypeSet.hx @@ -0,0 +1,74 @@ +package webextension_polyfill.browsingdata; + +/** + A set of data types. Missing data types are interpreted as false. +**/ +typedef DataTypeSet = { + /** + The browser's cache. Note: when removing data, this clears the entire cache: it is not limited to the range you + specify. + Optional. + **/ + @:optional + var cache : Bool; + /** + The browser's cookies. + Optional. + **/ + @:optional + var cookies : Bool; + /** + The browser's download list. + Optional. + **/ + @:optional + var downloads : Bool; + /** + The browser's stored form data. + Optional. + **/ + @:optional + var formData : Bool; + /** + The browser's history. + Optional. + **/ + @:optional + var history : Bool; + /** + Websites' IndexedDB data. + Optional. + **/ + @:optional + var indexedDB : Bool; + /** + Websites' local storage data. + Optional. + **/ + @:optional + var localStorage : Bool; + /** + Server-bound certificates. + Optional. + **/ + @:optional + var serverBoundCertificates : Bool; + /** + Stored passwords. + Optional. + **/ + @:optional + var passwords : Bool; + /** + Plugins' data. + Optional. + **/ + @:optional + var pluginData : Bool; + /** + Service Workers. + Optional. + **/ + @:optional + var serviceWorkers : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/browsingdata/RemovalOptions.hx b/externs/webextension_polyfill/browsingdata/RemovalOptions.hx new file mode 100644 index 0000000..21b88c1 --- /dev/null +++ b/externs/webextension_polyfill/browsingdata/RemovalOptions.hx @@ -0,0 +1,35 @@ +package webextension_polyfill.browsingdata; + +/** + Options that determine exactly what data will be removed. +**/ +typedef RemovalOptions = { + /** + Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the + getTime method of the JavaScript Date object). If absent, defaults to 0 (which would remove all + browsing data). + Optional. + **/ + @:optional + var since : webextension_polyfill.extensiontypes.DateType; + /** + Only remove data associated with these hostnames (only applies to cookies and localStorage). + Optional. + **/ + @:optional + var hostnames : Array; + /** + Only remove data associated with this specific cookieStoreId. + Optional. + **/ + @:optional + var cookieStoreId : String; + /** + An object whose properties specify which origin types ought to be cleared. If this object isn't specified, + it defaults to clearing only "unprotected" origins. Please ensure that you really + want to remove application data before adding 'protectedWeb' or 'extensions'. + Optional. + **/ + @:optional + var originTypes : RemovalOptionsOriginTypesType; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/browsingdata/RemovalOptionsOriginTypesType.hx b/externs/webextension_polyfill/browsingdata/RemovalOptionsOriginTypesType.hx new file mode 100644 index 0000000..a685349 --- /dev/null +++ b/externs/webextension_polyfill/browsingdata/RemovalOptionsOriginTypesType.hx @@ -0,0 +1,27 @@ +package webextension_polyfill.browsingdata; + +/** + An object whose properties specify which origin types ought to be cleared. If this object isn't specified, + it defaults to clearing only "unprotected" origins. Please ensure that you really + want to remove application data before adding 'protectedWeb' or 'extensions'. +**/ +typedef RemovalOptionsOriginTypesType = { + /** + Normal websites. + Optional. + **/ + @:optional + var unprotectedWeb : Bool; + /** + Websites that have been installed as hosted applications (be careful!). + Optional. + **/ + @:optional + var protectedWeb : Bool; + /** + Extensions and packaged applications a user has installed (be _really_ careful!). + Optional. + **/ + @:optional + var extension : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/browsingdata/SettingsCallbackResultType.hx b/externs/webextension_polyfill/browsingdata/SettingsCallbackResultType.hx new file mode 100644 index 0000000..5028f22 --- /dev/null +++ b/externs/webextension_polyfill/browsingdata/SettingsCallbackResultType.hx @@ -0,0 +1,15 @@ +package webextension_polyfill.browsingdata; + +typedef SettingsCallbackResultType = { + var options : RemovalOptions; + /** + All of the types will be present in the result, with values of true if they are both selected to be removed + and permitted to be removed, otherwise false. + **/ + var dataToRemove : DataTypeSet; + /** + All of the types will be present in the result, with values of true if they are permitted to be removed (e. + g., by enterprise policy) and false if not. + **/ + var dataRemovalPermitted : DataTypeSet; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/browsingdata/Static.hx b/externs/webextension_polyfill/browsingdata/Static.hx new file mode 100644 index 0000000..5b3432e --- /dev/null +++ b/externs/webextension_polyfill/browsingdata/Static.hx @@ -0,0 +1,46 @@ +package webextension_polyfill.browsingdata; + +typedef Static = { + /** + Reports which types of data are currently selected in the 'Clear browsing data' settings UI. + Note: some of the data types included in this API are not available in the settings UI, + and some UI settings control more than one data type listed here. + **/ + function settings():js.lib.Promise; + /** + Clears various types of browsing data stored in a user's profile. + **/ + function remove(options:RemovalOptions, dataToRemove:DataTypeSet):js.lib.Promise; + /** + Clears the browser's cache. + **/ + function removeCache(options:RemovalOptions):js.lib.Promise; + /** + Clears the browser's cookies and server-bound certificates modified within a particular timeframe. + **/ + function removeCookies(options:RemovalOptions):js.lib.Promise; + /** + Clears the browser's list of downloaded files (not the downloaded files themselves). + **/ + function removeDownloads(options:RemovalOptions):js.lib.Promise; + /** + Clears the browser's stored form data (autofill). + **/ + function removeFormData(options:RemovalOptions):js.lib.Promise; + /** + Clears the browser's history. + **/ + function removeHistory(options:RemovalOptions):js.lib.Promise; + /** + Clears websites' local storage data. + **/ + function removeLocalStorage(options:RemovalOptions):js.lib.Promise; + /** + Clears plugins' data. + **/ + function removePluginData(options:RemovalOptions):js.lib.Promise; + /** + Clears the browser's stored passwords. + **/ + function removePasswords(options:RemovalOptions):js.lib.Promise; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/captiveportal/OnConnectivityAvailableStatusEnum.hx b/externs/webextension_polyfill/captiveportal/OnConnectivityAvailableStatusEnum.hx new file mode 100644 index 0000000..e706dae --- /dev/null +++ b/externs/webextension_polyfill/captiveportal/OnConnectivityAvailableStatusEnum.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.captiveportal; + +typedef OnConnectivityAvailableStatusEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/captiveportal/OnStateChangedDetailsType.hx b/externs/webextension_polyfill/captiveportal/OnStateChangedDetailsType.hx new file mode 100644 index 0000000..577101f --- /dev/null +++ b/externs/webextension_polyfill/captiveportal/OnStateChangedDetailsType.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.captiveportal; + +typedef OnStateChangedDetailsType = { + /** + The current captive portal state. + **/ + var state : OnStateChangedDetailsTypeStateEnum; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/captiveportal/OnStateChangedDetailsTypeStateEnum.hx b/externs/webextension_polyfill/captiveportal/OnStateChangedDetailsTypeStateEnum.hx new file mode 100644 index 0000000..ae7ca41 --- /dev/null +++ b/externs/webextension_polyfill/captiveportal/OnStateChangedDetailsTypeStateEnum.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.captiveportal; + +/** + The current captive portal state. +**/ +typedef OnStateChangedDetailsTypeStateEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/captiveportal/Static.hx b/externs/webextension_polyfill/captiveportal/Static.hx new file mode 100644 index 0000000..81590da --- /dev/null +++ b/externs/webextension_polyfill/captiveportal/Static.hx @@ -0,0 +1,26 @@ +package webextension_polyfill.captiveportal; + +typedef Static = { + /** + Returns the current portal state, one of `unknown`, `not_captive`, `unlocked_portal`, `locked_portal`. + **/ + function getState():Void; + /** + Returns the time difference between NOW and the last time a request was completed in milliseconds. + **/ + function getLastChecked():Void; + /** + Fired when the captive portal state changes. + **/ + var onStateChanged : webextension_polyfill.events.Event<(details:OnStateChangedDetailsType) -> Void>; + /** + This notification will be emitted when the captive portal service has determined that we can connect to the internet. + The service will pass either `captive` if there is an unlocked captive portal present, + or `clear` if no captive portal was detected. + **/ + var onConnectivityAvailable : webextension_polyfill.events.Event<(status:OnConnectivityAvailableStatusEnum) -> Void>; + /** + Return the canonical captive-portal detection URL. Read-only. + **/ + var canonicalURL : webextension_polyfill.types.Setting; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/clipboard/SetImageDataImageTypeEnum.hx b/externs/webextension_polyfill/clipboard/SetImageDataImageTypeEnum.hx new file mode 100644 index 0000000..e98e8eb --- /dev/null +++ b/externs/webextension_polyfill/clipboard/SetImageDataImageTypeEnum.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.clipboard; + +/** + The type of imageData. +**/ +typedef SetImageDataImageTypeEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/clipboard/Static.hx b/externs/webextension_polyfill/clipboard/Static.hx new file mode 100644 index 0000000..b8a413d --- /dev/null +++ b/externs/webextension_polyfill/clipboard/Static.hx @@ -0,0 +1,9 @@ +package webextension_polyfill.clipboard; + +typedef Static = { + /** + Copy an image to the clipboard. The image is re-encoded before it is written to the clipboard. If the image is invalid, + the clipboard is not modified. + **/ + function setImageData(imageData:js.lib.ArrayBuffer, imageType:SetImageDataImageTypeEnum):js.lib.Promise; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/commands/Command.hx b/externs/webextension_polyfill/commands/Command.hx new file mode 100644 index 0000000..9a3d1ab --- /dev/null +++ b/externs/webextension_polyfill/commands/Command.hx @@ -0,0 +1,22 @@ +package webextension_polyfill.commands; + +typedef Command = { + /** + The name of the Extension Command + Optional. + **/ + @:optional + var name : String; + /** + The Extension Command description + Optional. + **/ + @:optional + var description : String; + /** + The shortcut active for this command, or blank if not active. + Optional. + **/ + @:optional + var shortcut : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/commands/OnChangedChangeInfoType.hx b/externs/webextension_polyfill/commands/OnChangedChangeInfoType.hx new file mode 100644 index 0000000..075df1a --- /dev/null +++ b/externs/webextension_polyfill/commands/OnChangedChangeInfoType.hx @@ -0,0 +1,16 @@ +package webextension_polyfill.commands; + +typedef OnChangedChangeInfoType = { + /** + The name of the shortcut. + **/ + var name : String; + /** + The new shortcut active for this command, or blank if not active. + **/ + var newShortcut : String; + /** + The old shortcut which is no longer active for this command, or blank if the shortcut was previously inactive. + **/ + var oldShortcut : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/commands/Static.hx b/externs/webextension_polyfill/commands/Static.hx new file mode 100644 index 0000000..54ca93c --- /dev/null +++ b/externs/webextension_polyfill/commands/Static.hx @@ -0,0 +1,24 @@ +package webextension_polyfill.commands; + +typedef Static = { + /** + Update the details of an already defined command. + **/ + function update(detail:UpdateDetailType):js.lib.Promise; + /** + Reset a command's details to what is specified in the manifest. + **/ + function reset(name:String):js.lib.Promise; + /** + Returns all the registered extension commands for this extension and their shortcut (if active). + **/ + function getAll():js.lib.Promise>; + /** + Fired when a registered command is activated using a keyboard shortcut. + **/ + var onCommand : webextension_polyfill.events.Event<(command:String, tab:Null) -> Void>; + /** + Fired when a registered command's shortcut is changed. + **/ + var onChanged : webextension_polyfill.events.Event<(changeInfo:OnChangedChangeInfoType) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/commands/UpdateDetailType.hx b/externs/webextension_polyfill/commands/UpdateDetailType.hx new file mode 100644 index 0000000..a65e249 --- /dev/null +++ b/externs/webextension_polyfill/commands/UpdateDetailType.hx @@ -0,0 +1,22 @@ +package webextension_polyfill.commands; + +/** + The new description for the command. +**/ +typedef UpdateDetailType = { + /** + The name of the command. + **/ + var name : String; + /** + The new description for the command. + Optional. + **/ + @:optional + var description : String; + /** + Optional. + **/ + @:optional + var shortcut : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/contentscripts/RegisteredContentScript.hx b/externs/webextension_polyfill/contentscripts/RegisteredContentScript.hx new file mode 100644 index 0000000..d97757d --- /dev/null +++ b/externs/webextension_polyfill/contentscripts/RegisteredContentScript.hx @@ -0,0 +1,11 @@ +package webextension_polyfill.contentscripts; + +/** + An object that represents a content script registered programmatically +**/ +typedef RegisteredContentScript = { + /** + Unregister a content script registered programmatically + **/ + function unregister():js.lib.Promise; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/contentscripts/RegisteredContentScriptOptions.hx b/externs/webextension_polyfill/contentscripts/RegisteredContentScriptOptions.hx new file mode 100644 index 0000000..bc16d73 --- /dev/null +++ b/externs/webextension_polyfill/contentscripts/RegisteredContentScriptOptions.hx @@ -0,0 +1,61 @@ +package webextension_polyfill.contentscripts; + +/** + Details of a content script registered programmatically +**/ +typedef RegisteredContentScriptOptions = { + var matches : Array; + /** + Optional. + **/ + @:optional + var excludeMatches : Array; + /** + Optional. + **/ + @:optional + var includeGlobs : Array; + /** + Optional. + **/ + @:optional + var excludeGlobs : Array; + /** + The list of CSS files to inject + Optional. + **/ + @:optional + var css : Array; + /** + The list of JS files to inject + Optional. + **/ + @:optional + var js : Array; + /** + 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. + Optional. + **/ + @:optional + var allFrames : Bool; + /** + 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. + Optional. + **/ + @:optional + var matchAboutBlank : Bool; + /** + The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle". + Optional. + **/ + @:optional + var runAt : webextension_polyfill.extensiontypes.RunAt; + /** + limit the set of matched tabs to those that belong to the given cookie store id + Optional. + **/ + @:optional + var cookieStoreId : ts.AnyOf2>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/contentscripts/Static.hx b/externs/webextension_polyfill/contentscripts/Static.hx new file mode 100644 index 0000000..2498fa8 --- /dev/null +++ b/externs/webextension_polyfill/contentscripts/Static.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.contentscripts; + +typedef Static = { + /** + Register a content script programmatically + **/ + function register(contentScriptOptions:RegisteredContentScriptOptions):js.lib.Promise; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/contextmenus/Static.hx b/externs/webextension_polyfill/contextmenus/Static.hx new file mode 100644 index 0000000..ed1b59a --- /dev/null +++ b/externs/webextension_polyfill/contextmenus/Static.hx @@ -0,0 +1,54 @@ +package webextension_polyfill.contextmenus; + +typedef Static = { + /** + Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation + callback fires (the details will be in $(ref:runtime.lastError)). + **/ + function create(createProperties:webextension_polyfill.menus.CreateCreatePropertiesType, ?callback:() -> Void):ts.AnyOf2; + /** + Updates a previously created context menu item. + **/ + function update(id:ts.AnyOf2, updateProperties:webextension_polyfill.menus.UpdateUpdatePropertiesType):js.lib.Promise; + /** + Removes a context menu item. + **/ + function remove(menuItemId:ts.AnyOf2):js.lib.Promise; + /** + Removes all context menu items added by this extension. + **/ + function removeAll():js.lib.Promise; + /** + Show the matching menu items from this extension instead of the default menu. This should be called during a + 'contextmenu' DOM event handler, and only applies to the menu that opens after this event. + **/ + function overrideContext(contextOptions:webextension_polyfill.menus.OverrideContextContextOptionsType):Void; + /** + Updates the extension items in the shown menu, including changes that have been made since the menu was shown. + Has no effect if the menu is hidden. Rebuilding a shown menu is an expensive operation, + only invoke this method when necessary. + **/ + function refresh():js.lib.Promise; + /** + Retrieve the element that was associated with a recent contextmenu event. + **/ + function getTargetElement(targetElementId:Float):js.html.DOMElement; + /** + Fired when a context menu item is clicked. + **/ + var onClicked : webextension_polyfill.events.Event<(info:webextension_polyfill.menus.OnClickData, tab:Null) -> Void>; + /** + Fired when a menu is shown. The extension can add, modify or remove menu items and call menus.refresh() + to update the menu. + **/ + var onShown : webextension_polyfill.events.Event<(info:webextension_polyfill.menus.OnShownInfoType, tab:webextension_polyfill.tabs.Tab) -> Void>; + /** + Fired when a menu is hidden. This event is only fired if onShown has fired before. + **/ + var onHidden : webextension_polyfill.events.Event<() -> Void>; + /** + The maximum number of top level extension items that can be added to an extension action context menu. + Any items beyond this limit will be ignored. + **/ + var ACTION_MENU_TOP_LEVEL_LIMIT : Int; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/contextualidentities/ContextualIdentity.hx b/externs/webextension_polyfill/contextualidentities/ContextualIdentity.hx new file mode 100644 index 0000000..a5af859 --- /dev/null +++ b/externs/webextension_polyfill/contextualidentities/ContextualIdentity.hx @@ -0,0 +1,31 @@ +package webextension_polyfill.contextualidentities; + +/** + Represents information about a contextual identity. +**/ +typedef ContextualIdentity = { + /** + The name of the contextual identity. + **/ + var name : String; + /** + The icon name of the contextual identity. + **/ + var icon : String; + /** + The icon url of the contextual identity. + **/ + var iconUrl : String; + /** + The color name of the contextual identity. + **/ + var color : String; + /** + The color hash of the contextual identity. + **/ + var colorCode : String; + /** + The cookie store ID of the contextual identity. + **/ + var cookieStoreId : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/contextualidentities/CreateDetailsType.hx b/externs/webextension_polyfill/contextualidentities/CreateDetailsType.hx new file mode 100644 index 0000000..f9edbfd --- /dev/null +++ b/externs/webextension_polyfill/contextualidentities/CreateDetailsType.hx @@ -0,0 +1,19 @@ +package webextension_polyfill.contextualidentities; + +/** + Details about the contextual identity being created. +**/ +typedef CreateDetailsType = { + /** + The name of the contextual identity. + **/ + var name : String; + /** + The color of the contextual identity. + **/ + var color : String; + /** + The icon of the contextual identity. + **/ + var icon : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/contextualidentities/OnCreatedChangeInfoType.hx b/externs/webextension_polyfill/contextualidentities/OnCreatedChangeInfoType.hx new file mode 100644 index 0000000..e878373 --- /dev/null +++ b/externs/webextension_polyfill/contextualidentities/OnCreatedChangeInfoType.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.contextualidentities; + +typedef OnCreatedChangeInfoType = { + /** + Contextual identity that has been created + **/ + var contextualIdentity : ContextualIdentity; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/contextualidentities/OnRemovedChangeInfoType.hx b/externs/webextension_polyfill/contextualidentities/OnRemovedChangeInfoType.hx new file mode 100644 index 0000000..a8173c1 --- /dev/null +++ b/externs/webextension_polyfill/contextualidentities/OnRemovedChangeInfoType.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.contextualidentities; + +typedef OnRemovedChangeInfoType = { + /** + Contextual identity that has been removed + **/ + var contextualIdentity : ContextualIdentity; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/contextualidentities/OnUpdatedChangeInfoType.hx b/externs/webextension_polyfill/contextualidentities/OnUpdatedChangeInfoType.hx new file mode 100644 index 0000000..05ce285 --- /dev/null +++ b/externs/webextension_polyfill/contextualidentities/OnUpdatedChangeInfoType.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.contextualidentities; + +typedef OnUpdatedChangeInfoType = { + /** + Contextual identity that has been updated + **/ + var contextualIdentity : ContextualIdentity; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/contextualidentities/QueryDetailsType.hx b/externs/webextension_polyfill/contextualidentities/QueryDetailsType.hx new file mode 100644 index 0000000..d0ddb3d --- /dev/null +++ b/externs/webextension_polyfill/contextualidentities/QueryDetailsType.hx @@ -0,0 +1,13 @@ +package webextension_polyfill.contextualidentities; + +/** + Information to filter the contextual identities being retrieved. +**/ +typedef QueryDetailsType = { + /** + Filters the contextual identity by name. + Optional. + **/ + @:optional + var name : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/contextualidentities/Static.hx b/externs/webextension_polyfill/contextualidentities/Static.hx new file mode 100644 index 0000000..be2dae5 --- /dev/null +++ b/externs/webextension_polyfill/contextualidentities/Static.hx @@ -0,0 +1,36 @@ +package webextension_polyfill.contextualidentities; + +typedef Static = { + /** + Retrieves information about a single contextual identity. + **/ + function get(cookieStoreId:String):js.lib.Promise; + /** + Retrieves all contextual identities + **/ + function query(details:QueryDetailsType):js.lib.Promise>; + /** + Creates a contextual identity with the given data. + **/ + function create(details:CreateDetailsType):js.lib.Promise; + /** + Updates a contextual identity with the given data. + **/ + function update(cookieStoreId:String, details:UpdateDetailsType):js.lib.Promise; + /** + Deletes a contetual identity by its cookie Store ID. + **/ + function remove(cookieStoreId:String):js.lib.Promise; + /** + Fired when a container is updated. + **/ + var onUpdated : webextension_polyfill.events.Event<(changeInfo:OnUpdatedChangeInfoType) -> Void>; + /** + Fired when a new container is created. + **/ + var onCreated : webextension_polyfill.events.Event<(changeInfo:OnCreatedChangeInfoType) -> Void>; + /** + Fired when a container is removed. + **/ + var onRemoved : webextension_polyfill.events.Event<(changeInfo:OnRemovedChangeInfoType) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/contextualidentities/UpdateDetailsType.hx b/externs/webextension_polyfill/contextualidentities/UpdateDetailsType.hx new file mode 100644 index 0000000..ca25c36 --- /dev/null +++ b/externs/webextension_polyfill/contextualidentities/UpdateDetailsType.hx @@ -0,0 +1,25 @@ +package webextension_polyfill.contextualidentities; + +/** + Details about the contextual identity being created. +**/ +typedef UpdateDetailsType = { + /** + The name of the contextual identity. + Optional. + **/ + @:optional + var name : String; + /** + The color of the contextual identity. + Optional. + **/ + @:optional + var color : String; + /** + The icon of the contextual identity. + Optional. + **/ + @:optional + var icon : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/cookies/Cookie.hx b/externs/webextension_polyfill/cookies/Cookie.hx new file mode 100644 index 0000000..b7a95da --- /dev/null +++ b/externs/webextension_polyfill/cookies/Cookie.hx @@ -0,0 +1,63 @@ +package webextension_polyfill.cookies; + +/** + Represents information about an HTTP cookie. +**/ +typedef Cookie = { + /** + The name of the cookie. + **/ + var name : String; + /** + The value of the cookie. + **/ + var value : String; + /** + The domain of the cookie (e.g. "www.google.com", "example.com"). + **/ + var domain : String; + /** + True if the cookie is a host-only cookie (i.e. a request's host must exactly match the domain of the cookie). + **/ + var hostOnly : Bool; + /** + The path of the cookie. + **/ + var path : String; + /** + True if the cookie is marked as Secure (i.e. its scope is limited to secure channels, typically HTTPS). + **/ + var secure : Bool; + /** + True if the cookie is marked as HttpOnly (i.e. the cookie is inaccessible to client-side scripts). + **/ + var httpOnly : Bool; + /** + The cookie's same-site status (i.e. whether the cookie is sent with cross-site requests). + **/ + var sameSite : SameSiteStatus; + /** + True if the cookie is a session cookie, as opposed to a persistent cookie with an expiration date. + **/ + var session : Bool; + /** + The expiration date of the cookie as the number of seconds since the UNIX epoch. Not provided for session cookies. + Optional. + **/ + @:optional + var expirationDate : Float; + /** + The ID of the cookie store containing this cookie, as provided in getAllCookieStores(). + **/ + var storeId : String; + /** + The first-party domain of the cookie. + **/ + var firstPartyDomain : String; + /** + The cookie's storage partition, if any. null if not partitioned. + Optional. + **/ + @:optional + var partitionKey : PartitionKey; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/cookies/CookieStore.hx b/externs/webextension_polyfill/cookies/CookieStore.hx new file mode 100644 index 0000000..c5dd80d --- /dev/null +++ b/externs/webextension_polyfill/cookies/CookieStore.hx @@ -0,0 +1,20 @@ +package webextension_polyfill.cookies; + +/** + Represents a cookie store in the browser. An incognito mode window, for instance, uses a separate cookie store from a + non-incognito window. +**/ +typedef CookieStore = { + /** + The unique identifier for the cookie store. + **/ + var id : String; + /** + Identifiers of all the browser tabs that share this cookie store. + **/ + var tabIds : Array; + /** + Indicates if this is an incognito cookie store + **/ + var incognito : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/cookies/GetAllDetailsType.hx b/externs/webextension_polyfill/cookies/GetAllDetailsType.hx new file mode 100644 index 0000000..ba27353 --- /dev/null +++ b/externs/webextension_polyfill/cookies/GetAllDetailsType.hx @@ -0,0 +1,66 @@ +package webextension_polyfill.cookies; + +/** + Information to filter the cookies being retrieved. +**/ +typedef GetAllDetailsType = { + /** + Restricts the retrieved cookies to those that would match the given URL. + Optional. + **/ + @:optional + var url : String; + /** + Filters the cookies by name. + Optional. + **/ + @:optional + var name : String; + /** + Restricts the retrieved cookies to those whose domains match or are subdomains of this one. + Optional. + **/ + @:optional + var domain : String; + /** + Restricts the retrieved cookies to those whose path exactly matches this string. + Optional. + **/ + @:optional + var path : String; + /** + Filters the cookies by their Secure property. + Optional. + **/ + @:optional + var secure : Bool; + /** + Filters out session vs. persistent cookies. + Optional. + **/ + @:optional + var session : Bool; + /** + The cookie store to retrieve cookies from. If omitted, the current execution context's cookie store will be used. + Optional. + **/ + @:optional + var storeId : String; + /** + Restricts the retrieved cookies to those whose first-party domains match this one. + This attribute is required if First-Party Isolation is enabled. To not filter by a specific first-party domain, + use `null` or `undefined`. + Optional. + **/ + @:optional + var firstPartyDomain : String; + /** + Selects a specific storage partition to look up cookies. Defaults to null, in which case only non-partitioned cookies + are retrieved. If an object iis passed, partitioned cookies are also included, and filtered based on the keys present in + the given PartitionKey description. An empty object ({}) returns all cookies (partitioned + unpartitioned), + a non-empty object (e.g. {topLevelSite: '...'}) only returns cookies whose partition match all given attributes. + Optional. + **/ + @:optional + var partitionKey : PartitionKey; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/cookies/GetDetailsType.hx b/externs/webextension_polyfill/cookies/GetDetailsType.hx new file mode 100644 index 0000000..37e9afb --- /dev/null +++ b/externs/webextension_polyfill/cookies/GetDetailsType.hx @@ -0,0 +1,38 @@ +package webextension_polyfill.cookies; + +/** + Details to identify the cookie being retrieved. +**/ +typedef GetDetailsType = { + /** + The URL with which the cookie to retrieve is associated. This argument may be a full URL, + in which case any data following the URL path (e.g. the query string) is simply ignored. + If host permissions for this URL are not specified in the manifest file, the API call will fail. + **/ + var url : String; + /** + The name of the cookie to retrieve. + **/ + var name : String; + /** + The ID of the cookie store in which to look for the cookie. By default, the current execution context's cookie store + will be used. + Optional. + **/ + @:optional + var storeId : String; + /** + The first-party domain which the cookie to retrieve is associated. This attribute is required if First-Party Isolation + is enabled. + Optional. + **/ + @:optional + var firstPartyDomain : String; + /** + The storage partition, if the cookie is part of partitioned storage. By default, only non-partitioned cookies are + returned. + Optional. + **/ + @:optional + var partitionKey : PartitionKey; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/cookies/OnChangedCause.hx b/externs/webextension_polyfill/cookies/OnChangedCause.hx new file mode 100644 index 0000000..3fd271e --- /dev/null +++ b/externs/webextension_polyfill/cookies/OnChangedCause.hx @@ -0,0 +1,11 @@ +package webextension_polyfill.cookies; + +/** + The underlying reason behind the cookie's change. If a cookie was inserted, or removed via an explicit call to + $(ref:cookies.remove), "cause" will be "explicit". If a cookie was automatically removed due to expiry, + "cause" will be "expired". If a cookie was removed due to being overwritten with an already-expired expiration date, + "cause" will be set to "expired_overwrite". If a cookie was automatically removed due to garbage collection, + "cause" will be "evicted". If a cookie was automatically removed due to a "set" call that overwrote it, + "cause" will be "overwrite". Plan your response accordingly. +**/ +typedef OnChangedCause = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/cookies/OnChangedChangeInfoType.hx b/externs/webextension_polyfill/cookies/OnChangedChangeInfoType.hx new file mode 100644 index 0000000..445cbe2 --- /dev/null +++ b/externs/webextension_polyfill/cookies/OnChangedChangeInfoType.hx @@ -0,0 +1,16 @@ +package webextension_polyfill.cookies; + +typedef OnChangedChangeInfoType = { + /** + True if a cookie was removed. + **/ + var removed : Bool; + /** + Information about the cookie that was set or removed. + **/ + var cookie : Cookie; + /** + The underlying reason behind the cookie's change. + **/ + var cause : OnChangedCause; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/cookies/PartitionKey.hx b/externs/webextension_polyfill/cookies/PartitionKey.hx new file mode 100644 index 0000000..72bc029 --- /dev/null +++ b/externs/webextension_polyfill/cookies/PartitionKey.hx @@ -0,0 +1,13 @@ +package webextension_polyfill.cookies; + +/** + The description of the storage partition of a cookie. This object may be omitted (null) if a cookie is not partitioned. +**/ +typedef PartitionKey = { + /** + The first-party URL of the cookie, if the cookie is in storage partitioned by the top-level site. + Optional. + **/ + @:optional + var topLevelSite : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/cookies/RemoveCallbackDetailsType.hx b/externs/webextension_polyfill/cookies/RemoveCallbackDetailsType.hx new file mode 100644 index 0000000..0b1ecb4 --- /dev/null +++ b/externs/webextension_polyfill/cookies/RemoveCallbackDetailsType.hx @@ -0,0 +1,30 @@ +package webextension_polyfill.cookies; + +/** + Contains details about the cookie that's been removed. If removal failed for any reason, this will be "null", + and $(ref:runtime.lastError) will be set. +**/ +typedef RemoveCallbackDetailsType = { + /** + The URL associated with the cookie that's been removed. + **/ + var url : String; + /** + The name of the cookie that's been removed. + **/ + var name : String; + /** + The ID of the cookie store from which the cookie was removed. + **/ + var storeId : String; + /** + The first-party domain associated with the cookie that's been removed. + **/ + var firstPartyDomain : String; + /** + The storage partition, if the cookie is part of partitioned storage. null if not partitioned. + Optional. + **/ + @:optional + var partitionKey : PartitionKey; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/cookies/RemoveDetailsType.hx b/externs/webextension_polyfill/cookies/RemoveDetailsType.hx new file mode 100644 index 0000000..ec02f03 --- /dev/null +++ b/externs/webextension_polyfill/cookies/RemoveDetailsType.hx @@ -0,0 +1,35 @@ +package webextension_polyfill.cookies; + +/** + Information to identify the cookie to remove. +**/ +typedef RemoveDetailsType = { + /** + The URL associated with the cookie. If host permissions for this URL are not specified in the manifest file, + the API call will fail. + **/ + var url : String; + /** + The name of the cookie to remove. + **/ + var name : String; + /** + The ID of the cookie store to look in for the cookie. If unspecified, the cookie is looked for by default in the current + execution context's cookie store. + Optional. + **/ + @:optional + var storeId : String; + /** + The first-party domain associated with the cookie. This attribute is required if First-Party Isolation is enabled. + Optional. + **/ + @:optional + var firstPartyDomain : String; + /** + The storage partition, if the cookie is part of partitioned storage. By default, non-partitioned storage is used. + Optional. + **/ + @:optional + var partitionKey : PartitionKey; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/cookies/SameSiteStatus.hx b/externs/webextension_polyfill/cookies/SameSiteStatus.hx new file mode 100644 index 0000000..177c859 --- /dev/null +++ b/externs/webextension_polyfill/cookies/SameSiteStatus.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.cookies; + +/** + A cookie's 'SameSite' state (https://tools.ietf.org/html/draft-west-first-party-cookies). + 'no_restriction' corresponds to a cookie set without a 'SameSite' attribute, 'lax' to 'SameSite=Lax', + and 'strict' to 'SameSite=Strict'. +**/ +typedef SameSiteStatus = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/cookies/SetDetailsType.hx b/externs/webextension_polyfill/cookies/SetDetailsType.hx new file mode 100644 index 0000000..315d047 --- /dev/null +++ b/externs/webextension_polyfill/cookies/SetDetailsType.hx @@ -0,0 +1,80 @@ +package webextension_polyfill.cookies; + +/** + Details about the cookie being set. +**/ +typedef SetDetailsType = { + /** + The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of + the created cookie. If host permissions for this URL are not specified in the manifest file, the API call will fail. + **/ + var url : String; + /** + The name of the cookie. Empty by default if omitted. + Optional. + **/ + @:optional + var name : String; + /** + The value of the cookie. Empty by default if omitted. + Optional. + **/ + @:optional + var value : String; + /** + The domain of the cookie. If omitted, the cookie becomes a host-only cookie. + Optional. + **/ + @:optional + var domain : String; + /** + The path of the cookie. Defaults to the path portion of the url parameter. + Optional. + **/ + @:optional + var path : String; + /** + Whether the cookie should be marked as Secure. Defaults to false. + Optional. + **/ + @:optional + var secure : Bool; + /** + Whether the cookie should be marked as HttpOnly. Defaults to false. + Optional. + **/ + @:optional + var httpOnly : Bool; + /** + The cookie's same-site status. + Optional. + **/ + @:optional + var sameSite : SameSiteStatus; + /** + The expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, + the cookie becomes a session cookie. + Optional. + **/ + @:optional + var expirationDate : Float; + /** + The ID of the cookie store in which to set the cookie. By default, the cookie is set in the current execution context's + cookie store. + Optional. + **/ + @:optional + var storeId : String; + /** + The first-party domain of the cookie. This attribute is required if First-Party Isolation is enabled. + Optional. + **/ + @:optional + var firstPartyDomain : String; + /** + The storage partition, if the cookie is part of partitioned storage. By default, non-partitioned storage is used. + Optional. + **/ + @:optional + var partitionKey : PartitionKey; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/cookies/Static.hx b/externs/webextension_polyfill/cookies/Static.hx new file mode 100644 index 0000000..e33ae06 --- /dev/null +++ b/externs/webextension_polyfill/cookies/Static.hx @@ -0,0 +1,35 @@ +package webextension_polyfill.cookies; + +typedef Static = { + /** + Retrieves information about a single cookie. If more than one cookie of the same name exists for the given URL, + the one with the longest path will be returned. For cookies with the same path length, + the cookie with the earliest creation time will be returned. + **/ + function get(details:GetDetailsType):js.lib.Promise>; + /** + Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, + with those with the longest path first. If multiple cookies have the same path length, + those with the earliest creation time will be first. + **/ + function getAll(details:GetAllDetailsType):js.lib.Promise>; + /** + Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist. + **/ + function set(details:SetDetailsType):js.lib.Promise; + /** + Deletes a cookie by name. + **/ + function remove(details:RemoveDetailsType):js.lib.Promise>; + /** + Lists all existing cookie stores. + **/ + function getAllCookieStores():js.lib.Promise>; + /** + Fired when a cookie is set or removed. As a special case, note that updating a cookie's properties is implemented as a + two step process: the cookie to be updated is first removed entirely, generating a notification with "cause" of + "overwrite" . Afterwards, a new cookie is written with the updated values, generating a second notification with + "cause" "explicit". + **/ + var onChanged : webextension_polyfill.events.Event<(changeInfo:OnChangedChangeInfoType) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/IsRegexSupportedCallbackResultType.hx b/externs/webextension_polyfill/declarativenetrequest/IsRegexSupportedCallbackResultType.hx new file mode 100644 index 0000000..0033469 --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/IsRegexSupportedCallbackResultType.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.declarativenetrequest; + +typedef IsRegexSupportedCallbackResultType = { + /** + Whether the given regex is supported + **/ + var isSupported : Bool; + /** + Specifies the reason why the regular expression is not supported. Only provided if 'isSupported' is false. + Optional. + **/ + @:optional + var reason : UnsupportedRegexReason; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/IsRegexSupportedRegexOptionsType.hx b/externs/webextension_polyfill/declarativenetrequest/IsRegexSupportedRegexOptionsType.hx new file mode 100644 index 0000000..64ec411 --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/IsRegexSupportedRegexOptionsType.hx @@ -0,0 +1,21 @@ +package webextension_polyfill.declarativenetrequest; + +typedef IsRegexSupportedRegexOptionsType = { + /** + The regular expresson to check. + **/ + var regex : String; + /** + Whether the 'regex' specified is case sensitive. + Optional. + **/ + @:optional + var isCaseSensitive : Bool; + /** + Whether the 'regex' specified requires capturing. Capturing is only required for redirect rules which specify a + 'regexSubstition' action. + Optional. + **/ + @:optional + var requireCapturing : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/MatchedRule.hx b/externs/webextension_polyfill/declarativenetrequest/MatchedRule.hx new file mode 100644 index 0000000..7f5a317 --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/MatchedRule.hx @@ -0,0 +1,18 @@ +package webextension_polyfill.declarativenetrequest; + +typedef MatchedRule = { + /** + A matching rule's ID. + **/ + var ruleId : Float; + /** + ID of the Ruleset this rule belongs to. + **/ + var rulesetId : String; + /** + ID of the extension, if this rule belongs to a different extension. + Optional. + **/ + @:optional + var extensionId : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/ResourceType.hx b/externs/webextension_polyfill/declarativenetrequest/ResourceType.hx new file mode 100644 index 0000000..a802a53 --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/ResourceType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.declarativenetrequest; + +/** + How the requested resource will be used. Comparable to the webRequest.ResourceType type. +**/ +typedef ResourceType = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/Rule.hx b/externs/webextension_polyfill/declarativenetrequest/Rule.hx new file mode 100644 index 0000000..b01bb76 --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/Rule.hx @@ -0,0 +1,22 @@ +package webextension_polyfill.declarativenetrequest; + +typedef Rule = { + /** + An id which uniquely identifies a rule. Mandatory and should be >= 1. + **/ + var id : Float; + /** + Rule priority. Defaults to 1. When specified, should be >= 1 + Optional. + **/ + @:optional + var priority : Float; + /** + The condition under which this rule is triggered. + **/ + var condition : RuleConditionType; + /** + The action to take if this rule is matched. + **/ + var action : RuleActionType; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/RuleActionRedirectType.hx b/externs/webextension_polyfill/declarativenetrequest/RuleActionRedirectType.hx new file mode 100644 index 0000000..7ed09b8 --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/RuleActionRedirectType.hx @@ -0,0 +1,33 @@ +package webextension_polyfill.declarativenetrequest; + +/** + Describes how the redirect should be performed. Only valid when type is 'redirect'. +**/ +typedef RuleActionRedirectType = { + /** + Path relative to the extension directory. Should start with '/'. + Optional. + **/ + @:optional + var extensionPath : String; + /** + Url transformations to perform. + Optional. + **/ + @:optional + var transform : URLTransform; + /** + The redirect url. Redirects to JavaScript urls are not allowed. + Optional. + **/ + @:optional + var url : String; + /** + Substitution pattern for rules which specify a 'regexFilter'. The first match of regexFilter within the url will be + replaced with this pattern. Within regexSubstitution, backslash-escaped digits (\1 to \9) + can be used to insert the corresponding capture groups. \0 refers to the entire matching text. + Optional. + **/ + @:optional + var regexSubstitution : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/RuleActionRequestHeadersItemType.hx b/externs/webextension_polyfill/declarativenetrequest/RuleActionRequestHeadersItemType.hx new file mode 100644 index 0000000..f8adefb --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/RuleActionRequestHeadersItemType.hx @@ -0,0 +1,18 @@ +package webextension_polyfill.declarativenetrequest; + +typedef RuleActionRequestHeadersItemType = { + /** + The name of the request header to be modified. + **/ + var header : String; + /** + The operation to be performed on a header. + **/ + var operation : String; + /** + The new value for the header. Must be specified for the 'append' and 'set' operations. + Optional. + **/ + @:optional + var value : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/RuleActionResponseHeadersItemType.hx b/externs/webextension_polyfill/declarativenetrequest/RuleActionResponseHeadersItemType.hx new file mode 100644 index 0000000..ff93fdf --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/RuleActionResponseHeadersItemType.hx @@ -0,0 +1,18 @@ +package webextension_polyfill.declarativenetrequest; + +typedef RuleActionResponseHeadersItemType = { + /** + The name of the response header to be modified. + **/ + var header : String; + /** + The operation to be performed on a header. + **/ + var operation : String; + /** + The new value for the header. Must be specified for the 'append' and 'set' operations. + Optional. + **/ + @:optional + var value : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/RuleActionType.hx b/externs/webextension_polyfill/declarativenetrequest/RuleActionType.hx new file mode 100644 index 0000000..2a822fd --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/RuleActionType.hx @@ -0,0 +1,26 @@ +package webextension_polyfill.declarativenetrequest; + +/** + The action to take if this rule is matched. +**/ +typedef RuleActionType = { + var type : RuleActionTypeEnum; + /** + Describes how the redirect should be performed. Only valid when type is 'redirect'. + Optional. + **/ + @:optional + var redirect : RuleActionRedirectType; + /** + The request headers to modify for the request. Only valid when type is 'modifyHeaders'. + Optional. + **/ + @:optional + var requestHeaders : Array; + /** + The response headers to modify for the request. Only valid when type is 'modifyHeaders'. + Optional. + **/ + @:optional + var responseHeaders : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/RuleActionTypeEnum.hx b/externs/webextension_polyfill/declarativenetrequest/RuleActionTypeEnum.hx new file mode 100644 index 0000000..9832af0 --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/RuleActionTypeEnum.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.declarativenetrequest; + +typedef RuleActionTypeEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/RuleConditionDomainTypeEnum.hx b/externs/webextension_polyfill/declarativenetrequest/RuleConditionDomainTypeEnum.hx new file mode 100644 index 0000000..4ad7158 --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/RuleConditionDomainTypeEnum.hx @@ -0,0 +1,7 @@ +package webextension_polyfill.declarativenetrequest; + +/** + Specifies whether the network request is first-party or third-party to the domain from which it originated. If omitted, + all requests are matched. +**/ +typedef RuleConditionDomainTypeEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/RuleConditionType.hx b/externs/webextension_polyfill/declarativenetrequest/RuleConditionType.hx new file mode 100644 index 0000000..debc976 --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/RuleConditionType.hx @@ -0,0 +1,104 @@ +package webextension_polyfill.declarativenetrequest; + +/** + The condition under which this rule is triggered. +**/ +typedef RuleConditionType = { + /** + TODO: link to doc explaining supported pattern. The pattern which is matched against the network request url. + Only one of 'urlFilter' or 'regexFilter' can be specified. + Optional. + **/ + @:optional + var urlFilter : String; + /** + Regular expression to match against the network request url. Only one of 'urlFilter' or 'regexFilter' can be specified. + Optional. + **/ + @:optional + var regexFilter : String; + /** + Whether 'urlFilter' or 'regexFilter' is case-sensitive. + Optional. + **/ + @:optional + var isUrlFilterCaseSensitive : Bool; + /** + The rule will only match network requests originating from the list of 'initiatorDomains'. If the list is omitted, + the rule is applied to requests from all domains. + Optional. + **/ + @:optional + var initiatorDomains : Array; + /** + The rule will not match network requests originating from the list of 'initiatorDomains'. + If the list is empty or omitted, no domains are excluded. This takes precedence over 'initiatorDomains'. + Optional. + **/ + @:optional + var excludedInitiatorDomains : Array; + /** + The rule will only match network requests when the domain matches one from the list of 'requestDomains'. + If the list is omitted, the rule is applied to requests from all domains. + Optional. + **/ + @:optional + var requestDomains : Array; + /** + The rule will not match network requests when the domains matches one from the list of 'excludedRequestDomains'. + If the list is empty or omitted, no domains are excluded. This takes precedence over 'requestDomains'. + Optional. + **/ + @:optional + var excludedRequestDomains : Array; + /** + List of resource types which the rule can match. When the rule action is 'allowAllRequests', + this must be specified and may only contain 'main_frame' or 'sub_frame'. Cannot be specified if 'excludedResourceTypes' + is specified. If neither of them is specified, all resource types except 'main_frame' are matched. + Optional. + **/ + @:optional + var resourceTypes : Array; + /** + List of resource types which the rule won't match. Cannot be specified if 'resourceTypes' is specified. + If neither of them is specified, all resource types except 'main_frame' are matched. + Optional. + **/ + @:optional + var excludedResourceTypes : Array; + /** + List of HTTP request methods which the rule can match. Should be a lower-case method such as 'connect', 'delete', 'get', + 'head', 'options', 'patch', 'post', 'put'.' + Optional. + **/ + @:optional + var requestMethods : Array; + /** + List of request methods which the rule won't match. Cannot be specified if 'requestMethods' is specified. + If neither of them is specified, all request methods are matched. + Optional. + **/ + @:optional + var excludedRequestMethods : Array; + /** + Specifies whether the network request is first-party or third-party to the domain from which it originated. If omitted, + all requests are matched. + Optional. + **/ + @:optional + var domainType : RuleConditionDomainTypeEnum; + /** + List of tabIds which the rule should match. An ID of -1 matches requests which don't originate from a tab. + Only supported for session-scoped rules. + Optional. + **/ + @:optional + var tabIds : Array; + /** + List of tabIds which the rule should not match. An ID of -1 excludes requests which don't originate from a tab. + Only supported for session-scoped rules. + Optional. + **/ + @:optional + var excludedTabIds : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/Static.hx b/externs/webextension_polyfill/declarativenetrequest/Static.hx new file mode 100644 index 0000000..e391df2 --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/Static.hx @@ -0,0 +1,76 @@ +package webextension_polyfill.declarativenetrequest; + +typedef Static = { + /** + Modifies the current set of dynamic rules for the extension. The rules with IDs listed in options. + removeRuleIds are first removed, and then the rules given in options.addRules are added. + These rules are persisted across browser sessions and extension updates. + **/ + function updateDynamicRules(options:UpdateDynamicRulesOptionsType):js.lib.Promise; + /** + Modifies the current set of session scoped rules for the extension. The rules with IDs listed in options. + removeRuleIds are first removed, and then the rules given in options.addRules are added. + These rules are not persisted across sessions and are backed in memory. + **/ + function updateSessionRules(options:UpdateSessionRulesOptionsType):js.lib.Promise; + /** + Returns the ids for the current set of enabled static rulesets. + **/ + function getEnabledRulesets():js.lib.Promise>; + /** + Returns the ids for the current set of enabled static rulesets. + **/ + function updateEnabledRulesets(updateRulesetOptions:UpdateEnabledRulesetsUpdateRulesetOptionsType):js.lib.Promise; + /** + Returns the remaining number of static rules an extension can enable + **/ + function getAvailableStaticRuleCount():js.lib.Promise; + /** + Returns the current set of dynamic rules for the extension. + **/ + function getDynamicRules():js.lib.Promise>; + /** + Returns the current set of session scoped rules for the extension. + **/ + function getSessionRules():js.lib.Promise>; + /** + Checks if the given regular expression will be supported as a 'regexFilter' rule condition. + **/ + function isRegexSupported(regexOptions:IsRegexSupportedRegexOptionsType):js.lib.Promise; + /** + Checks if any of the extension's declarativeNetRequest rules would match a hypothetical request. + **/ + function testMatchOutcome(request:TestMatchOutcomeRequestType, ?options:TestMatchOutcomeOptionsType):js.lib.Promise; + /** + Ruleset ID for the dynamic rules added by the extension. + **/ + var DYNAMIC_RULESET_ID : String; + /** + The minimum number of static rules guaranteed to an extension across its enabled static rulesets. + Any rules above this limit will count towards the global static rule limit. + **/ + var GUARANTEED_MINIMUM_STATIC_RULES : Float; + /** + The maximum number of static Rulesets an extension can specify as part of the rule_resources manifest key. + **/ + var MAX_NUMBER_OF_STATIC_RULESETS : Float; + /** + The maximum number of static Rulesets an extension can enable at any one time. + **/ + var MAX_NUMBER_OF_ENABLED_STATIC_RULESETS : Float; + /** + The maximum number of dynamic and session rules an extension can add. NOTE: in the Firefox we are enforcing this limit + to the session and dynamic rules count separately, instead of enforcing it to the rules count for both combined as the + Chrome implementation does. + **/ + var MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES : Float; + /** + The maximum number of regular expression rules that an extension can add. This limit is evaluated separately for the set + of session rules, dynamic rules and those specified in the rule_resources file. + **/ + var MAX_NUMBER_OF_REGEX_RULES : Float; + /** + Ruleset ID for the session-scoped rules added by the extension. + **/ + var SESSION_RULESET_ID : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/TestMatchOutcomeCallbackResultType.hx b/externs/webextension_polyfill/declarativenetrequest/TestMatchOutcomeCallbackResultType.hx new file mode 100644 index 0000000..a5c3af6 --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/TestMatchOutcomeCallbackResultType.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.declarativenetrequest; + +typedef TestMatchOutcomeCallbackResultType = { + /** + The rules (if any) that match the hypothetical request. + **/ + var matchedRules : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/TestMatchOutcomeOptionsType.hx b/externs/webextension_polyfill/declarativenetrequest/TestMatchOutcomeOptionsType.hx new file mode 100644 index 0000000..b9dff46 --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/TestMatchOutcomeOptionsType.hx @@ -0,0 +1,10 @@ +package webextension_polyfill.declarativenetrequest; + +typedef TestMatchOutcomeOptionsType = { + /** + Whether to account for rules from other installed extensions during rule evaluation. + Optional. + **/ + @:optional + var includeOtherExtensions : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/TestMatchOutcomeRequestType.hx b/externs/webextension_polyfill/declarativenetrequest/TestMatchOutcomeRequestType.hx new file mode 100644 index 0000000..6a782db --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/TestMatchOutcomeRequestType.hx @@ -0,0 +1,34 @@ +package webextension_polyfill.declarativenetrequest; + +/** + The details of the request to test. +**/ +typedef TestMatchOutcomeRequestType = { + /** + The URL of the hypothetical request. + **/ + var url : String; + /** + The initiator URL (if any) for the hypothetical request. + Optional. + **/ + @:optional + var initiator : String; + /** + Standard HTTP method of the hypothetical request. + Optional. + **/ + @:optional + var method : String; + /** + The resource type of the hypothetical request. + **/ + var type : ResourceType; + /** + The ID of the tab in which the hypothetical request takes place. Does not need to correspond to a real tab ID. + Default is -1, meaning that the request isn't related to a tab. + Optional. + **/ + @:optional + var tabId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/URLTransform.hx b/externs/webextension_polyfill/declarativenetrequest/URLTransform.hx new file mode 100644 index 0000000..997a136 --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/URLTransform.hx @@ -0,0 +1,63 @@ +package webextension_polyfill.declarativenetrequest; + +/** + Describes the type of the Rule.action.redirect.transform property. +**/ +typedef URLTransform = { + /** + The new scheme for the request. + Optional. + **/ + @:optional + var scheme : URLTransformSchemeEnum; + /** + The new username for the request. + Optional. + **/ + @:optional + var username : String; + /** + The new password for the request. + Optional. + **/ + @:optional + var password : String; + /** + The new host name for the request. + Optional. + **/ + @:optional + var host : String; + /** + The new port for the request. If empty, the existing port is cleared. + Optional. + **/ + @:optional + var port : String; + /** + The new path for the request. If empty, the existing path is cleared. + Optional. + **/ + @:optional + var path : String; + /** + The new query for the request. Should be either empty, in which case the existing query is cleared; or should begin with + '?'. Cannot be specified if 'queryTransform' is specified. + Optional. + **/ + @:optional + var query : String; + /** + Add, remove or replace query key-value pairs. Cannot be specified if 'query' is specified. + Optional. + **/ + @:optional + var queryTransform : URLTransformQueryTransformType; + /** + The new fragment for the request. Should be either empty, in which case the existing fragment is cleared; or should + begin with '#'. + Optional. + **/ + @:optional + var fragment : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/URLTransformQueryTransformAddOrReplaceParamsItemType.hx b/externs/webextension_polyfill/declarativenetrequest/URLTransformQueryTransformAddOrReplaceParamsItemType.hx new file mode 100644 index 0000000..bec51ca --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/URLTransformQueryTransformAddOrReplaceParamsItemType.hx @@ -0,0 +1,12 @@ +package webextension_polyfill.declarativenetrequest; + +typedef URLTransformQueryTransformAddOrReplaceParamsItemType = { + var key : String; + var value : String; + /** + If true, the query key is replaced only if it's already present. Otherwise, the key is also added if it's missing. + Optional. + **/ + @:optional + var replaceOnly : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/URLTransformQueryTransformType.hx b/externs/webextension_polyfill/declarativenetrequest/URLTransformQueryTransformType.hx new file mode 100644 index 0000000..6fc0fcb --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/URLTransformQueryTransformType.hx @@ -0,0 +1,19 @@ +package webextension_polyfill.declarativenetrequest; + +/** + Add, remove or replace query key-value pairs. Cannot be specified if 'query' is specified. +**/ +typedef URLTransformQueryTransformType = { + /** + The list of query keys to be removed. + Optional. + **/ + @:optional + var removeParams : Array; + /** + The list of query key-value pairs to be added or replaced. + Optional. + **/ + @:optional + var addOrReplaceParams : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/URLTransformSchemeEnum.hx b/externs/webextension_polyfill/declarativenetrequest/URLTransformSchemeEnum.hx new file mode 100644 index 0000000..c1a545b --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/URLTransformSchemeEnum.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.declarativenetrequest; + +/** + The new scheme for the request. +**/ +typedef URLTransformSchemeEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/UnsupportedRegexReason.hx b/externs/webextension_polyfill/declarativenetrequest/UnsupportedRegexReason.hx new file mode 100644 index 0000000..bebaaad --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/UnsupportedRegexReason.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.declarativenetrequest; + +/** + Describes the reason why a given regular expression isn't supported. +**/ +typedef UnsupportedRegexReason = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/UpdateDynamicRulesOptionsType.hx b/externs/webextension_polyfill/declarativenetrequest/UpdateDynamicRulesOptionsType.hx new file mode 100644 index 0000000..22a35e5 --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/UpdateDynamicRulesOptionsType.hx @@ -0,0 +1,16 @@ +package webextension_polyfill.declarativenetrequest; + +typedef UpdateDynamicRulesOptionsType = { + /** + IDs of the rules to remove. Any invalid IDs will be ignored. + Optional. + **/ + @:optional + var removeRuleIds : Array; + /** + Rules to add. + Optional. + **/ + @:optional + var addRules : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/UpdateEnabledRulesetsUpdateRulesetOptionsType.hx b/externs/webextension_polyfill/declarativenetrequest/UpdateEnabledRulesetsUpdateRulesetOptionsType.hx new file mode 100644 index 0000000..b1c569e --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/UpdateEnabledRulesetsUpdateRulesetOptionsType.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.declarativenetrequest; + +typedef UpdateEnabledRulesetsUpdateRulesetOptionsType = { + /** + Optional. + **/ + @:optional + var disableRulesetIds : Array; + /** + Optional. + **/ + @:optional + var enableRulesetIds : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/declarativenetrequest/UpdateSessionRulesOptionsType.hx b/externs/webextension_polyfill/declarativenetrequest/UpdateSessionRulesOptionsType.hx new file mode 100644 index 0000000..bdf7468 --- /dev/null +++ b/externs/webextension_polyfill/declarativenetrequest/UpdateSessionRulesOptionsType.hx @@ -0,0 +1,16 @@ +package webextension_polyfill.declarativenetrequest; + +typedef UpdateSessionRulesOptionsType = { + /** + IDs of the rules to remove. Any invalid IDs will be ignored. + Optional. + **/ + @:optional + var removeRuleIds : Array; + /** + Rules to add. + Optional. + **/ + @:optional + var addRules : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/devtools/Static.hx b/externs/webextension_polyfill/devtools/Static.hx new file mode 100644 index 0000000..88393b9 --- /dev/null +++ b/externs/webextension_polyfill/devtools/Static.hx @@ -0,0 +1,7 @@ +package webextension_polyfill.devtools; + +typedef Static = { + var inspectedWindow : webextension_polyfill.namespaces.devtools_inspectedwindow.devtoolsinspectedwindow.Static; + var network : webextension_polyfill.namespaces.devtools_network.devtoolsnetwork.Static; + var panels : webextension_polyfill.namespaces.devtools_panels.devtoolspanels.Static; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/dns/DNSRecord.hx b/externs/webextension_polyfill/dns/DNSRecord.hx new file mode 100644 index 0000000..139dc24 --- /dev/null +++ b/externs/webextension_polyfill/dns/DNSRecord.hx @@ -0,0 +1,19 @@ +package webextension_polyfill.dns; + +/** + An object encapsulating a DNS Record. +**/ +typedef DNSRecord = { + /** + The canonical hostname for this record. this value is empty if the record was not fetched with the 'canonical_name' + flag. + Optional. + **/ + @:optional + var canonicalName : String; + /** + Record retreived with TRR. + **/ + var isTRR : String; + var addresses : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/dns/ResolveFlags.hx b/externs/webextension_polyfill/dns/ResolveFlags.hx new file mode 100644 index 0000000..5069c81 --- /dev/null +++ b/externs/webextension_polyfill/dns/ResolveFlags.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.dns; + +typedef ResolveFlags = Array; \ No newline at end of file diff --git a/externs/webextension_polyfill/dns/ResolveFlagsItemEnum.hx b/externs/webextension_polyfill/dns/ResolveFlagsItemEnum.hx new file mode 100644 index 0000000..b952463 --- /dev/null +++ b/externs/webextension_polyfill/dns/ResolveFlagsItemEnum.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.dns; + +typedef ResolveFlagsItemEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/dns/Static.hx b/externs/webextension_polyfill/dns/Static.hx new file mode 100644 index 0000000..d8e4b15 --- /dev/null +++ b/externs/webextension_polyfill/dns/Static.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.dns; + +typedef Static = { + /** + Resolves a hostname to a DNS record. + **/ + function resolve(hostname:String, ?flags:ResolveFlags):js.lib.Promise; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/downloads/BooleanDelta.hx b/externs/webextension_polyfill/downloads/BooleanDelta.hx new file mode 100644 index 0000000..47bec48 --- /dev/null +++ b/externs/webextension_polyfill/downloads/BooleanDelta.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.downloads; + +typedef BooleanDelta = { + /** + Optional. + **/ + @:optional + var current : Bool; + /** + Optional. + **/ + @:optional + var previous : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/downloads/DangerType.hx b/externs/webextension_polyfill/downloads/DangerType.hx new file mode 100644 index 0000000..3e771b4 --- /dev/null +++ b/externs/webextension_polyfill/downloads/DangerType.hx @@ -0,0 +1,10 @@ +package webextension_polyfill.downloads; + +/** +
file
The download's filename is suspicious.
url
The download's URL is known to be + malicious.
content
The downloaded file is known to be malicious.
uncommon
+ The download's URL is not commonly downloaded and could be dangerous.
safe
+ The download presents no known danger to the user's computer.
These string constants will never change, + however the set of DangerTypes may change. +**/ +typedef DangerType = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/downloads/DoubleDelta.hx b/externs/webextension_polyfill/downloads/DoubleDelta.hx new file mode 100644 index 0000000..eb08390 --- /dev/null +++ b/externs/webextension_polyfill/downloads/DoubleDelta.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.downloads; + +typedef DoubleDelta = { + /** + Optional. + **/ + @:optional + var current : Float; + /** + Optional. + **/ + @:optional + var previous : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/downloads/DownloadItem.hx b/externs/webextension_polyfill/downloads/DownloadItem.hx new file mode 100644 index 0000000..a5911b0 --- /dev/null +++ b/externs/webextension_polyfill/downloads/DownloadItem.hx @@ -0,0 +1,94 @@ +package webextension_polyfill.downloads; + +typedef DownloadItem = { + /** + An identifier that is persistent across browser sessions. + **/ + var id : Float; + /** + Absolute URL. + **/ + var url : String; + /** + Optional. + **/ + @:optional + var referrer : String; + /** + Absolute local path. + **/ + var filename : String; + /** + False if this download is recorded in the history, true if it is not recorded. + **/ + var incognito : Bool; + /** + The cookie store ID of the contextual identity. + Optional. + **/ + @:optional + var cookieStoreId : String; + /** + Indication of whether this download is thought to be safe or known to be suspicious. + **/ + var danger : DangerType; + /** + The file's MIME type. + Optional. + **/ + @:optional + var mime : String; + /** + Number of milliseconds between the unix epoch and when this download began. + **/ + var startTime : String; + /** + Number of milliseconds between the unix epoch and when this download ended. + Optional. + **/ + @:optional + var endTime : String; + /** + Optional. + **/ + @:optional + var estimatedEndTime : String; + /** + Indicates whether the download is progressing, interrupted, or complete. + **/ + var state : State; + /** + True if the download has stopped reading data from the host, but kept the connection open. + **/ + var paused : Bool; + var canResume : Bool; + /** + Number indicating why a download was interrupted. + Optional. + **/ + @:optional + var error : InterruptReason; + /** + Number of bytes received so far from the host, without considering file compression. + **/ + var bytesReceived : Float; + /** + Number of bytes in the whole file, without considering file compression, or -1 if unknown. + **/ + var totalBytes : Float; + /** + Number of bytes in the whole file post-decompression, or -1 if unknown. + **/ + var fileSize : Float; + var exists : Bool; + /** + Optional. + **/ + @:optional + var byExtensionId : String; + /** + Optional. + **/ + @:optional + var byExtensionName : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/downloads/DownloadOptionsType.hx b/externs/webextension_polyfill/downloads/DownloadOptionsType.hx new file mode 100644 index 0000000..0a2e89d --- /dev/null +++ b/externs/webextension_polyfill/downloads/DownloadOptionsType.hx @@ -0,0 +1,69 @@ +package webextension_polyfill.downloads; + +/** + What to download and how. +**/ +typedef DownloadOptionsType = { + /** + The URL to download. + **/ + var url : String; + /** + A file path relative to the Downloads directory to contain the downloaded file. + Optional. + **/ + @:optional + var filename : String; + /** + Whether to associate the download with a private browsing session. + Optional. + **/ + @:optional + var incognito : Bool; + /** + The cookie store ID of the contextual identity; requires "cookies" permission. + Optional. + **/ + @:optional + var cookieStoreId : String; + /** + Optional. + **/ + @:optional + var conflictAction : FilenameConflictAction; + /** + Use a file-chooser to allow the user to select a filename. If the option is not specified, + the file chooser will be shown only if the Firefox "Always ask you where to save files" option is enabled (i.e. + the pref browser.download.useDownloadDir is set to false). + Optional. + **/ + @:optional + var saveAs : Bool; + /** + The HTTP method to use if the URL uses the HTTP[S] protocol. + Optional. + **/ + @:optional + var method : DownloadOptionsTypeMethodEnum; + /** + Extra HTTP headers to send with the request if the URL uses the HTTP[s] protocol. Each header is represented as a + dictionary containing the keys name and either value or binaryValue, + restricted to those allowed by XMLHttpRequest. + Optional. + **/ + @:optional + var headers : Array; + /** + Post body. + Optional. + **/ + @:optional + var body : String; + /** + When this flag is set to true, then the browser will allow downloads to proceed after encountering HTTP + errors such as 404 Not Found. + Optional. + **/ + @:optional + var allowHttpErrors : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/downloads/DownloadOptionsTypeHeadersItemType.hx b/externs/webextension_polyfill/downloads/DownloadOptionsTypeHeadersItemType.hx new file mode 100644 index 0000000..2034e0d --- /dev/null +++ b/externs/webextension_polyfill/downloads/DownloadOptionsTypeHeadersItemType.hx @@ -0,0 +1,12 @@ +package webextension_polyfill.downloads; + +typedef DownloadOptionsTypeHeadersItemType = { + /** + Name of the HTTP header. + **/ + var name : String; + /** + Value of the HTTP header. + **/ + var value : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/downloads/DownloadOptionsTypeMethodEnum.hx b/externs/webextension_polyfill/downloads/DownloadOptionsTypeMethodEnum.hx new file mode 100644 index 0000000..cfe5cbe --- /dev/null +++ b/externs/webextension_polyfill/downloads/DownloadOptionsTypeMethodEnum.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.downloads; + +/** + The HTTP method to use if the URL uses the HTTP[S] protocol. +**/ +typedef DownloadOptionsTypeMethodEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/downloads/DownloadQuery.hx b/externs/webextension_polyfill/downloads/DownloadQuery.hx new file mode 100644 index 0000000..3161cfe --- /dev/null +++ b/externs/webextension_polyfill/downloads/DownloadQuery.hx @@ -0,0 +1,168 @@ +package webextension_polyfill.downloads; + +/** + Parameters that combine to specify a predicate that can be used to select a set of downloads. + Used for example in search() and erase() +**/ +typedef DownloadQuery = { + /** + This array of search terms limits results to DownloadItems whose filename + or url contain all of the search terms that do not begin with a dash '-' and none of the search terms that + do begin with a dash. + Optional. + **/ + @:optional + var query : Array; + /** + Limits results to downloads that started before the given ms since the epoch. + Optional. + **/ + @:optional + var startedBefore : webextension_polyfill.extensiontypes.DateType; + /** + Limits results to downloads that started after the given ms since the epoch. + Optional. + **/ + @:optional + var startedAfter : webextension_polyfill.extensiontypes.DateType; + /** + Limits results to downloads that ended before the given ms since the epoch. + Optional. + **/ + @:optional + var endedBefore : webextension_polyfill.extensiontypes.DateType; + /** + Limits results to downloads that ended after the given ms since the epoch. + Optional. + **/ + @:optional + var endedAfter : webextension_polyfill.extensiontypes.DateType; + /** + Limits results to downloads whose totalBytes is greater than the given integer. + Optional. + **/ + @:optional + var totalBytesGreater : Float; + /** + Limits results to downloads whose totalBytes is less than the given integer. + Optional. + **/ + @:optional + var totalBytesLess : Float; + /** + Limits results to DownloadItems whose filename + matches the given regular expression. + Optional. + **/ + @:optional + var filenameRegex : String; + /** + Limits results to DownloadItems whose url + matches the given regular expression. + Optional. + **/ + @:optional + var urlRegex : String; + /** + Setting this integer limits the number of results. Otherwise, all matching DownloadItems + will be returned. + Optional. + **/ + @:optional + var limit : Float; + /** + Setting elements of this array to DownloadItem properties in order to sort the search + results. For example, setting orderBy='startTime' sorts the DownloadItems + by their start time in ascending order. To specify descending order, prefix orderBy + with a hyphen: '-startTime'. + Optional. + **/ + @:optional + var orderBy : Array; + /** + Optional. + **/ + @:optional + var id : Float; + /** + Absolute URL. + Optional. + **/ + @:optional + var url : String; + /** + Absolute local path. + Optional. + **/ + @:optional + var filename : String; + /** + The cookie store ID of the contextual identity. + Optional. + **/ + @:optional + var cookieStoreId : String; + /** + Indication of whether this download is thought to be safe or known to be suspicious. + Optional. + **/ + @:optional + var danger : DangerType; + /** + The file's MIME type. + Optional. + **/ + @:optional + var mime : String; + /** + Optional. + **/ + @:optional + var startTime : String; + /** + Optional. + **/ + @:optional + var endTime : String; + /** + Indicates whether the download is progressing, interrupted, or complete. + Optional. + **/ + @:optional + var state : State; + /** + True if the download has stopped reading data from the host, but kept the connection open. + Optional. + **/ + @:optional + var paused : Bool; + /** + Why a download was interrupted. + Optional. + **/ + @:optional + var error : InterruptReason; + /** + Number of bytes received so far from the host, without considering file compression. + Optional. + **/ + @:optional + var bytesReceived : Float; + /** + Number of bytes in the whole file, without considering file compression, or -1 if unknown. + Optional. + **/ + @:optional + var totalBytes : Float; + /** + Number of bytes in the whole file post-decompression, or -1 if unknown. + Optional. + **/ + @:optional + var fileSize : Float; + /** + Optional. + **/ + @:optional + var exists : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/downloads/DownloadTime.hx b/externs/webextension_polyfill/downloads/DownloadTime.hx new file mode 100644 index 0000000..7748667 --- /dev/null +++ b/externs/webextension_polyfill/downloads/DownloadTime.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.downloads; + +/** + A time specified as a Date object, a number or string representing milliseconds since the epoch, or an ISO 8601 string +**/ +typedef DownloadTime = webextension_polyfill.extensiontypes.DateType; \ No newline at end of file diff --git a/externs/webextension_polyfill/downloads/FilenameConflictAction.hx b/externs/webextension_polyfill/downloads/FilenameConflictAction.hx new file mode 100644 index 0000000..9e32cb9 --- /dev/null +++ b/externs/webextension_polyfill/downloads/FilenameConflictAction.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.downloads; + +typedef FilenameConflictAction = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/downloads/GetFileIconOptionsType.hx b/externs/webextension_polyfill/downloads/GetFileIconOptionsType.hx new file mode 100644 index 0000000..26bafaa --- /dev/null +++ b/externs/webextension_polyfill/downloads/GetFileIconOptionsType.hx @@ -0,0 +1,11 @@ +package webextension_polyfill.downloads; + +typedef GetFileIconOptionsType = { + /** + The size of the icon. The returned icon will be square with dimensions size * size pixels. + The default size for the icon is 32x32 pixels. + Optional. + **/ + @:optional + var size : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/downloads/InterruptReason.hx b/externs/webextension_polyfill/downloads/InterruptReason.hx new file mode 100644 index 0000000..d5f9ded --- /dev/null +++ b/externs/webextension_polyfill/downloads/InterruptReason.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.downloads; + +typedef InterruptReason = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/downloads/OnChangedDownloadDeltaType.hx b/externs/webextension_polyfill/downloads/OnChangedDownloadDeltaType.hx new file mode 100644 index 0000000..89c4a61 --- /dev/null +++ b/externs/webextension_polyfill/downloads/OnChangedDownloadDeltaType.hx @@ -0,0 +1,84 @@ +package webextension_polyfill.downloads; + +typedef OnChangedDownloadDeltaType = { + /** + The id of the DownloadItem that changed. + **/ + var id : Float; + /** + Describes a change in a DownloadItem's url. + Optional. + **/ + @:optional + var url : StringDelta; + /** + Describes a change in a DownloadItem's filename. + Optional. + **/ + @:optional + var filename : StringDelta; + /** + Describes a change in a DownloadItem's danger. + Optional. + **/ + @:optional + var danger : StringDelta; + /** + Describes a change in a DownloadItem's mime. + Optional. + **/ + @:optional + var mime : StringDelta; + /** + Describes a change in a DownloadItem's startTime. + Optional. + **/ + @:optional + var startTime : StringDelta; + /** + Describes a change in a DownloadItem's endTime. + Optional. + **/ + @:optional + var endTime : StringDelta; + /** + Describes a change in a DownloadItem's state. + Optional. + **/ + @:optional + var state : StringDelta; + /** + Optional. + **/ + @:optional + var canResume : BooleanDelta; + /** + Describes a change in a DownloadItem's paused. + Optional. + **/ + @:optional + var paused : BooleanDelta; + /** + Describes a change in a DownloadItem's error. + Optional. + **/ + @:optional + var error : StringDelta; + /** + Describes a change in a DownloadItem's totalBytes. + Optional. + **/ + @:optional + var totalBytes : DoubleDelta; + /** + Describes a change in a DownloadItem's fileSize. + Optional. + **/ + @:optional + var fileSize : DoubleDelta; + /** + Optional. + **/ + @:optional + var exists : BooleanDelta; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/downloads/State.hx b/externs/webextension_polyfill/downloads/State.hx new file mode 100644 index 0000000..cda9318 --- /dev/null +++ b/externs/webextension_polyfill/downloads/State.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.downloads; + +/** +
in_progress
The download is currently receiving data from the server.
interrupted
+ An error broke the connection with the file host.
complete
The download completed successfully.
+ These string constants will never change, however the set of States may change. +**/ +typedef State = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/downloads/Static.hx b/externs/webextension_polyfill/downloads/Static.hx new file mode 100644 index 0000000..5008a1a --- /dev/null +++ b/externs/webextension_polyfill/downloads/Static.hx @@ -0,0 +1,75 @@ +package webextension_polyfill.downloads; + +typedef Static = { + /** + Download a URL. If the URL uses the HTTP[S] protocol, then the request will include all cookies currently set for its + hostname. If both filename and saveAs are specified, then the Save As dialog will be displayed, + pre-populated with the specified filename. If the download started successfully, callback + will be called with the new DownloadItem's downloadId. + If there was an error starting the download, then callback will be called with + downloadId=undefined and chrome.extension.lastError + will contain a descriptive string. The error strings are not guaranteed to remain backwards compatible between releases. + You must not parse it. + **/ + function download(options:DownloadOptionsType):js.lib.Promise; + /** + Find DownloadItems. Set query to the empty object to get all DownloadItems. To get a specific DownloadItem, + set only the id field. + **/ + function search(query:DownloadQuery):js.lib.Promise>; + /** + Pause the download. If the request was successful the download is in a paused state. Otherwise chrome.extension.lastError contains an error message. + The request will fail if the download is not active. + **/ + function pause(downloadId:Float):js.lib.Promise; + /** + Resume a paused download. If the request was successful the download is in progress and unpaused. + Otherwise chrome.extension.lastError contains an error message. + The request will fail if the download is not active. + **/ + function resume(downloadId:Float):js.lib.Promise; + /** + Cancel a download. When callback is run, the download is cancelled, completed, + interrupted or doesn't exist anymore. + **/ + function cancel(downloadId:Float):js.lib.Promise; + /** + Retrieve an icon for the specified download. For new downloads, file icons are available after the onCreated event has been received. The image returned by this function while a download is + in progress may be different from the image returned after the download is complete. + Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. + The icon that is returned will therefore depend on a number of factors including state of the download, platform, + registered file types and visual theme. If a file icon cannot be determined, chrome.extension.lastError will contain an error message. + **/ + function getFileIcon(downloadId:Float, ?options:GetFileIconOptionsType):js.lib.Promise; + /** + Open the downloaded file. + **/ + function open(downloadId:Float):js.lib.Promise; + /** + Show the downloaded file in its folder in a file manager. + **/ + function show(downloadId:Float):js.lib.Promise; + function showDefaultFolder():Void; + /** + Erase matching DownloadItems from history + **/ + function erase(query:DownloadQuery):js.lib.Promise>; + function removeFile(downloadId:Float):js.lib.Promise; + /** + This event fires with the DownloadItem object when a download begins. + **/ + var onCreated : webextension_polyfill.events.Event<(downloadItem:DownloadItem) -> Void>; + /** + Fires with the downloadId when a download is erased from history. + **/ + var onErased : webextension_polyfill.events.Event<(downloadId:Float) -> Void>; + /** + When any of a DownloadItem's properties except bytesReceived changes, + this event fires with the downloadId and an object containing the properties that changed. + **/ + var onChanged : webextension_polyfill.events.Event<(downloadDelta:OnChangedDownloadDeltaType) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/downloads/StringDelta.hx b/externs/webextension_polyfill/downloads/StringDelta.hx new file mode 100644 index 0000000..4cea233 --- /dev/null +++ b/externs/webextension_polyfill/downloads/StringDelta.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.downloads; + +typedef StringDelta = { + /** + Optional. + **/ + @:optional + var current : String; + /** + Optional. + **/ + @:optional + var previous : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/events/Event.hx b/externs/webextension_polyfill/events/Event.hx new file mode 100644 index 0000000..fc91f95 --- /dev/null +++ b/externs/webextension_polyfill/events/Event.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.events; + +/** + An object which allows the addition and removal of listeners for a Chrome event. +**/ +typedef Event = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:T, params:haxe.extern.Rest):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:T):Void; + function hasListener(callback:T):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/events/Rule.hx b/externs/webextension_polyfill/events/Rule.hx new file mode 100644 index 0000000..3a37beb --- /dev/null +++ b/externs/webextension_polyfill/events/Rule.hx @@ -0,0 +1,33 @@ +package webextension_polyfill.events; + +/** + Description of a declarative rule for handling events. +**/ +typedef Rule = { + /** + Optional identifier that allows referencing this rule. + Optional. + **/ + @:optional + var id : String; + /** + Tags can be used to annotate rules and perform operations on sets of rules. + Optional. + **/ + @:optional + var tags : Array; + /** + List of conditions that can trigger the actions. + **/ + var conditions : Array; + /** + List of actions that are triggered if one of the condtions is fulfilled. + **/ + var actions : Array; + /** + Optional priority of this rule. Defaults to 100. + Optional. + **/ + @:optional + var priority : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/events/Static.hx b/externs/webextension_polyfill/events/Static.hx new file mode 100644 index 0000000..43c949f --- /dev/null +++ b/externs/webextension_polyfill/events/Static.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.events; + +typedef Static = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/events/UrlFilter.hx b/externs/webextension_polyfill/events/UrlFilter.hx new file mode 100644 index 0000000..f5316c7 --- /dev/null +++ b/externs/webextension_polyfill/events/UrlFilter.hx @@ -0,0 +1,140 @@ +package webextension_polyfill.events; + +/** + Filters URLs for various criteria. See event filtering. All criteria are case sensitive. +**/ +typedef UrlFilter = { + /** + 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. + Optional. + **/ + @:optional + var hostContains : String; + /** + Matches if the host name of the URL is equal to a specified string. + Optional. + **/ + @:optional + var hostEquals : String; + /** + Matches if the host name of the URL starts with a specified string. + Optional. + **/ + @:optional + var hostPrefix : String; + /** + Matches if the host name of the URL ends with a specified string. + Optional. + **/ + @:optional + var hostSuffix : String; + /** + Matches if the path segment of the URL contains a specified string. + Optional. + **/ + @:optional + var pathContains : String; + /** + Matches if the path segment of the URL is equal to a specified string. + Optional. + **/ + @:optional + var pathEquals : String; + /** + Matches if the path segment of the URL starts with a specified string. + Optional. + **/ + @:optional + var pathPrefix : String; + /** + Matches if the path segment of the URL ends with a specified string. + Optional. + **/ + @:optional + var pathSuffix : String; + /** + Matches if the query segment of the URL contains a specified string. + Optional. + **/ + @:optional + var queryContains : String; + /** + Matches if the query segment of the URL is equal to a specified string. + Optional. + **/ + @:optional + var queryEquals : String; + /** + Matches if the query segment of the URL starts with a specified string. + Optional. + **/ + @:optional + var queryPrefix : String; + /** + Matches if the query segment of the URL ends with a specified string. + Optional. + **/ + @:optional + var querySuffix : String; + /** + 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. + Optional. + **/ + @:optional + var urlContains : String; + /** + 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. + Optional. + **/ + @:optional + var urlEquals : String; + /** + 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. + Optional. + **/ + @:optional + var urlMatches : String; + /** + 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. + Optional. + **/ + @:optional + var originAndPathMatches : String; + /** + 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. + Optional. + **/ + @:optional + var urlPrefix : String; + /** + 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. + Optional. + **/ + @:optional + var urlSuffix : String; + /** + Matches if the scheme of the URL is equal to any of the schemes specified in the array. + Optional. + **/ + @:optional + var schemes : Array; + /** + 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. + Optional. + **/ + @:optional + var ports : Array>>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/experiments/APIChildScope.hx b/externs/webextension_polyfill/experiments/APIChildScope.hx new file mode 100644 index 0000000..cdacd70 --- /dev/null +++ b/externs/webextension_polyfill/experiments/APIChildScope.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.experiments; + +typedef APIChildScope = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/experiments/APIEvent.hx b/externs/webextension_polyfill/experiments/APIEvent.hx new file mode 100644 index 0000000..6849ac1 --- /dev/null +++ b/externs/webextension_polyfill/experiments/APIEvent.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.experiments; + +typedef APIEvent = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/experiments/APIEvents.hx b/externs/webextension_polyfill/experiments/APIEvents.hx new file mode 100644 index 0000000..3ad643d --- /dev/null +++ b/externs/webextension_polyfill/experiments/APIEvents.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.experiments; + +typedef APIEvents = Array; \ No newline at end of file diff --git a/externs/webextension_polyfill/experiments/APIParentScope.hx b/externs/webextension_polyfill/experiments/APIParentScope.hx new file mode 100644 index 0000000..6d8e7d4 --- /dev/null +++ b/externs/webextension_polyfill/experiments/APIParentScope.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.experiments; + +typedef APIParentScope = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/experiments/APIPath.hx b/externs/webextension_polyfill/experiments/APIPath.hx new file mode 100644 index 0000000..0013325 --- /dev/null +++ b/externs/webextension_polyfill/experiments/APIPath.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.experiments; + +typedef APIPath = Array; \ No newline at end of file diff --git a/externs/webextension_polyfill/experiments/APIPaths.hx b/externs/webextension_polyfill/experiments/APIPaths.hx new file mode 100644 index 0000000..3e670c1 --- /dev/null +++ b/externs/webextension_polyfill/experiments/APIPaths.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.experiments; + +typedef APIPaths = Array; \ No newline at end of file diff --git a/externs/webextension_polyfill/experiments/ExperimentAPI.hx b/externs/webextension_polyfill/experiments/ExperimentAPI.hx new file mode 100644 index 0000000..cc2e346 --- /dev/null +++ b/externs/webextension_polyfill/experiments/ExperimentAPI.hx @@ -0,0 +1,15 @@ +package webextension_polyfill.experiments; + +typedef ExperimentAPI = { + var schema : String; + /** + Optional. + **/ + @:optional + var parent : ExperimentAPIParentType; + /** + Optional. + **/ + @:optional + var child : ExperimentAPIChildType; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/experiments/ExperimentAPIChildType.hx b/externs/webextension_polyfill/experiments/ExperimentAPIChildType.hx new file mode 100644 index 0000000..dda626d --- /dev/null +++ b/externs/webextension_polyfill/experiments/ExperimentAPIChildType.hx @@ -0,0 +1,7 @@ +package webextension_polyfill.experiments; + +typedef ExperimentAPIChildType = { + var paths : APIPaths; + var script : String; + var scopes : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/experiments/ExperimentAPIParentType.hx b/externs/webextension_polyfill/experiments/ExperimentAPIParentType.hx new file mode 100644 index 0000000..939692c --- /dev/null +++ b/externs/webextension_polyfill/experiments/ExperimentAPIParentType.hx @@ -0,0 +1,20 @@ +package webextension_polyfill.experiments; + +typedef ExperimentAPIParentType = { + /** + Optional. + **/ + @:optional + var events : APIEvents; + /** + Optional. + **/ + @:optional + var paths : APIPaths; + var script : String; + /** + Optional. + **/ + @:optional + var scopes : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/experiments/ExperimentURL.hx b/externs/webextension_polyfill/experiments/ExperimentURL.hx new file mode 100644 index 0000000..c0144cf --- /dev/null +++ b/externs/webextension_polyfill/experiments/ExperimentURL.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.experiments; + +typedef ExperimentURL = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/experiments/Static.hx b/externs/webextension_polyfill/experiments/Static.hx new file mode 100644 index 0000000..8f1e0eb --- /dev/null +++ b/externs/webextension_polyfill/experiments/Static.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.experiments; + +typedef Static = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/extension/GetViewsFetchPropertiesType.hx b/externs/webextension_polyfill/extension/GetViewsFetchPropertiesType.hx new file mode 100644 index 0000000..bd8df23 --- /dev/null +++ b/externs/webextension_polyfill/extension/GetViewsFetchPropertiesType.hx @@ -0,0 +1,23 @@ +package webextension_polyfill.extension; + +typedef GetViewsFetchPropertiesType = { + /** + The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', + 'popup', 'sidebar'. + Optional. + **/ + @:optional + var type : ViewType; + /** + The window to restrict the search to. If omitted, returns all views. + Optional. + **/ + @:optional + var windowId : Float; + /** + Find a view according to a tab id. If this field is omitted, returns all views. + Optional. + **/ + @:optional + var tabId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/extension/Static.hx b/externs/webextension_polyfill/extension/Static.hx new file mode 100644 index 0000000..0562353 --- /dev/null +++ b/externs/webextension_polyfill/extension/Static.hx @@ -0,0 +1,30 @@ +package webextension_polyfill.extension; + +typedef Static = { + /** + Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension. + **/ + function getViews(?fetchProperties:GetViewsFetchPropertiesType):Array; + /** + Returns the JavaScript 'window' object for the background page running inside the current extension. + Returns null if the extension has no background page. + **/ + function getBackgroundPage():js.html.Window; + /** + Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in + Incognito' checkbox. + **/ + function isAllowedIncognitoAccess():js.lib.Promise; + /** + Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow + access to File URLs' checkbox. + **/ + function isAllowedFileSchemeAccess():js.lib.Promise; + /** + True for content scripts running inside incognito tabs, and for extension pages running inside an incognito process. + The latter only applies to extensions with 'split' incognito_behavior. + Optional. + **/ + @:optional + var inIncognitoContext : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/extension/ViewType.hx b/externs/webextension_polyfill/extension/ViewType.hx new file mode 100644 index 0000000..79c9aaf --- /dev/null +++ b/externs/webextension_polyfill/extension/ViewType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.extension; + +/** + The type of extension view. +**/ +typedef ViewType = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/extensiontypes/CSSOrigin.hx b/externs/webextension_polyfill/extensiontypes/CSSOrigin.hx new file mode 100644 index 0000000..865f88c --- /dev/null +++ b/externs/webextension_polyfill/extensiontypes/CSSOrigin.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.extensiontypes; + +/** + The origin of the CSS to inject, this affects the cascading order (priority) of the stylesheet. +**/ +typedef CSSOrigin = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/extensiontypes/DateType.hx b/externs/webextension_polyfill/extensiontypes/DateType.hx new file mode 100644 index 0000000..e15f06d --- /dev/null +++ b/externs/webextension_polyfill/extensiontypes/DateType.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.extensiontypes; + +typedef DateType = ts.AnyOf3; \ No newline at end of file diff --git a/externs/webextension_polyfill/extensiontypes/ExtensionFileOrCode.hx b/externs/webextension_polyfill/extensiontypes/ExtensionFileOrCode.hx new file mode 100644 index 0000000..2fdd9ee --- /dev/null +++ b/externs/webextension_polyfill/extensiontypes/ExtensionFileOrCode.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.extensiontypes; + +typedef ExtensionFileOrCode = ts.AnyOf2; \ No newline at end of file diff --git a/externs/webextension_polyfill/extensiontypes/ExtensionFileOrCodeC1Type.hx b/externs/webextension_polyfill/extensiontypes/ExtensionFileOrCodeC1Type.hx new file mode 100644 index 0000000..8c17f79 --- /dev/null +++ b/externs/webextension_polyfill/extensiontypes/ExtensionFileOrCodeC1Type.hx @@ -0,0 +1,5 @@ +package webextension_polyfill.extensiontypes; + +typedef ExtensionFileOrCodeC1Type = { + var file : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/extensiontypes/ExtensionFileOrCodeC2Type.hx b/externs/webextension_polyfill/extensiontypes/ExtensionFileOrCodeC2Type.hx new file mode 100644 index 0000000..1b2f0f0 --- /dev/null +++ b/externs/webextension_polyfill/extensiontypes/ExtensionFileOrCodeC2Type.hx @@ -0,0 +1,5 @@ +package webextension_polyfill.extensiontypes; + +typedef ExtensionFileOrCodeC2Type = { + var code : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/extensiontypes/ImageDetails.hx b/externs/webextension_polyfill/extensiontypes/ImageDetails.hx new file mode 100644 index 0000000..35fd76d --- /dev/null +++ b/externs/webextension_polyfill/extensiontypes/ImageDetails.hx @@ -0,0 +1,39 @@ +package webextension_polyfill.extensiontypes; + +/** + Details about the format, quality, area and scale of the capture. +**/ +typedef ImageDetails = { + /** + The format of the resulting image. Default is "jpeg". + Optional. + **/ + @:optional + var format : webextension_polyfill.clipboard.SetImageDataImageTypeEnum; + /** + 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. + Optional. + **/ + @:optional + var quality : Float; + /** + The area of the document to capture, in CSS pixels, relative to the page. If omitted, capture the visible viewport. + Optional. + **/ + @:optional + var rect : ImageDetailsRectType; + /** + The scale of the resulting image. Defaults to devicePixelRatio. + Optional. + **/ + @:optional + var scale : Float; + /** + If true, temporarily resets the scroll position of the document to 0. Only takes effect if rect is also specified. + Optional. + **/ + @:optional + var resetScrollPosition : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/extensiontypes/ImageDetailsRectType.hx b/externs/webextension_polyfill/extensiontypes/ImageDetailsRectType.hx new file mode 100644 index 0000000..93afe72 --- /dev/null +++ b/externs/webextension_polyfill/extensiontypes/ImageDetailsRectType.hx @@ -0,0 +1,11 @@ +package webextension_polyfill.extensiontypes; + +/** + The area of the document to capture, in CSS pixels, relative to the page. If omitted, capture the visible viewport. +**/ +typedef ImageDetailsRectType = { + var x : Float; + var y : Float; + var width : Float; + var height : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/extensiontypes/ImageFormat.hx b/externs/webextension_polyfill/extensiontypes/ImageFormat.hx new file mode 100644 index 0000000..8c41d27 --- /dev/null +++ b/externs/webextension_polyfill/extensiontypes/ImageFormat.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.extensiontypes; + +/** + The format of an image. +**/ +typedef ImageFormat = webextension_polyfill.clipboard.SetImageDataImageTypeEnum; \ No newline at end of file diff --git a/externs/webextension_polyfill/extensiontypes/InjectDetails.hx b/externs/webextension_polyfill/extensiontypes/InjectDetails.hx new file mode 100644 index 0000000..71ba108 --- /dev/null +++ b/externs/webextension_polyfill/extensiontypes/InjectDetails.hx @@ -0,0 +1,54 @@ +package webextension_polyfill.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. +**/ +typedef InjectDetails = { + /** + JavaScript or CSS code to inject.

Warning:
Be careful using the code parameter. + Incorrect use of it may open your extension to + cross site scripting attacks. + Optional. + **/ + @:optional + var code : String; + /** + JavaScript or CSS file to inject. + Optional. + **/ + @:optional + var file : String; + /** + 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. + Optional. + **/ + @:optional + var allFrames : Bool; + /** + 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. + Optional. + **/ + @:optional + var matchAboutBlank : Bool; + /** + The ID of the frame to inject the script into. This may not be used in combination with allFrames. + Optional. + **/ + @:optional + var frameId : Float; + /** + The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle". + Optional. + **/ + @:optional + var runAt : RunAt; + /** + The css origin of the stylesheet to inject. Defaults to "author". + Optional. + **/ + @:optional + var cssOrigin : CSSOrigin; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/extensiontypes/PlainJSONValue.hx b/externs/webextension_polyfill/extensiontypes/PlainJSONValue.hx new file mode 100644 index 0000000..9c5c1cb --- /dev/null +++ b/externs/webextension_polyfill/extensiontypes/PlainJSONValue.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.extensiontypes; + +/** + A plain JSON value +**/ +typedef PlainJSONValue = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/extensiontypes/RunAt.hx b/externs/webextension_polyfill/extensiontypes/RunAt.hx new file mode 100644 index 0000000..116d1da --- /dev/null +++ b/externs/webextension_polyfill/extensiontypes/RunAt.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.extensiontypes; + +/** + The soonest that the JavaScript or CSS will be injected into the tab. +**/ +typedef RunAt = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/extensiontypes/Static.hx b/externs/webextension_polyfill/extensiontypes/Static.hx new file mode 100644 index 0000000..1f709a9 --- /dev/null +++ b/externs/webextension_polyfill/extensiontypes/Static.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.extensiontypes; + +typedef Static = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/find/FindParamsType.hx b/externs/webextension_polyfill/find/FindParamsType.hx new file mode 100644 index 0000000..fa23757 --- /dev/null +++ b/externs/webextension_polyfill/find/FindParamsType.hx @@ -0,0 +1,43 @@ +package webextension_polyfill.find; + +/** + Search parameters. +**/ +typedef FindParamsType = { + /** + Tab to query. Defaults to the active tab. + Optional. + **/ + @:optional + var tabId : Float; + /** + Find only ranges with case sensitive match. + Optional. + **/ + @:optional + var caseSensitive : Bool; + /** + Find only ranges with diacritic sensitive match. + Optional. + **/ + @:optional + var matchDiacritics : Bool; + /** + Find only ranges that match entire word. + Optional. + **/ + @:optional + var entireWord : Bool; + /** + Return rectangle data which describes visual position of search results. + Optional. + **/ + @:optional + var includeRectData : Bool; + /** + Return range data which provides range data in a serializable form. + Optional. + **/ + @:optional + var includeRangeData : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/find/FindResult.hx b/externs/webextension_polyfill/find/FindResult.hx new file mode 100644 index 0000000..78b3fd8 --- /dev/null +++ b/externs/webextension_polyfill/find/FindResult.hx @@ -0,0 +1,26 @@ +package webextension_polyfill.find; + +typedef FindResult = { + /** + The number of results found. + **/ + var count : Float; + /** + If includeRangeData was given in the options parameter, then this property will be included. + It is provided as an array of RangeData objects, one for each match. Each RangeData object describes where in the DOM + tree the match was found. This would enable, for example, an extension to get the text surrounding each match, + so as to display context for the matches. The items correspond to the items given in rectData, so rangeData[i] + describes the same match as rectData[i]. + Optional. + **/ + @:optional + var rangeData : Array; + /** + If includeRectData was given in the options parameter, then this property will be included. + It is an array of RectData objects. It contains client rectangles for all the text matched in the search, + relative to the top-left of the viewport. Extensions can use this to provide custom highlighting of the results. + Optional. + **/ + @:optional + var rectData : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/find/HighlightResultsParamsType.hx b/externs/webextension_polyfill/find/HighlightResultsParamsType.hx new file mode 100644 index 0000000..c093cc1 --- /dev/null +++ b/externs/webextension_polyfill/find/HighlightResultsParamsType.hx @@ -0,0 +1,25 @@ +package webextension_polyfill.find; + +/** + highlightResults parameters +**/ +typedef HighlightResultsParamsType = { + /** + Found range to be highlighted. Default highlights all ranges. + Optional. + **/ + @:optional + var rangeIndex : Float; + /** + Tab to highlight. Defaults to the active tab. + Optional. + **/ + @:optional + var tabId : Float; + /** + Don't scroll to highlighted item. + Optional. + **/ + @:optional + var noScroll : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/find/RangeData.hx b/externs/webextension_polyfill/find/RangeData.hx new file mode 100644 index 0000000..78ff19b --- /dev/null +++ b/externs/webextension_polyfill/find/RangeData.hx @@ -0,0 +1,28 @@ +package webextension_polyfill.find; + +typedef RangeData = { + /** + The index of the frame containing the match. 0 corresponds to the parent window. Note that the order of objects in the + rangeData array will sequentially line up with the order of frame indexes: for example, + framePos for the first sequence of rangeData objects will be 0, framePos for the next sequence will be 1, and so on. + **/ + var framePos : Float; + /** + The ordinal position of the text node in which the match started. + **/ + var startTextNodePos : Float; + /** + The ordinal position of the text node in which the match ended. + **/ + var endTextNodePos : Float; + /** + The ordinal string position of the start of the matched word within start text node. + If match word include in single text node, Extension can get match word between startOffset and endOffset string index + in the single text node. + **/ + var startOffset : Float; + /** + The ordinal string position of the end of the matched word within end text node. + **/ + var endOffset : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/find/RectData.hx b/externs/webextension_polyfill/find/RectData.hx new file mode 100644 index 0000000..094cf89 --- /dev/null +++ b/externs/webextension_polyfill/find/RectData.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.find; + +typedef RectData = { + /** + The index of the frame containing the match. 0 corresponds to the parent window. Note that the order of objects in the + rangeData array will sequentially line up with the order of frame indexes: for example, + framePos for the first sequence of rangeData objects will be 0, framePos for the next sequence will be 1, and so on. + **/ + var rectsAndTexts : RectsAndTexts; + /** + The complete text of the match. + **/ + var text : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/find/Rectangle.hx b/externs/webextension_polyfill/find/Rectangle.hx new file mode 100644 index 0000000..8e552b5 --- /dev/null +++ b/externs/webextension_polyfill/find/Rectangle.hx @@ -0,0 +1,20 @@ +package webextension_polyfill.find; + +typedef Rectangle = { + /** + Pixels from the top. + **/ + var top : Float; + /** + Pixels from the left. + **/ + var left : Float; + /** + Pixels from the bottom. + **/ + var bottom : Float; + /** + Pixels from the right. + **/ + var right : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/find/RectsAndTexts.hx b/externs/webextension_polyfill/find/RectsAndTexts.hx new file mode 100644 index 0000000..55aadc8 --- /dev/null +++ b/externs/webextension_polyfill/find/RectsAndTexts.hx @@ -0,0 +1,13 @@ +package webextension_polyfill.find; + +typedef RectsAndTexts = { + /** + Rectangles relative to the top-left of the viewport. + **/ + var rectList : Array; + /** + an array of strings, corresponding to the rectList array. The entry at textList[i] + contains the part of the match bounded by the rectangle at rectList[i]. + **/ + var textList : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/find/Static.hx b/externs/webextension_polyfill/find/Static.hx new file mode 100644 index 0000000..ef3cfe5 --- /dev/null +++ b/externs/webextension_polyfill/find/Static.hx @@ -0,0 +1,16 @@ +package webextension_polyfill.find; + +typedef Static = { + /** + Search for text in document and store found ranges in array, in document order. + **/ + function find(queryphrase:String, ?params:FindParamsType):js.lib.Promise; + /** + Highlight a range + **/ + function highlightResults(?params:HighlightResultsParamsType):js.lib.Promise; + /** + Remove all highlighting from previous searches. + **/ + function removeHighlighting(?tabId:Float):js.lib.Promise; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/geckoprofiler/ProfilerFeature.hx b/externs/webextension_polyfill/geckoprofiler/ProfilerFeature.hx new file mode 100644 index 0000000..d9de59b --- /dev/null +++ b/externs/webextension_polyfill/geckoprofiler/ProfilerFeature.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.geckoprofiler; + +typedef ProfilerFeature = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/geckoprofiler/StartSettingsType.hx b/externs/webextension_polyfill/geckoprofiler/StartSettingsType.hx new file mode 100644 index 0000000..d361142 --- /dev/null +++ b/externs/webextension_polyfill/geckoprofiler/StartSettingsType.hx @@ -0,0 +1,31 @@ +package webextension_polyfill.geckoprofiler; + +typedef StartSettingsType = { + /** + The maximum size in bytes of the buffer used to store profiling data. A larger value allows capturing a profile that + covers a greater amount of time. + **/ + var bufferSize : Float; + /** + The length of the window of time that's kept in the buffer. Any collected samples are discarded as soon as they are + older than the number of seconds specified in this setting. Zero means no duration restriction. + Optional. + **/ + @:optional + var windowLength : Float; + /** + Interval in milliseconds between samples of profiling data. A smaller value will increase the detail of the profiles + captured. + **/ + var interval : Float; + /** + A list of active features for the profiler. + **/ + var features : Array; + /** + A list of thread names for which to capture profiles. + Optional. + **/ + @:optional + var threads : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/geckoprofiler/Static.hx b/externs/webextension_polyfill/geckoprofiler/Static.hx new file mode 100644 index 0000000..3cc833f --- /dev/null +++ b/externs/webextension_polyfill/geckoprofiler/Static.hx @@ -0,0 +1,47 @@ +package webextension_polyfill.geckoprofiler; + +typedef Static = { + /** + Starts the profiler with the specified settings. + **/ + function start(settings:StartSettingsType):Void; + /** + Stops the profiler and discards any captured profile data. + **/ + function stop():Void; + /** + Pauses the profiler, keeping any profile data that is already written. + **/ + function pause():Void; + /** + Resumes the profiler with the settings that were initially used to start it. + **/ + function resume():Void; + /** + Gathers the profile data from the current profiling session, and writes it to disk. + The returned promise resolves to a path that locates the created file. + **/ + function dumpProfileToFile(fileName:String):Void; + /** + Gathers the profile data from the current profiling session. + **/ + function getProfile():Void; + /** + Gathers the profile data from the current profiling session. The returned promise resolves to an array buffer that + contains a JSON string. + **/ + function getProfileAsArrayBuffer():Void; + /** + Gathers the profile data from the current profiling session. The returned promise resolves to an array buffer that + contains a gzipped JSON string. + **/ + function getProfileAsGzippedArrayBuffer():Void; + /** + Gets the debug symbols for a particular library. + **/ + function getSymbols(debugName:String, breakpadId:String):Void; + /** + Fires when the profiler starts/stops running. + **/ + var onRunning : webextension_polyfill.events.Event<(isRunning:Bool) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/geckoprofiler/Supports.hx b/externs/webextension_polyfill/geckoprofiler/Supports.hx new file mode 100644 index 0000000..02cff6c --- /dev/null +++ b/externs/webextension_polyfill/geckoprofiler/Supports.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.geckoprofiler; + +typedef Supports = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/history/AddUrlDetailsType.hx b/externs/webextension_polyfill/history/AddUrlDetailsType.hx new file mode 100644 index 0000000..1d517c3 --- /dev/null +++ b/externs/webextension_polyfill/history/AddUrlDetailsType.hx @@ -0,0 +1,26 @@ +package webextension_polyfill.history; + +typedef AddUrlDetailsType = { + /** + The URL to add. Must be a valid URL that can be added to history. + **/ + var url : String; + /** + The title of the page. + Optional. + **/ + @:optional + var title : String; + /** + The $(topic:transition-types)[transition type] for this visit from its referrer. + Optional. + **/ + @:optional + var transition : TransitionType; + /** + The date when this visit occurred. + Optional. + **/ + @:optional + var visitTime : webextension_polyfill.extensiontypes.DateType; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/history/DeleteRangeRangeType.hx b/externs/webextension_polyfill/history/DeleteRangeRangeType.hx new file mode 100644 index 0000000..6d99318 --- /dev/null +++ b/externs/webextension_polyfill/history/DeleteRangeRangeType.hx @@ -0,0 +1,12 @@ +package webextension_polyfill.history; + +typedef DeleteRangeRangeType = { + /** + Items added to history after this date. + **/ + var startTime : webextension_polyfill.extensiontypes.DateType; + /** + Items added to history before this date. + **/ + var endTime : webextension_polyfill.extensiontypes.DateType; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/history/DeleteUrlDetailsType.hx b/externs/webextension_polyfill/history/DeleteUrlDetailsType.hx new file mode 100644 index 0000000..517da98 --- /dev/null +++ b/externs/webextension_polyfill/history/DeleteUrlDetailsType.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.history; + +typedef DeleteUrlDetailsType = { + /** + The URL to remove. + **/ + var url : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/history/GetVisitsDetailsType.hx b/externs/webextension_polyfill/history/GetVisitsDetailsType.hx new file mode 100644 index 0000000..400b482 --- /dev/null +++ b/externs/webextension_polyfill/history/GetVisitsDetailsType.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.history; + +typedef GetVisitsDetailsType = { + /** + The URL for which to retrieve visit information. It must be in the format as returned from a call to history.search. + **/ + var url : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/history/HistoryItem.hx b/externs/webextension_polyfill/history/HistoryItem.hx new file mode 100644 index 0000000..ecb9e7d --- /dev/null +++ b/externs/webextension_polyfill/history/HistoryItem.hx @@ -0,0 +1,41 @@ +package webextension_polyfill.history; + +/** + An object encapsulating one result of a history query. +**/ +typedef HistoryItem = { + /** + The unique identifier for the item. + **/ + var id : String; + /** + The URL navigated to by a user. + Optional. + **/ + @:optional + var url : String; + /** + The title of the page when it was last loaded. + Optional. + **/ + @:optional + var title : String; + /** + When this page was last loaded, represented in milliseconds since the epoch. + Optional. + **/ + @:optional + var lastVisitTime : Float; + /** + The number of times the user has navigated to this page. + Optional. + **/ + @:optional + var visitCount : Float; + /** + The number of times the user has navigated to this page by typing in the address. + Optional. + **/ + @:optional + var typedCount : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/history/OnTitleChangedChangedType.hx b/externs/webextension_polyfill/history/OnTitleChangedChangedType.hx new file mode 100644 index 0000000..c9d1992 --- /dev/null +++ b/externs/webextension_polyfill/history/OnTitleChangedChangedType.hx @@ -0,0 +1,12 @@ +package webextension_polyfill.history; + +typedef OnTitleChangedChangedType = { + /** + The URL for which the title has changed + **/ + var url : String; + /** + The new title for the URL. + **/ + var title : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/history/OnVisitRemovedRemovedType.hx b/externs/webextension_polyfill/history/OnVisitRemovedRemovedType.hx new file mode 100644 index 0000000..66600b0 --- /dev/null +++ b/externs/webextension_polyfill/history/OnVisitRemovedRemovedType.hx @@ -0,0 +1,9 @@ +package webextension_polyfill.history; + +typedef OnVisitRemovedRemovedType = { + /** + True if all history was removed. If true, then urls will be empty. + **/ + var allHistory : Bool; + var urls : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/history/SearchQueryType.hx b/externs/webextension_polyfill/history/SearchQueryType.hx new file mode 100644 index 0000000..138aefe --- /dev/null +++ b/externs/webextension_polyfill/history/SearchQueryType.hx @@ -0,0 +1,26 @@ +package webextension_polyfill.history; + +typedef SearchQueryType = { + /** + A free-text query to the history service. Leave empty to retrieve all pages. + **/ + var text : String; + /** + Limit results to those visited after this date. If not specified, this defaults to 24 hours in the past. + Optional. + **/ + @:optional + var startTime : webextension_polyfill.extensiontypes.DateType; + /** + Limit results to those visited before this date. + Optional. + **/ + @:optional + var endTime : webextension_polyfill.extensiontypes.DateType; + /** + The maximum number of results to retrieve. Defaults to 100. + Optional. + **/ + @:optional + var maxResults : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/history/Static.hx b/externs/webextension_polyfill/history/Static.hx new file mode 100644 index 0000000..afc1c29 --- /dev/null +++ b/externs/webextension_polyfill/history/Static.hx @@ -0,0 +1,43 @@ +package webextension_polyfill.history; + +typedef Static = { + /** + Searches the history for the last visit time of each page matching the query. + **/ + function search(query:SearchQueryType):js.lib.Promise>; + /** + Retrieves information about visits to a URL. + **/ + function getVisits(details:GetVisitsDetailsType):js.lib.Promise>; + /** + Adds a URL to the history with a default visitTime of the current time and a default $(topic:transition-types) + [transition type] of "link". + **/ + function addUrl(details:AddUrlDetailsType):js.lib.Promise; + /** + Removes all occurrences of the given URL from the history. + **/ + function deleteUrl(details:DeleteUrlDetailsType):js.lib.Promise; + /** + Removes all items within the specified date range from the history. Pages will not be removed from the history unless + all visits fall within the range. + **/ + function deleteRange(range:DeleteRangeRangeType):js.lib.Promise; + /** + Deletes all items from the history. + **/ + function deleteAll():js.lib.Promise; + /** + Fired when a URL is visited, providing the HistoryItem data for that URL. This event fires before the page has loaded. + **/ + var onVisited : webextension_polyfill.events.Event<(result:HistoryItem) -> Void>; + /** + Fired when one or more URLs are removed from the history service. When all visits have been removed the URL is purged + from history. + **/ + var onVisitRemoved : webextension_polyfill.events.Event<(removed:OnVisitRemovedRemovedType) -> Void>; + /** + Fired when the title of a URL is changed in the browser history. + **/ + var onTitleChanged : webextension_polyfill.events.Event<(changed:OnTitleChangedChangedType) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/history/TransitionType.hx b/externs/webextension_polyfill/history/TransitionType.hx new file mode 100644 index 0000000..bf0382a --- /dev/null +++ b/externs/webextension_polyfill/history/TransitionType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.history; + +/** + The $(topic:transition-types)[transition type] for this visit from its referrer. +**/ +typedef TransitionType = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/history/VisitItem.hx b/externs/webextension_polyfill/history/VisitItem.hx new file mode 100644 index 0000000..b03fb81 --- /dev/null +++ b/externs/webextension_polyfill/history/VisitItem.hx @@ -0,0 +1,29 @@ +package webextension_polyfill.history; + +/** + An object encapsulating one visit to a URL. +**/ +typedef VisitItem = { + /** + The unique identifier for the item. + **/ + var id : String; + /** + The unique identifier for this visit. + **/ + var visitId : String; + /** + When this visit occurred, represented in milliseconds since the epoch. + Optional. + **/ + @:optional + var visitTime : Float; + /** + The visit ID of the referrer. + **/ + var referringVisitId : String; + /** + The $(topic:transition-types)[transition type] for this visit from its referrer. + **/ + var transition : TransitionType; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/i18n/DetectLanguageCallbackResultType.hx b/externs/webextension_polyfill/i18n/DetectLanguageCallbackResultType.hx new file mode 100644 index 0000000..177a34d --- /dev/null +++ b/externs/webextension_polyfill/i18n/DetectLanguageCallbackResultType.hx @@ -0,0 +1,15 @@ +package webextension_polyfill.i18n; + +/** + LanguageDetectionResult object that holds detected langugae reliability and array of DetectedLanguage +**/ +typedef DetectLanguageCallbackResultType = { + /** + CLD detected language reliability + **/ + var isReliable : Bool; + /** + array of detectedLanguage + **/ + var languages : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/i18n/DetectLanguageCallbackResultTypeLanguagesItemType.hx b/externs/webextension_polyfill/i18n/DetectLanguageCallbackResultTypeLanguagesItemType.hx new file mode 100644 index 0000000..4940f3a --- /dev/null +++ b/externs/webextension_polyfill/i18n/DetectLanguageCallbackResultTypeLanguagesItemType.hx @@ -0,0 +1,12 @@ +package webextension_polyfill.i18n; + +/** + DetectedLanguage object that holds detected ISO language code and its percentage in the input string +**/ +typedef DetectLanguageCallbackResultTypeLanguagesItemType = { + var language : String; + /** + The percentage of the detected language + **/ + var percentage : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/i18n/LanguageCode.hx b/externs/webextension_polyfill/i18n/LanguageCode.hx new file mode 100644 index 0000000..a45c539 --- /dev/null +++ b/externs/webextension_polyfill/i18n/LanguageCode.hx @@ -0,0 +1,9 @@ +package webextension_polyfill.i18n; + +/** + An ISO language code such as en or fr. For a complete list of languages supported by this + method, see + kLanguageInfoTable. For an unknown language, und will be returned, which means that [percentage] + of the text is unknown to CLD +**/ +typedef LanguageCode = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/i18n/Static.hx b/externs/webextension_polyfill/i18n/Static.hx new file mode 100644 index 0000000..cec3fdd --- /dev/null +++ b/externs/webextension_polyfill/i18n/Static.hx @@ -0,0 +1,25 @@ +package webextension_polyfill.i18n; + +typedef Static = { + /** + Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, + use $(ref:i18n.getUILanguage). + **/ + function getAcceptLanguages():js.lib.Promise>; + /** + Gets the localized string for the specified message. If the message is missing, this method returns an empty string (''). + If the format of the getMessage() call is wrong — for example, messageName + is not a string or the substitutions array has more than 9 elements — this method returns + undefined. + **/ + function getMessage(messageName:String, ?substitutions:ts.AnyOf2>):String; + /** + Gets the browser UI language of the browser. This is different from $(ref:i18n.getAcceptLanguages) + which returns the preferred user languages. + **/ + function getUILanguage():String; + /** + Detects the language of the provided text using CLD. + **/ + function detectLanguage(text:String):js.lib.Promise; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/identity/AccountInfo.hx b/externs/webextension_polyfill/identity/AccountInfo.hx new file mode 100644 index 0000000..daa8410 --- /dev/null +++ b/externs/webextension_polyfill/identity/AccountInfo.hx @@ -0,0 +1,11 @@ +package webextension_polyfill.identity; + +/** + An object encapsulating an OAuth account id. +**/ +typedef AccountInfo = { + /** + A unique identifier for the account. This ID will not change for the lifetime of the account. + **/ + var id : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/identity/LaunchWebAuthFlowDetailsType.hx b/externs/webextension_polyfill/identity/LaunchWebAuthFlowDetailsType.hx new file mode 100644 index 0000000..b5bed30 --- /dev/null +++ b/externs/webextension_polyfill/identity/LaunchWebAuthFlowDetailsType.hx @@ -0,0 +1,10 @@ +package webextension_polyfill.identity; + +typedef LaunchWebAuthFlowDetailsType = { + var url : String; + /** + Optional. + **/ + @:optional + var interactive : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/identity/Static.hx b/externs/webextension_polyfill/identity/Static.hx new file mode 100644 index 0000000..1014381 --- /dev/null +++ b/externs/webextension_polyfill/identity/Static.hx @@ -0,0 +1,12 @@ +package webextension_polyfill.identity; + +typedef Static = { + /** + Starts an auth flow at the specified URL. + **/ + function launchWebAuthFlow(details:LaunchWebAuthFlowDetailsType):js.lib.Promise; + /** + Generates a redirect URL to be used in |launchWebAuthFlow|. + **/ + function getRedirectURL(?path:String):String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/idle/IdleState.hx b/externs/webextension_polyfill/idle/IdleState.hx new file mode 100644 index 0000000..192c7a5 --- /dev/null +++ b/externs/webextension_polyfill/idle/IdleState.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.idle; + +typedef IdleState = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/idle/Static.hx b/externs/webextension_polyfill/idle/Static.hx new file mode 100644 index 0000000..40d4d4d --- /dev/null +++ b/externs/webextension_polyfill/idle/Static.hx @@ -0,0 +1,18 @@ +package webextension_polyfill.idle; + +typedef Static = { + /** + Returns "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise. + **/ + function queryState(detectionIntervalInSeconds:Float):js.lib.Promise; + /** + Sets the interval, in seconds, used to determine when the system is in an idle state for onStateChanged events. + The default interval is 60 seconds. + **/ + function setDetectionInterval(intervalInSeconds:Float):Void; + /** + Fired when the system changes to an active or idle state. The event fires with "idle" if the the user has not generated + any input for a specified number of seconds, and "active" when the user generates input on an idle system. + **/ + var onStateChanged : webextension_polyfill.events.Event<(newState:IdleState) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/management/ExtensionDisabledReason.hx b/externs/webextension_polyfill/management/ExtensionDisabledReason.hx new file mode 100644 index 0000000..314170c --- /dev/null +++ b/externs/webextension_polyfill/management/ExtensionDisabledReason.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.management; + +/** + A reason the item is disabled. +**/ +typedef ExtensionDisabledReason = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/management/ExtensionInfo.hx b/externs/webextension_polyfill/management/ExtensionInfo.hx new file mode 100644 index 0000000..6bf0ce8 --- /dev/null +++ b/externs/webextension_polyfill/management/ExtensionInfo.hx @@ -0,0 +1,94 @@ +package webextension_polyfill.management; + +/** + Information about an installed extension. +**/ +typedef ExtensionInfo = { + /** + The extension's unique identifier. + **/ + var id : String; + /** + The name of this extension. + **/ + var name : String; + /** + A short version of the name of this extension. + Optional. + **/ + @:optional + var shortName : String; + /** + The description of this extension. + **/ + var description : String; + /** + The version of this extension. + **/ + var version : String; + /** + The version name of this extension if the manifest specified one. + Optional. + **/ + @:optional + var versionName : String; + /** + Whether this extension can be disabled or uninstalled by the user. + **/ + var mayDisable : Bool; + /** + Whether it is currently enabled or disabled. + **/ + var enabled : Bool; + /** + A reason the item is disabled. + Optional. + **/ + @:optional + var disabledReason : ExtensionDisabledReason; + /** + The type of this extension, 'extension' or 'theme'. + **/ + var type : ExtensionType; + /** + The URL of the homepage of this extension. + Optional. + **/ + @:optional + var homepageUrl : String; + /** + The update URL of this extension. + Optional. + **/ + @:optional + var updateUrl : String; + /** + The url for the item's options page, if it has one. + **/ + var optionsUrl : String; + /** + A list of icon information. Note that this just reflects what was declared in the manifest, + and the actual image at that url may be larger or smaller than what was declared, + so you might consider using explicit width and height attributes on img tags referencing these images. + See the manifest documentation on icons for more details. + Optional. + **/ + @:optional + var icons : Array; + /** + Returns a list of API based permissions. + Optional. + **/ + @:optional + var permissions : Array; + /** + Returns a list of host based permissions. + Optional. + **/ + @:optional + var hostPermissions : Array; + /** + How the extension was installed. + **/ + var installType : ExtensionInstallType; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/management/ExtensionInstallType.hx b/externs/webextension_polyfill/management/ExtensionInstallType.hx new file mode 100644 index 0000000..bb50e37 --- /dev/null +++ b/externs/webextension_polyfill/management/ExtensionInstallType.hx @@ -0,0 +1,9 @@ +package webextension_polyfill.management; + +/** + How the extension was installed. One of
development: The extension was loaded unpacked in developer mode, +
normal: The extension was installed normally via an .xpi file,
sideload + : The extension was installed by other software on the machine,
other + : The extension was installed by other means. +**/ +typedef ExtensionInstallType = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/management/ExtensionType.hx b/externs/webextension_polyfill/management/ExtensionType.hx new file mode 100644 index 0000000..c2a8b42 --- /dev/null +++ b/externs/webextension_polyfill/management/ExtensionType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.management; + +/** + The type of this extension, 'extension' or 'theme'. +**/ +typedef ExtensionType = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/management/IconInfo.hx b/externs/webextension_polyfill/management/IconInfo.hx new file mode 100644 index 0000000..be63acc --- /dev/null +++ b/externs/webextension_polyfill/management/IconInfo.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.management; + +/** + Information about an icon belonging to an extension. +**/ +typedef IconInfo = { + /** + A number representing the width and height of the icon. Likely values include (but are not limited to) 128, 48, 24, + and 16. + **/ + var size : Float; + /** + The URL for this icon image. To display a grayscale version of the icon (to indicate that an extension is disabled, + for example), append ?grayscale=true to the URL. + **/ + var url : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/management/InstallCallbackResultType.hx b/externs/webextension_polyfill/management/InstallCallbackResultType.hx new file mode 100644 index 0000000..994bf57 --- /dev/null +++ b/externs/webextension_polyfill/management/InstallCallbackResultType.hx @@ -0,0 +1,5 @@ +package webextension_polyfill.management; + +typedef InstallCallbackResultType = { + var id : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/management/InstallOptionsType.hx b/externs/webextension_polyfill/management/InstallOptionsType.hx new file mode 100644 index 0000000..402e9a7 --- /dev/null +++ b/externs/webextension_polyfill/management/InstallOptionsType.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.management; + +typedef InstallOptionsType = { + /** + URL pointing to the XPI file on addons.mozilla.org or similar. + **/ + var url : String; + /** + A hash of the XPI file, using sha256 or stronger. + Optional. + **/ + @:optional + var hash : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/management/Static.hx b/externs/webextension_polyfill/management/Static.hx new file mode 100644 index 0000000..3440367 --- /dev/null +++ b/externs/webextension_polyfill/management/Static.hx @@ -0,0 +1,46 @@ +package webextension_polyfill.management; + +typedef Static = { + /** + Returns a list of information about installed extensions. + **/ + function getAll():js.lib.Promise>; + /** + Returns information about the installed extension that has the given ID. + **/ + function get(id:String):js.lib.Promise; + /** + Installs and enables a theme extension from the given url. + **/ + function install(options:InstallOptionsType):js.lib.Promise; + /** + Returns information about the calling extension. Note: This function can be used without requesting the 'management' + permission in the manifest. + **/ + function getSelf():js.lib.Promise; + /** + Uninstalls the calling extension. Note: This function can be used without requesting the 'management' permission in the + manifest. + **/ + function uninstallSelf(?options:UninstallSelfOptionsType):js.lib.Promise; + /** + Enables or disables the given add-on. + **/ + function setEnabled(id:String, enabled:Bool):js.lib.Promise; + /** + Fired when an addon has been disabled. + **/ + var onDisabled : webextension_polyfill.events.Event<(info:ExtensionInfo) -> Void>; + /** + Fired when an addon has been enabled. + **/ + var onEnabled : webextension_polyfill.events.Event<(info:ExtensionInfo) -> Void>; + /** + Fired when an addon has been installed. + **/ + var onInstalled : webextension_polyfill.events.Event<(info:ExtensionInfo) -> Void>; + /** + Fired when an addon has been uninstalled. + **/ + var onUninstalled : webextension_polyfill.events.Event<(info:ExtensionInfo) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/management/UninstallSelfOptionsType.hx b/externs/webextension_polyfill/management/UninstallSelfOptionsType.hx new file mode 100644 index 0000000..6fb0f51 --- /dev/null +++ b/externs/webextension_polyfill/management/UninstallSelfOptionsType.hx @@ -0,0 +1,16 @@ +package webextension_polyfill.management; + +typedef UninstallSelfOptionsType = { + /** + Whether or not a confirm-uninstall dialog should prompt the user. Defaults to false. + Optional. + **/ + @:optional + var showConfirmDialog : Bool; + /** + The message to display to a user when being asked to confirm removal of the extension. + Optional. + **/ + @:optional + var dialogMessage : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ActionManifest.hx b/externs/webextension_polyfill/manifest/ActionManifest.hx new file mode 100644 index 0000000..c8d1e21 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ActionManifest.hx @@ -0,0 +1,37 @@ +package webextension_polyfill.manifest; + +typedef ActionManifest = { + /** + Optional. + **/ + @:optional + var default_title : String; + /** + Optional. + **/ + @:optional + var default_icon : ts.AnyOf2>; + /** + Specifies icons to use for dark and light themes + Optional. + **/ + @:optional + var theme_icons : Array; + /** + Optional. + **/ + @:optional + var default_popup : String; + /** + Deprecated in Manifest V3. + Optional. + **/ + @:optional + var browser_style : Bool; + /** + Defines the location the browserAction will appear by default. The default location is navbar. + Optional. + **/ + @:optional + var default_area : ActionManifestDefaultAreaEnum; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ActionManifestDefaultAreaEnum.hx b/externs/webextension_polyfill/manifest/ActionManifestDefaultAreaEnum.hx new file mode 100644 index 0000000..ed55a4b --- /dev/null +++ b/externs/webextension_polyfill/manifest/ActionManifestDefaultAreaEnum.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.manifest; + +/** + Defines the location the browserAction will appear by default. The default location is navbar. +**/ +typedef ActionManifestDefaultAreaEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/BrowserSpecificSettings.hx b/externs/webextension_polyfill/manifest/BrowserSpecificSettings.hx new file mode 100644 index 0000000..e2f0324 --- /dev/null +++ b/externs/webextension_polyfill/manifest/BrowserSpecificSettings.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.manifest; + +typedef BrowserSpecificSettings = { + /** + Optional. + **/ + @:optional + var gecko : FirefoxSpecificProperties; + /** + Optional. + **/ + @:optional + var gecko_android : GeckoAndroidSpecificProperties; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ContentScript.hx b/externs/webextension_polyfill/manifest/ContentScript.hx new file mode 100644 index 0000000..2969d30 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ContentScript.hx @@ -0,0 +1,57 @@ +package webextension_polyfill.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. +**/ +typedef ContentScript = { + var matches : Array; + /** + Optional. + **/ + @:optional + var exclude_matches : Array; + /** + Optional. + **/ + @:optional + var include_globs : Array; + /** + Optional. + **/ + @:optional + var exclude_globs : Array; + /** + The list of CSS files to inject + Optional. + **/ + @:optional + var css : Array; + /** + The list of JS files to inject + Optional. + **/ + @:optional + var js : Array; + /** + 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. + Optional. + **/ + @:optional + var all_frames : Bool; + /** + 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. + Optional. + **/ + @:optional + var match_about_blank : Bool; + /** + The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle". + Optional. + **/ + @:optional + var run_at : webextension_polyfill.extensiontypes.RunAt; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/DeprecatedApplications.hx b/externs/webextension_polyfill/manifest/DeprecatedApplications.hx new file mode 100644 index 0000000..6d921a9 --- /dev/null +++ b/externs/webextension_polyfill/manifest/DeprecatedApplications.hx @@ -0,0 +1,9 @@ +package webextension_polyfill.manifest; + +typedef DeprecatedApplications = { + /** + Optional. + **/ + @:optional + var gecko : FirefoxSpecificProperties; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ExtensionFileUrl.hx b/externs/webextension_polyfill/manifest/ExtensionFileUrl.hx new file mode 100644 index 0000000..569fa44 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ExtensionFileUrl.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef ExtensionFileUrl = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ExtensionID.hx b/externs/webextension_polyfill/manifest/ExtensionID.hx new file mode 100644 index 0000000..c13b2f7 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ExtensionID.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef ExtensionID = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ExtensionURL.hx b/externs/webextension_polyfill/manifest/ExtensionURL.hx new file mode 100644 index 0000000..41d7059 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ExtensionURL.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef ExtensionURL = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/FirefoxSpecificProperties.hx b/externs/webextension_polyfill/manifest/FirefoxSpecificProperties.hx new file mode 100644 index 0000000..f25089c --- /dev/null +++ b/externs/webextension_polyfill/manifest/FirefoxSpecificProperties.hx @@ -0,0 +1,24 @@ +package webextension_polyfill.manifest; + +typedef FirefoxSpecificProperties = { + /** + Optional. + **/ + @:optional + var id : String; + /** + Optional. + **/ + @:optional + var update_url : String; + /** + Optional. + **/ + @:optional + var strict_min_version : String; + /** + Optional. + **/ + @:optional + var strict_max_version : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/GeckoAndroidSpecificProperties.hx b/externs/webextension_polyfill/manifest/GeckoAndroidSpecificProperties.hx new file mode 100644 index 0000000..9fff5d5 --- /dev/null +++ b/externs/webextension_polyfill/manifest/GeckoAndroidSpecificProperties.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.manifest; + +typedef GeckoAndroidSpecificProperties = { + /** + Optional. + **/ + @:optional + var strict_min_version : String; + /** + Optional. + **/ + @:optional + var strict_max_version : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/HttpURL.hx b/externs/webextension_polyfill/manifest/HttpURL.hx new file mode 100644 index 0000000..77b5aea --- /dev/null +++ b/externs/webextension_polyfill/manifest/HttpURL.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef HttpURL = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/IconImageData.hx b/externs/webextension_polyfill/manifest/IconImageData.hx new file mode 100644 index 0000000..170c7ad --- /dev/null +++ b/externs/webextension_polyfill/manifest/IconImageData.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef IconImageData = ts.AnyOf2>; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/IconPath.hx b/externs/webextension_polyfill/manifest/IconPath.hx new file mode 100644 index 0000000..87192df --- /dev/null +++ b/externs/webextension_polyfill/manifest/IconPath.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef IconPath = ts.AnyOf2>; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ImageDataOrExtensionURL.hx b/externs/webextension_polyfill/manifest/ImageDataOrExtensionURL.hx new file mode 100644 index 0000000..e9c972b --- /dev/null +++ b/externs/webextension_polyfill/manifest/ImageDataOrExtensionURL.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef ImageDataOrExtensionURL = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/KeyName.hx b/externs/webextension_polyfill/manifest/KeyName.hx new file mode 100644 index 0000000..919f685 --- /dev/null +++ b/externs/webextension_polyfill/manifest/KeyName.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef KeyName = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ManifestBase.hx b/externs/webextension_polyfill/manifest/ManifestBase.hx new file mode 100644 index 0000000..5a15feb --- /dev/null +++ b/externs/webextension_polyfill/manifest/ManifestBase.hx @@ -0,0 +1,59 @@ +package webextension_polyfill.manifest; + +/** + Common properties for all manifest.json files +**/ +typedef ManifestBase = { + var manifest_version : Float; + /** + The applications property is deprecated, please use 'browser_specific_settings' + Optional. + **/ + @:optional + var applications : DeprecatedApplications; + /** + Optional. + **/ + @:optional + var browser_specific_settings : BrowserSpecificSettings; + var name : String; + /** + Optional. + **/ + @:optional + var short_name : String; + /** + Optional. + **/ + @:optional + var description : String; + /** + Optional. + **/ + @:optional + var author : String; + var version : String; + /** + Optional. + **/ + @:optional + var homepage_url : String; + /** + Optional. + **/ + @:optional + var install_origins : Array; + /** + Optional. + **/ + @:optional + var developer : ManifestBaseDeveloperType; + /** + In addition to the version field, which is used for update purposes, version_name can be set to a descriptive version + string and will be used for display purposes if present. If no version_name is present, + the version field will be used for display purposes as well. + Optional. + **/ + @:optional + var version_name : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ManifestBaseDeveloperType.hx b/externs/webextension_polyfill/manifest/ManifestBaseDeveloperType.hx new file mode 100644 index 0000000..9761966 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ManifestBaseDeveloperType.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.manifest; + +typedef ManifestBaseDeveloperType = { + /** + Optional. + **/ + @:optional + var name : String; + /** + Optional. + **/ + @:optional + var url : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/MatchPattern.hx b/externs/webextension_polyfill/manifest/MatchPattern.hx new file mode 100644 index 0000000..b6da1bf --- /dev/null +++ b/externs/webextension_polyfill/manifest/MatchPattern.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef MatchPattern = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/MatchPatternRestricted.hx b/externs/webextension_polyfill/manifest/MatchPatternRestricted.hx new file mode 100644 index 0000000..f695d49 --- /dev/null +++ b/externs/webextension_polyfill/manifest/MatchPatternRestricted.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.manifest; + +/** + Same as MatchPattern above, but excludes +**/ +typedef MatchPatternRestricted = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/MatchPatternUnestricted.hx b/externs/webextension_polyfill/manifest/MatchPatternUnestricted.hx new file mode 100644 index 0000000..46f0dd4 --- /dev/null +++ b/externs/webextension_polyfill/manifest/MatchPatternUnestricted.hx @@ -0,0 +1,7 @@ +package webextension_polyfill.manifest; + +/** + 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. +**/ +typedef MatchPatternUnestricted = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/OptionalPermission.hx b/externs/webextension_polyfill/manifest/OptionalPermission.hx new file mode 100644 index 0000000..c6d3b08 --- /dev/null +++ b/externs/webextension_polyfill/manifest/OptionalPermission.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef OptionalPermission = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/OptionalPermissionNoPrompt.hx b/externs/webextension_polyfill/manifest/OptionalPermissionNoPrompt.hx new file mode 100644 index 0000000..74eb38f --- /dev/null +++ b/externs/webextension_polyfill/manifest/OptionalPermissionNoPrompt.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef OptionalPermissionNoPrompt = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/OptionalPermissionOrOrigin.hx b/externs/webextension_polyfill/manifest/OptionalPermissionOrOrigin.hx new file mode 100644 index 0000000..84abad4 --- /dev/null +++ b/externs/webextension_polyfill/manifest/OptionalPermissionOrOrigin.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef OptionalPermissionOrOrigin = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/Permission.hx b/externs/webextension_polyfill/manifest/Permission.hx new file mode 100644 index 0000000..c973545 --- /dev/null +++ b/externs/webextension_polyfill/manifest/Permission.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef Permission = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/PermissionNoPrompt.hx b/externs/webextension_polyfill/manifest/PermissionNoPrompt.hx new file mode 100644 index 0000000..2581bb0 --- /dev/null +++ b/externs/webextension_polyfill/manifest/PermissionNoPrompt.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef PermissionNoPrompt = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/PermissionOrOrigin.hx b/externs/webextension_polyfill/manifest/PermissionOrOrigin.hx new file mode 100644 index 0000000..e83b671 --- /dev/null +++ b/externs/webextension_polyfill/manifest/PermissionOrOrigin.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef PermissionOrOrigin = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/PermissionPrivileged.hx b/externs/webextension_polyfill/manifest/PermissionPrivileged.hx new file mode 100644 index 0000000..60f515f --- /dev/null +++ b/externs/webextension_polyfill/manifest/PermissionPrivileged.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef PermissionPrivileged = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ProtocolHandler.hx b/externs/webextension_polyfill/manifest/ProtocolHandler.hx new file mode 100644 index 0000000..f1f11f1 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ProtocolHandler.hx @@ -0,0 +1,22 @@ +package webextension_polyfill.manifest; + +/** + Represents a protocol handler definition. +**/ +typedef ProtocolHandler = { + /** + A user-readable title string for the protocol handler. This will be displayed to the user in interface objects as needed. + **/ + var name : String; + /** + 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. + **/ + var protocol : String; + /** + 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. + **/ + var uriTemplate : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/SitePermission.hx b/externs/webextension_polyfill/manifest/SitePermission.hx new file mode 100644 index 0000000..faf1c3d --- /dev/null +++ b/externs/webextension_polyfill/manifest/SitePermission.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef SitePermission = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/Static.hx b/externs/webextension_polyfill/manifest/Static.hx new file mode 100644 index 0000000..95ae341 --- /dev/null +++ b/externs/webextension_polyfill/manifest/Static.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef Static = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ThemeColor.hx b/externs/webextension_polyfill/manifest/ThemeColor.hx new file mode 100644 index 0000000..a9775e0 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ThemeColor.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef ThemeColor = ts.AnyOf3, ts.Tuple4>; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ThemeExperiment.hx b/externs/webextension_polyfill/manifest/ThemeExperiment.hx new file mode 100644 index 0000000..1e9dd91 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ThemeExperiment.hx @@ -0,0 +1,24 @@ +package webextension_polyfill.manifest; + +typedef ThemeExperiment = { + /** + Optional. + **/ + @:optional + var stylesheet : String; + /** + Optional. + **/ + @:optional + var images : ThemeExperimentImagesType; + /** + Optional. + **/ + @:optional + var colors : ThemeExperimentColorsType; + /** + Optional. + **/ + @:optional + var properties : ThemeExperimentPropertiesType; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ThemeExperimentColorsType.hx b/externs/webextension_polyfill/manifest/ThemeExperimentColorsType.hx new file mode 100644 index 0000000..eeb301c --- /dev/null +++ b/externs/webextension_polyfill/manifest/ThemeExperimentColorsType.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef ThemeExperimentColorsType = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ThemeExperimentImagesType.hx b/externs/webextension_polyfill/manifest/ThemeExperimentImagesType.hx new file mode 100644 index 0000000..b874a21 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ThemeExperimentImagesType.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef ThemeExperimentImagesType = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ThemeExperimentPropertiesType.hx b/externs/webextension_polyfill/manifest/ThemeExperimentPropertiesType.hx new file mode 100644 index 0000000..3c3cce8 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ThemeExperimentPropertiesType.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef ThemeExperimentPropertiesType = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ThemeIcons.hx b/externs/webextension_polyfill/manifest/ThemeIcons.hx new file mode 100644 index 0000000..f6ee8f9 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ThemeIcons.hx @@ -0,0 +1,16 @@ +package webextension_polyfill.manifest; + +typedef ThemeIcons = { + /** + A light icon to use for dark themes + **/ + var light : String; + /** + The dark icon to use for light themes + **/ + var dark : String; + /** + The size of the icons + **/ + var size : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ThemeManifest.hx b/externs/webextension_polyfill/manifest/ThemeManifest.hx new file mode 100644 index 0000000..11f5930 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ThemeManifest.hx @@ -0,0 +1,80 @@ +package webextension_polyfill.manifest; + +/** + Contents of manifest.json for a static theme +**/ +typedef ThemeManifest = { + var theme : ThemeType; + /** + Optional. + **/ + @:optional + var dark_theme : ThemeType; + /** + Optional. + **/ + @:optional + var default_locale : String; + /** + Optional. + **/ + @:optional + var theme_experiment : ThemeExperiment; + /** + Optional. + **/ + @:optional + var icons : haxe.DynamicAccess; + var manifest_version : Float; + /** + The applications property is deprecated, please use 'browser_specific_settings' + Optional. + **/ + @:optional + var applications : DeprecatedApplications; + /** + Optional. + **/ + @:optional + var browser_specific_settings : BrowserSpecificSettings; + var name : String; + /** + Optional. + **/ + @:optional + var short_name : String; + /** + Optional. + **/ + @:optional + var description : String; + /** + Optional. + **/ + @:optional + var author : String; + var version : String; + /** + Optional. + **/ + @:optional + var homepage_url : String; + /** + Optional. + **/ + @:optional + var install_origins : Array; + /** + Optional. + **/ + @:optional + var developer : ManifestBaseDeveloperType; + /** + In addition to the version field, which is used for update purposes, version_name can be set to a descriptive version + string and will be used for display purposes if present. If no version_name is present, + the version field will be used for display purposes as well. + Optional. + **/ + @:optional + var version_name : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ThemeType.hx b/externs/webextension_polyfill/manifest/ThemeType.hx new file mode 100644 index 0000000..d8e3c43 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ThemeType.hx @@ -0,0 +1,19 @@ +package webextension_polyfill.manifest; + +typedef ThemeType = { + /** + Optional. + **/ + @:optional + var images : ThemeTypeImagesType; + /** + Optional. + **/ + @:optional + var colors : ThemeTypeColorsType; + /** + Optional. + **/ + @:optional + var properties : ThemeTypePropertiesType; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ThemeTypeColorsType.hx b/externs/webextension_polyfill/manifest/ThemeTypeColorsType.hx new file mode 100644 index 0000000..7651d20 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ThemeTypeColorsType.hx @@ -0,0 +1,200 @@ +package webextension_polyfill.manifest; + +typedef ThemeTypeColorsType = { + /** + Optional. + **/ + @:optional + var tab_selected : ThemeColor; + /** + Optional. + **/ + @:optional + var frame : ThemeColor; + /** + Optional. + **/ + @:optional + var frame_inactive : ThemeColor; + /** + Optional. + **/ + @:optional + var tab_background_text : ThemeColor; + /** + Optional. + **/ + @:optional + var tab_background_separator : ThemeColor; + /** + Optional. + **/ + @:optional + var tab_loading : ThemeColor; + /** + Optional. + **/ + @:optional + var tab_text : ThemeColor; + /** + Optional. + **/ + @:optional + var tab_line : ThemeColor; + /** + Optional. + **/ + @:optional + var toolbar : ThemeColor; + /** + This color property is an alias of 'bookmark_text'. + Optional. + **/ + @:optional + var toolbar_text : ThemeColor; + /** + Optional. + **/ + @:optional + var bookmark_text : ThemeColor; + /** + Optional. + **/ + @:optional + var toolbar_field : ThemeColor; + /** + Optional. + **/ + @:optional + var toolbar_field_text : ThemeColor; + /** + Optional. + **/ + @:optional + var toolbar_field_border : ThemeColor; + /** + Optional. + **/ + @:optional + var toolbar_top_separator : ThemeColor; + /** + Optional. + **/ + @:optional + var toolbar_bottom_separator : ThemeColor; + /** + Optional. + **/ + @:optional + var toolbar_vertical_separator : ThemeColor; + /** + Optional. + **/ + @:optional + var icons : ThemeColor; + /** + Optional. + **/ + @:optional + var icons_attention : ThemeColor; + /** + Optional. + **/ + @:optional + var button_background_hover : ThemeColor; + /** + Optional. + **/ + @:optional + var button_background_active : ThemeColor; + /** + Optional. + **/ + @:optional + var popup : ThemeColor; + /** + Optional. + **/ + @:optional + var popup_text : ThemeColor; + /** + Optional. + **/ + @:optional + var popup_border : ThemeColor; + /** + Optional. + **/ + @:optional + var toolbar_field_focus : ThemeColor; + /** + Optional. + **/ + @:optional + var toolbar_field_text_focus : ThemeColor; + /** + Optional. + **/ + @:optional + var toolbar_field_border_focus : ThemeColor; + /** + Optional. + **/ + @:optional + var popup_highlight : ThemeColor; + /** + Optional. + **/ + @:optional + var popup_highlight_text : ThemeColor; + /** + Optional. + **/ + @:optional + var ntp_background : ThemeColor; + /** + Optional. + **/ + @:optional + var ntp_card_background : ThemeColor; + /** + Optional. + **/ + @:optional + var ntp_text : ThemeColor; + /** + Optional. + **/ + @:optional + var sidebar : ThemeColor; + /** + Optional. + **/ + @:optional + var sidebar_border : ThemeColor; + /** + Optional. + **/ + @:optional + var sidebar_text : ThemeColor; + /** + Optional. + **/ + @:optional + var sidebar_highlight : ThemeColor; + /** + Optional. + **/ + @:optional + var sidebar_highlight_text : ThemeColor; + /** + Optional. + **/ + @:optional + var toolbar_field_highlight : ThemeColor; + /** + Optional. + **/ + @:optional + var toolbar_field_highlight_text : ThemeColor; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ThemeTypeImagesType.hx b/externs/webextension_polyfill/manifest/ThemeTypeImagesType.hx new file mode 100644 index 0000000..6040594 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ThemeTypeImagesType.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.manifest; + +typedef ThemeTypeImagesType = { + /** + Optional. + **/ + @:optional + var additional_backgrounds : Array; + /** + Optional. + **/ + @:optional + var theme_frame : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ThemeTypePropertiesAdditionalBackgroundsAlignmentItemEnum.hx b/externs/webextension_polyfill/manifest/ThemeTypePropertiesAdditionalBackgroundsAlignmentItemEnum.hx new file mode 100644 index 0000000..031380b --- /dev/null +++ b/externs/webextension_polyfill/manifest/ThemeTypePropertiesAdditionalBackgroundsAlignmentItemEnum.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef ThemeTypePropertiesAdditionalBackgroundsAlignmentItemEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ThemeTypePropertiesAdditionalBackgroundsTilingItemEnum.hx b/externs/webextension_polyfill/manifest/ThemeTypePropertiesAdditionalBackgroundsTilingItemEnum.hx new file mode 100644 index 0000000..465c461 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ThemeTypePropertiesAdditionalBackgroundsTilingItemEnum.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef ThemeTypePropertiesAdditionalBackgroundsTilingItemEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ThemeTypePropertiesColorSchemeEnum.hx b/externs/webextension_polyfill/manifest/ThemeTypePropertiesColorSchemeEnum.hx new file mode 100644 index 0000000..4c81ad0 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ThemeTypePropertiesColorSchemeEnum.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef ThemeTypePropertiesColorSchemeEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ThemeTypePropertiesContentColorSchemeEnum.hx b/externs/webextension_polyfill/manifest/ThemeTypePropertiesContentColorSchemeEnum.hx new file mode 100644 index 0000000..91eb8c6 --- /dev/null +++ b/externs/webextension_polyfill/manifest/ThemeTypePropertiesContentColorSchemeEnum.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef ThemeTypePropertiesContentColorSchemeEnum = ThemeTypePropertiesColorSchemeEnum; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/ThemeTypePropertiesType.hx b/externs/webextension_polyfill/manifest/ThemeTypePropertiesType.hx new file mode 100644 index 0000000..21ca0fb --- /dev/null +++ b/externs/webextension_polyfill/manifest/ThemeTypePropertiesType.hx @@ -0,0 +1,24 @@ +package webextension_polyfill.manifest; + +typedef ThemeTypePropertiesType = { + /** + Optional. + **/ + @:optional + var additional_backgrounds_alignment : Array; + /** + Optional. + **/ + @:optional + var additional_backgrounds_tiling : Array; + /** + Optional. + **/ + @:optional + var color_scheme : ThemeTypePropertiesColorSchemeEnum; + /** + Optional. + **/ + @:optional + var content_color_scheme : ThemeTypePropertiesColorSchemeEnum; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionDictionaryManifest.hx b/externs/webextension_polyfill/manifest/WebExtensionDictionaryManifest.hx new file mode 100644 index 0000000..401f4da --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionDictionaryManifest.hx @@ -0,0 +1,60 @@ +package webextension_polyfill.manifest; + +/** + Represents a WebExtension dictionary manifest.json file +**/ +typedef WebExtensionDictionaryManifest = { + var dictionaries : haxe.DynamicAccess; + var manifest_version : Float; + /** + The applications property is deprecated, please use 'browser_specific_settings' + Optional. + **/ + @:optional + var applications : DeprecatedApplications; + /** + Optional. + **/ + @:optional + var browser_specific_settings : BrowserSpecificSettings; + var name : String; + /** + Optional. + **/ + @:optional + var short_name : String; + /** + Optional. + **/ + @:optional + var description : String; + /** + Optional. + **/ + @:optional + var author : String; + var version : String; + /** + Optional. + **/ + @:optional + var homepage_url : String; + /** + Optional. + **/ + @:optional + var install_origins : Array; + /** + Optional. + **/ + @:optional + var developer : ManifestBaseDeveloperType; + /** + In addition to the version field, which is used for update purposes, version_name can be set to a descriptive version + string and will be used for display purposes if present. If no version_name is present, + the version field will be used for display purposes as well. + Optional. + **/ + @:optional + var version_name : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionLangpackManifest.hx b/externs/webextension_polyfill/manifest/WebExtensionLangpackManifest.hx new file mode 100644 index 0000000..e75cd64 --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionLangpackManifest.hx @@ -0,0 +1,66 @@ +package webextension_polyfill.manifest; + +/** + Represents a WebExtension language pack manifest.json file +**/ +typedef WebExtensionLangpackManifest = { + var langpack_id : String; + var languages : haxe.DynamicAccess; + /** + Optional. + **/ + @:optional + var sources : haxe.DynamicAccess; + var manifest_version : Float; + /** + The applications property is deprecated, please use 'browser_specific_settings' + Optional. + **/ + @:optional + var applications : DeprecatedApplications; + /** + Optional. + **/ + @:optional + var browser_specific_settings : BrowserSpecificSettings; + var name : String; + /** + Optional. + **/ + @:optional + var short_name : String; + /** + Optional. + **/ + @:optional + var description : String; + /** + Optional. + **/ + @:optional + var author : String; + var version : String; + /** + Optional. + **/ + @:optional + var homepage_url : String; + /** + Optional. + **/ + @:optional + var install_origins : Array; + /** + Optional. + **/ + @:optional + var developer : ManifestBaseDeveloperType; + /** + In addition to the version field, which is used for update purposes, version_name can be set to a descriptive version + string and will be used for display purposes if present. If no version_name is present, + the version field will be used for display purposes as well. + Optional. + **/ + @:optional + var version_name : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionLangpackManifestLanguagesPatternType.hx b/externs/webextension_polyfill/manifest/WebExtensionLangpackManifestLanguagesPatternType.hx new file mode 100644 index 0000000..3417edb --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionLangpackManifestLanguagesPatternType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionLangpackManifestLanguagesPatternType = { + var chrome_resources : haxe.DynamicAccess>>; + var version : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionLangpackManifestSourcesPatternType.hx b/externs/webextension_polyfill/manifest/WebExtensionLangpackManifestSourcesPatternType.hx new file mode 100644 index 0000000..e502853 --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionLangpackManifestSourcesPatternType.hx @@ -0,0 +1,10 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionLangpackManifestSourcesPatternType = { + var base_path : String; + /** + Optional. + **/ + @:optional + var paths : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifest.hx b/externs/webextension_polyfill/manifest/WebExtensionManifest.hx new file mode 100644 index 0000000..5b0b57e --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifest.hx @@ -0,0 +1,210 @@ +package webextension_polyfill.manifest; + +/** + Represents a WebExtension manifest.json file +**/ +typedef WebExtensionManifest = { + /** + Optional. + **/ + @:optional + var minimum_chrome_version : String; + /** + Optional. + **/ + @:optional + var minimum_opera_version : String; + /** + Optional. + **/ + @:optional + var icons : haxe.DynamicAccess; + /** + Optional. + **/ + @:optional + var incognito : WebExtensionManifestIncognitoEnum; + /** + Optional. + **/ + @:optional + var background : ts.AnyOf3; + /** + Optional. + **/ + @:optional + var options_ui : WebExtensionManifestOptionsUiType; + /** + Optional. + **/ + @:optional + var content_scripts : Array; + /** + Optional. + **/ + @:optional + var content_security_policy : ts.AnyOf2; + /** + Optional. + **/ + @:optional + var permissions : Array; + /** + Optional. + **/ + @:optional + var granted_host_permissions : Bool; + /** + Optional. + **/ + @:optional + var host_permissions : Array; + /** + Optional. + **/ + @:optional + var optional_permissions : Array; + /** + Optional. + **/ + @:optional + var web_accessible_resources : ts.AnyOf2, Array>; + /** + Optional. + **/ + @:optional + var hidden : Bool; + /** + Optional. + **/ + @:optional + var action : ActionManifest; + /** + Optional. + **/ + @:optional + var browser_action : ActionManifest; + /** + Optional. + **/ + @:optional + var chrome_settings_overrides : WebExtensionManifestChromeSettingsOverridesType; + /** + Optional. + **/ + @:optional + var commands : haxe.DynamicAccess; + /** + Optional. + **/ + @:optional + var declarative_net_request : WebExtensionManifestDeclarativeNetRequestType; + /** + Optional. + **/ + @:optional + var devtools_page : String; + /** + Optional. + **/ + @:optional + var experiment_apis : WebExtensionManifestExperimentApisType; + /** + A list of protocol handler definitions. + Optional. + **/ + @:optional + var protocol_handlers : Array; + /** + Optional. + **/ + @:optional + var default_locale : String; + /** + Optional. + **/ + @:optional + var l10n_resources : Array; + /** + Optional. + **/ + @:optional + var omnibox : WebExtensionManifestOmniboxType; + /** + Optional. + **/ + @:optional + var page_action : WebExtensionManifestPageActionType; + /** + Optional. + **/ + @:optional + var sidebar_action : WebExtensionManifestSidebarActionType; + /** + Optional. + **/ + @:optional + var theme_experiment : ThemeExperiment; + /** + Optional. + **/ + @:optional + var chrome_url_overrides : WebExtensionManifestChromeUrlOverridesType; + /** + Optional. + **/ + @:optional + var user_scripts : WebExtensionManifestUserScriptsType; + var manifest_version : Float; + /** + The applications property is deprecated, please use 'browser_specific_settings' + Optional. + **/ + @:optional + var applications : DeprecatedApplications; + /** + Optional. + **/ + @:optional + var browser_specific_settings : BrowserSpecificSettings; + var name : String; + /** + Optional. + **/ + @:optional + var short_name : String; + /** + Optional. + **/ + @:optional + var description : String; + /** + Optional. + **/ + @:optional + var author : String; + var version : String; + /** + Optional. + **/ + @:optional + var homepage_url : String; + /** + Optional. + **/ + @:optional + var install_origins : Array; + /** + Optional. + **/ + @:optional + var developer : ManifestBaseDeveloperType; + /** + In addition to the version field, which is used for update purposes, version_name can be set to a descriptive version + string and will be used for display purposes if present. If no version_name is present, + the version field will be used for display purposes as well. + Optional. + **/ + @:optional + var version_name : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestBackgroundC1Type.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestBackgroundC1Type.hx new file mode 100644 index 0000000..bce10f4 --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestBackgroundC1Type.hx @@ -0,0 +1,10 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestBackgroundC1Type = { + var page : String; + /** + Optional. + **/ + @:optional + var persistent : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestBackgroundC2Type.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestBackgroundC2Type.hx new file mode 100644 index 0000000..4fb712f --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestBackgroundC2Type.hx @@ -0,0 +1,15 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestBackgroundC2Type = { + var scripts : Array; + /** + Optional. + **/ + @:optional + var type : WebExtensionManifestBackgroundC2TypeEnum; + /** + Optional. + **/ + @:optional + var persistent : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestBackgroundC2TypeEnum.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestBackgroundC2TypeEnum.hx new file mode 100644 index 0000000..5137b90 --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestBackgroundC2TypeEnum.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestBackgroundC2TypeEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestBackgroundC3Type.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestBackgroundC3Type.hx new file mode 100644 index 0000000..2b9075c --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestBackgroundC3Type.hx @@ -0,0 +1,12 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestBackgroundC3Type = { + var service_worker : String; + /** + Even though Manifest V3, does not support multiple background scripts, you can optionally declare the service worker as + an ES Module by specifying "type": "module", which allows you to import further code. + Optional. + **/ + @:optional + var type : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestChromeSettingsOverridesSearchProviderParamsItemType.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestChromeSettingsOverridesSearchProviderParamsItemType.hx new file mode 100644 index 0000000..1508f6b --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestChromeSettingsOverridesSearchProviderParamsItemType.hx @@ -0,0 +1,32 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestChromeSettingsOverridesSearchProviderParamsItemType = { + /** + A url parameter name + **/ + var name : String; + /** + The type of param can be either "purpose" or "pref". + Optional. + **/ + @:optional + var condition : String; + /** + The preference to retrieve the value from. + Optional. + **/ + @:optional + var pref : String; + /** + The context that initiates a search, required if condition is "purpose". + Optional. + **/ + @:optional + var purpose : String; + /** + A url parameter value. + Optional. + **/ + @:optional + var value : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestChromeSettingsOverridesSearchProviderType.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestChromeSettingsOverridesSearchProviderType.hx new file mode 100644 index 0000000..68dca41 --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestChromeSettingsOverridesSearchProviderType.hx @@ -0,0 +1,69 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestChromeSettingsOverridesSearchProviderType = { + var name : String; + /** + Optional. + **/ + @:optional + var keyword : ts.AnyOf2>; + var search_url : String; + /** + Optional. + **/ + @:optional + var favicon_url : String; + /** + Optional. + **/ + @:optional + var suggest_url : String; + /** + GET parameters to the search_url as a query string. + Optional. + **/ + @:optional + var search_url_get_params : String; + /** + POST parameters to the search_url as a query string. + Optional. + **/ + @:optional + var search_url_post_params : String; + /** + GET parameters to the suggest_url as a query string. + Optional. + **/ + @:optional + var suggest_url_get_params : String; + /** + POST parameters to the suggest_url as a query string. + Optional. + **/ + @:optional + var suggest_url_post_params : String; + /** + Optional. + **/ + @:optional + var search_form : String; + /** + Encoding of the search term. + Optional. + **/ + @:optional + var encoding : String; + /** + Sets the default engine to a built-in engine only. + Optional. + **/ + @:optional + var is_default : Bool; + /** + A list of optional search url parameters. This allows the additon of search url parameters based on how the search is + performed in Firefox. + Optional. + **/ + @:optional + var params : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestChromeSettingsOverridesType.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestChromeSettingsOverridesType.hx new file mode 100644 index 0000000..5fc2520 --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestChromeSettingsOverridesType.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestChromeSettingsOverridesType = { + /** + Optional. + **/ + @:optional + var homepage : String; + /** + Optional. + **/ + @:optional + var search_provider : WebExtensionManifestChromeSettingsOverridesSearchProviderType; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestChromeUrlOverridesType.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestChromeUrlOverridesType.hx new file mode 100644 index 0000000..4fd1ed9 --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestChromeUrlOverridesType.hx @@ -0,0 +1,9 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestChromeUrlOverridesType = { + /** + Optional. + **/ + @:optional + var newtab : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestCommandsSuggestedKeyType.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestCommandsSuggestedKeyType.hx new file mode 100644 index 0000000..46575f0 --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestCommandsSuggestedKeyType.hx @@ -0,0 +1,40 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestCommandsSuggestedKeyType = { + /** + Optional. + **/ + @:optional + @:native("default") + var default_ : String; + /** + Optional. + **/ + @:optional + var mac : String; + /** + Optional. + **/ + @:optional + var linux : String; + /** + Optional. + **/ + @:optional + var windows : String; + /** + Optional. + **/ + @:optional + var chromeos : String; + /** + Optional. + **/ + @:optional + var android : String; + /** + Optional. + **/ + @:optional + var ios : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestCommandsType.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestCommandsType.hx new file mode 100644 index 0000000..e2594f0 --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestCommandsType.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestCommandsType = { + /** + Optional. + **/ + @:optional + var suggested_key : WebExtensionManifestCommandsSuggestedKeyType; + /** + Optional. + **/ + @:optional + var description : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestContentSecurityPolicyC2Type.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestContentSecurityPolicyC2Type.hx new file mode 100644 index 0000000..6c1fa95 --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestContentSecurityPolicyC2Type.hx @@ -0,0 +1,19 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestContentSecurityPolicyC2Type = { + /** + The Content Security Policy used for extension pages. + Optional. + **/ + @:optional + var extension_pages : String; + /** + In addition, Manifest V3 disallows certain CSP modifications for `extension_pages` that were permitted in Manifest V2. + The `script-src`, `object-src`, and `worker-src` directives may only have the following values: + - `self` + - `none` - Any localhost source, (`http://localhost`, `http://127.0.0.1`, or any port on those domains) + Optional. + **/ + @:optional + var sandbox : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestDeclarativeNetRequestRuleResourcesItemType.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestDeclarativeNetRequestRuleResourcesItemType.hx new file mode 100644 index 0000000..8afb7da --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestDeclarativeNetRequestRuleResourcesItemType.hx @@ -0,0 +1,16 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestDeclarativeNetRequestRuleResourcesItemType = { + /** + A non-empty string uniquely identifying the ruleset. IDs beginning with '_' are reserved for internal use. + **/ + var id : String; + /** + Whether the ruleset is enabled by default. + **/ + var enabled : Bool; + /** + The path of the JSON ruleset relative to the extension directory. + **/ + var path : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestDeclarativeNetRequestType.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestDeclarativeNetRequestType.hx new file mode 100644 index 0000000..3776547 --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestDeclarativeNetRequestType.hx @@ -0,0 +1,5 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestDeclarativeNetRequestType = { + var rule_resources : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestExperimentApisType.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestExperimentApisType.hx new file mode 100644 index 0000000..8be784e --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestExperimentApisType.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestExperimentApisType = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestIncognitoEnum.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestIncognitoEnum.hx new file mode 100644 index 0000000..f3937f9 --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestIncognitoEnum.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestIncognitoEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestOmniboxType.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestOmniboxType.hx new file mode 100644 index 0000000..ea4528b --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestOmniboxType.hx @@ -0,0 +1,5 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestOmniboxType = { + var keyword : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestOptionsUiType.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestOptionsUiType.hx new file mode 100644 index 0000000..9dd1bca --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestOptionsUiType.hx @@ -0,0 +1,22 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestOptionsUiType = { + var page : String; + /** + Defaults to true in Manifest V2; Deprecated in Manifest V3. + Optional. + **/ + @:optional + var browser_style : Bool; + /** + chrome_style is ignored in Firefox. Its replacement (browser_style) has been deprecated. + Optional. + **/ + @:optional + var chrome_style : Bool; + /** + Optional. + **/ + @:optional + var open_in_tab : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestPageActionType.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestPageActionType.hx new file mode 100644 index 0000000..25dca4b --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestPageActionType.hx @@ -0,0 +1,40 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestPageActionType = { + /** + Optional. + **/ + @:optional + var default_title : String; + /** + Optional. + **/ + @:optional + var default_icon : ts.AnyOf2>; + /** + Optional. + **/ + @:optional + var default_popup : String; + /** + Deprecated in Manifest V3. + Optional. + **/ + @:optional + var browser_style : Bool; + /** + Optional. + **/ + @:optional + var show_matches : Array; + /** + Optional. + **/ + @:optional + var hide_matches : Array; + /** + Optional. + **/ + @:optional + var pinned : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestSidebarActionType.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestSidebarActionType.hx new file mode 100644 index 0000000..4a9cfcb --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestSidebarActionType.hx @@ -0,0 +1,27 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestSidebarActionType = { + /** + Optional. + **/ + @:optional + var default_title : String; + /** + Optional. + **/ + @:optional + var default_icon : ts.AnyOf2>; + /** + Defaults to true in Manifest V2; Deprecated in Manifest V3. + Optional. + **/ + @:optional + var browser_style : Bool; + var default_panel : String; + /** + Whether or not the sidebar is opened at install. Default is true. + Optional. + **/ + @:optional + var open_at_install : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestUserScriptsType.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestUserScriptsType.hx new file mode 100644 index 0000000..5f50106 --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestUserScriptsType.hx @@ -0,0 +1,9 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestUserScriptsType = { + /** + Optional. + **/ + @:optional + var api_script : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionManifestWebAccessibleResourcesC2ItemType.hx b/externs/webextension_polyfill/manifest/WebExtensionManifestWebAccessibleResourcesC2ItemType.hx new file mode 100644 index 0000000..6b4708c --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionManifestWebAccessibleResourcesC2ItemType.hx @@ -0,0 +1,15 @@ +package webextension_polyfill.manifest; + +typedef WebExtensionManifestWebAccessibleResourcesC2ItemType = { + var resources : Array; + /** + Optional. + **/ + @:optional + var matches : Array; + /** + Optional. + **/ + @:optional + var extension_ids : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/manifest/WebExtensionSitePermissionsManifest.hx b/externs/webextension_polyfill/manifest/WebExtensionSitePermissionsManifest.hx new file mode 100644 index 0000000..3335de8 --- /dev/null +++ b/externs/webextension_polyfill/manifest/WebExtensionSitePermissionsManifest.hx @@ -0,0 +1,59 @@ +package webextension_polyfill.manifest; + +/** + Represents a WebExtension site permissions manifest.json file +**/ +typedef WebExtensionSitePermissionsManifest = { + var site_permissions : Array; + /** + Optional. + **/ + var install_origins : ts.Tuple1; + var manifest_version : Float; + /** + The applications property is deprecated, please use 'browser_specific_settings' + Optional. + **/ + @:optional + var applications : DeprecatedApplications; + /** + Optional. + **/ + @:optional + var browser_specific_settings : BrowserSpecificSettings; + var name : String; + /** + Optional. + **/ + @:optional + var short_name : String; + /** + Optional. + **/ + @:optional + var description : String; + /** + Optional. + **/ + @:optional + var author : String; + var version : String; + /** + Optional. + **/ + @:optional + var homepage_url : String; + /** + Optional. + **/ + @:optional + var developer : ManifestBaseDeveloperType; + /** + In addition to the version field, which is used for update purposes, version_name can be set to a descriptive version + string and will be used for display purposes if present. If no version_name is present, + the version field will be used for display purposes as well. + Optional. + **/ + @:optional + var version_name : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/menus/ContextType.hx b/externs/webextension_polyfill/menus/ContextType.hx new file mode 100644 index 0000000..1c3e34c --- /dev/null +++ b/externs/webextension_polyfill/menus/ContextType.hx @@ -0,0 +1,7 @@ +package webextension_polyfill.menus; + +/** + The different contexts a menu can appear in. Specifying 'all' is equivalent to the combination of all other contexts + except for 'tab' and 'tools_menu'. +**/ +typedef ContextType = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/menus/CreateCreatePropertiesType.hx b/externs/webextension_polyfill/menus/CreateCreatePropertiesType.hx new file mode 100644 index 0000000..d37f301 --- /dev/null +++ b/externs/webextension_polyfill/menus/CreateCreatePropertiesType.hx @@ -0,0 +1,93 @@ +package webextension_polyfill.menus; + +typedef CreateCreatePropertiesType = { + /** + The type of menu item. Defaults to 'normal' if not specified. + Optional. + **/ + @:optional + var type : ItemType; + /** + The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension. + Optional. + **/ + @:optional + var id : String; + /** + Optional. + **/ + @:optional + var icons : haxe.DynamicAccess; + /** + The text to be displayed in the item; this is required unless type is 'separator'. + When the context is 'selection', you can use %s within the string to show the selected text. For example, + if this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", + the context menu item for the selection is "Translate 'cool' to Pig Latin". + Optional. + **/ + @:optional + var title : String; + /** + The initial state of a checkbox or radio item: true for selected and false for unselected. + Only one radio item can be selected at a time in a given group of radio items. + Optional. + **/ + @:optional + var checked : Bool; + /** + List of contexts this menu item will appear in. Defaults to ['page'] if not specified. + Optional. + **/ + @:optional + var contexts : Array; + /** + List of view types where the menu item will be shown. Defaults to any view, including those without a viewType. + Optional. + **/ + @:optional + var viewTypes : Array; + /** + Whether the item is visible in the menu. + Optional. + **/ + @:optional + var visible : Bool; + /** + A function that will be called back when the menu item is clicked. Event pages cannot use this; instead, + they should register a listener for $(ref:contextMenus.onClicked). + **/ + @:optional + function onclick(info:OnClickData, tab:webextension_polyfill.tabs.Tab):Void; + /** + The ID of a parent menu item; this makes the item a child of a previously added item. + Optional. + **/ + @:optional + var parentId : ts.AnyOf2; + /** + Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. + (This applies to frames as well.) For details on the format of a pattern, see $(topic:match_patterns)[Match Patterns]. + Optional. + **/ + @:optional + var documentUrlPatterns : Array; + /** + Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of + anchor tags. + Optional. + **/ + @:optional + var targetUrlPatterns : Array; + /** + Whether this context menu item is enabled or disabled. Defaults to true. + Optional. + **/ + @:optional + var enabled : Bool; + /** + Specifies a command to issue for the context click. + Optional. + **/ + @:optional + var command : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/menus/ItemType.hx b/externs/webextension_polyfill/menus/ItemType.hx new file mode 100644 index 0000000..f0096a9 --- /dev/null +++ b/externs/webextension_polyfill/menus/ItemType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.menus; + +/** + The type of menu item. +**/ +typedef ItemType = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/menus/OnClickData.hx b/externs/webextension_polyfill/menus/OnClickData.hx new file mode 100644 index 0000000..0a39311 --- /dev/null +++ b/externs/webextension_polyfill/menus/OnClickData.hx @@ -0,0 +1,110 @@ +package webextension_polyfill.menus; + +/** + Information sent when a context menu item is clicked. +**/ +typedef OnClickData = { + /** + The ID of the menu item that was clicked. + **/ + var menuItemId : ts.AnyOf2; + /** + The parent ID, if any, for the item clicked. + Optional. + **/ + @:optional + var parentMenuItemId : ts.AnyOf2; + /** + The type of view where the menu is clicked. May be unset if the menu is not associated with a view. + Optional. + **/ + @:optional + var viewType : webextension_polyfill.extension.ViewType; + /** + One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements. + Optional. + **/ + @:optional + var mediaType : String; + /** + If the element is a link, the text of that link. + Optional. + **/ + @:optional + var linkText : String; + /** + If the element is a link, the URL it points to. + Optional. + **/ + @:optional + var linkUrl : String; + /** + Will be present for elements with a 'src' URL. + Optional. + **/ + @:optional + var srcUrl : String; + /** + The URL of the page where the menu item was clicked. This property is not set if the click occured in a context where + there is no current page, such as in a launcher context menu. + Optional. + **/ + @:optional + var pageUrl : String; + /** + The id of the frame of the element where the context menu was clicked. + Optional. + **/ + @:optional + var frameId : Float; + /** + The URL of the frame of the element where the context menu was clicked, if it was in a frame. + Optional. + **/ + @:optional + var frameUrl : String; + /** + The text for the context selection, if any. + Optional. + **/ + @:optional + var selectionText : String; + /** + A flag indicating whether the element is editable (text input, textarea, etc.). + **/ + var editable : Bool; + /** + A flag indicating the state of a checkbox or radio item before it was clicked. + Optional. + **/ + @:optional + var wasChecked : Bool; + /** + A flag indicating the state of a checkbox or radio item after it is clicked. + Optional. + **/ + @:optional + var checked : Bool; + /** + The id of the bookmark where the context menu was clicked, if it was on a bookmark. + Optional. + **/ + @:optional + var bookmarkId : String; + /** + An array of keyboard modifiers that were held while the menu item was clicked. + **/ + var modifiers : Array; + /** + An integer value of button by which menu item was clicked. + Optional. + **/ + @:optional + var button : Float; + /** + An identifier of the clicked element, if any. Use menus.getTargetElement in the page to find the corresponding element. + Optional. + **/ + @:optional + var targetElementId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/menus/OnClickDataModifiersItemEnum.hx b/externs/webextension_polyfill/menus/OnClickDataModifiersItemEnum.hx new file mode 100644 index 0000000..1ece064 --- /dev/null +++ b/externs/webextension_polyfill/menus/OnClickDataModifiersItemEnum.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.menus; + +typedef OnClickDataModifiersItemEnum = webextension_polyfill.action.OnClickDataModifiersItemEnum; \ No newline at end of file diff --git a/externs/webextension_polyfill/menus/OnShownInfoType.hx b/externs/webextension_polyfill/menus/OnShownInfoType.hx new file mode 100644 index 0000000..804dec6 --- /dev/null +++ b/externs/webextension_polyfill/menus/OnShownInfoType.hx @@ -0,0 +1,63 @@ +package webextension_polyfill.menus; + +/** + Information about the context of the menu action and the created menu items. For more information about each property, + see OnClickData. The following properties are only set if the extension has host permissions for the given context: + linkUrl, linkText, srcUrl, pageUrl, frameUrl, selectionText. +**/ +typedef OnShownInfoType = { + /** + A list of IDs of the menu items that were shown. + **/ + var menuIds : Array>; + /** + A list of all contexts that apply to the menu. + **/ + var contexts : Array; + /** + Optional. + **/ + @:optional + var viewType : webextension_polyfill.extension.ViewType; + var editable : Bool; + /** + Optional. + **/ + @:optional + var mediaType : String; + /** + Optional. + **/ + @:optional + var linkUrl : String; + /** + Optional. + **/ + @:optional + var linkText : String; + /** + Optional. + **/ + @:optional + var srcUrl : String; + /** + Optional. + **/ + @:optional + var pageUrl : String; + /** + Optional. + **/ + @:optional + var frameUrl : String; + /** + Optional. + **/ + @:optional + var selectionText : String; + /** + Optional. + **/ + @:optional + var targetElementId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/menus/OverrideContextContextOptionsType.hx b/externs/webextension_polyfill/menus/OverrideContextContextOptionsType.hx new file mode 100644 index 0000000..d15d999 --- /dev/null +++ b/externs/webextension_polyfill/menus/OverrideContextContextOptionsType.hx @@ -0,0 +1,29 @@ +package webextension_polyfill.menus; + +typedef OverrideContextContextOptionsType = { + /** + Whether to also include default menu items in the menu. + Optional. + **/ + @:optional + var showDefaults : Bool; + /** + ContextType to override, to allow menu items from other extensions in the menu. Currently only 'bookmark' and 'tab' are + supported. showDefaults cannot be used with this option. + Optional. + **/ + @:optional + var context : OverrideContextContextOptionsTypeContextEnum; + /** + Required when context is 'bookmark'. Requires 'bookmark' permission. + Optional. + **/ + @:optional + var bookmarkId : String; + /** + Required when context is 'tab'. Requires 'tabs' permission. + Optional. + **/ + @:optional + var tabId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/menus/OverrideContextContextOptionsTypeContextEnum.hx b/externs/webextension_polyfill/menus/OverrideContextContextOptionsTypeContextEnum.hx new file mode 100644 index 0000000..b2b7796 --- /dev/null +++ b/externs/webextension_polyfill/menus/OverrideContextContextOptionsTypeContextEnum.hx @@ -0,0 +1,7 @@ +package webextension_polyfill.menus; + +/** + ContextType to override, to allow menu items from other extensions in the menu. Currently only 'bookmark' and 'tab' are + supported. showDefaults cannot be used with this option. +**/ +typedef OverrideContextContextOptionsTypeContextEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/menus/Static.hx b/externs/webextension_polyfill/menus/Static.hx new file mode 100644 index 0000000..3dcb3bc --- /dev/null +++ b/externs/webextension_polyfill/menus/Static.hx @@ -0,0 +1,54 @@ +package webextension_polyfill.menus; + +typedef Static = { + /** + Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation + callback fires (the details will be in $(ref:runtime.lastError)). + **/ + function create(createProperties:CreateCreatePropertiesType, ?callback:() -> Void):ts.AnyOf2; + /** + Updates a previously created context menu item. + **/ + function update(id:ts.AnyOf2, updateProperties:UpdateUpdatePropertiesType):js.lib.Promise; + /** + Removes a context menu item. + **/ + function remove(menuItemId:ts.AnyOf2):js.lib.Promise; + /** + Removes all context menu items added by this extension. + **/ + function removeAll():js.lib.Promise; + /** + Show the matching menu items from this extension instead of the default menu. This should be called during a + 'contextmenu' DOM event handler, and only applies to the menu that opens after this event. + **/ + function overrideContext(contextOptions:OverrideContextContextOptionsType):Void; + /** + Updates the extension items in the shown menu, including changes that have been made since the menu was shown. + Has no effect if the menu is hidden. Rebuilding a shown menu is an expensive operation, + only invoke this method when necessary. + **/ + function refresh():js.lib.Promise; + /** + Retrieve the element that was associated with a recent contextmenu event. + **/ + function getTargetElement(targetElementId:Float):js.html.DOMElement; + /** + Fired when a context menu item is clicked. + **/ + var onClicked : webextension_polyfill.events.Event<(info:OnClickData, tab:Null) -> Void>; + /** + Fired when a menu is shown. The extension can add, modify or remove menu items and call menus.refresh() + to update the menu. + **/ + var onShown : webextension_polyfill.events.Event<(info:OnShownInfoType, tab:webextension_polyfill.tabs.Tab) -> Void>; + /** + Fired when a menu is hidden. This event is only fired if onShown has fired before. + **/ + var onHidden : webextension_polyfill.events.Event<() -> Void>; + /** + The maximum number of top level extension items that can be added to an extension action context menu. + Any items beyond this limit will be ignored. + **/ + var ACTION_MENU_TOP_LEVEL_LIMIT : Int; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/menus/UpdateUpdatePropertiesType.hx b/externs/webextension_polyfill/menus/UpdateUpdatePropertiesType.hx new file mode 100644 index 0000000..4b485cc --- /dev/null +++ b/externs/webextension_polyfill/menus/UpdateUpdatePropertiesType.hx @@ -0,0 +1,66 @@ +package webextension_polyfill.menus; + +/** + The properties to update. Accepts the same values as the create function. +**/ +typedef UpdateUpdatePropertiesType = { + /** + Optional. + **/ + @:optional + var type : ItemType; + /** + Optional. + **/ + @:optional + var icons : haxe.DynamicAccess; + /** + Optional. + **/ + @:optional + var title : String; + /** + Optional. + **/ + @:optional + var checked : Bool; + /** + Optional. + **/ + @:optional + var contexts : Array; + /** + Optional. + **/ + @:optional + var viewTypes : Array; + /** + Whether the item is visible in the menu. + Optional. + **/ + @:optional + var visible : Bool; + @:optional + function onclick(info:OnClickData, tab:webextension_polyfill.tabs.Tab):Void; + /** + Note: You cannot change an item to be a child of one of its own descendants. + Optional. + **/ + @:optional + var parentId : ts.AnyOf2; + /** + Optional. + **/ + @:optional + var documentUrlPatterns : Array; + /** + Optional. + **/ + @:optional + var targetUrlPatterns : Array; + /** + Optional. + **/ + @:optional + var enabled : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/browsersettings_colormanagement/browsersettingscolormanagement/Static.hx b/externs/webextension_polyfill/namespaces/browsersettings_colormanagement/browsersettingscolormanagement/Static.hx new file mode 100644 index 0000000..5a2fa7a --- /dev/null +++ b/externs/webextension_polyfill/namespaces/browsersettings_colormanagement/browsersettingscolormanagement/Static.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.namespaces.browsersettings_colormanagement.browsersettingscolormanagement; + +typedef Static = { + /** + This setting controls the mode used for color management and must be a string from $(ref:browserSettings. + ColorManagementMode) + **/ + var mode : webextension_polyfill.types.Setting; + /** + This boolean setting controls whether or not native sRGB color management is used. + **/ + var useNativeSRGB : webextension_polyfill.types.Setting; + /** + This boolean setting controls whether or not the WebRender compositor is used. + **/ + var useWebRenderCompositor : webextension_polyfill.types.Setting; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/devtools_inspectedwindow/devtoolsinspectedwindow/EvalCallbackExceptionInfoType.hx b/externs/webextension_polyfill/namespaces/devtools_inspectedwindow/devtoolsinspectedwindow/EvalCallbackExceptionInfoType.hx new file mode 100644 index 0000000..16ee4b4 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/devtools_inspectedwindow/devtoolsinspectedwindow/EvalCallbackExceptionInfoType.hx @@ -0,0 +1,33 @@ +package webextension_polyfill.namespaces.devtools_inspectedwindow.devtoolsinspectedwindow; + +/** + An object providing details if an exception occurred while evaluating the expression. +**/ +typedef EvalCallbackExceptionInfoType = { + /** + Set if the error occurred on the DevTools side before the expression is evaluated. + **/ + var isError : Bool; + /** + Set if the error occurred on the DevTools side before the expression is evaluated. + **/ + var code : String; + /** + Set if the error occurred on the DevTools side before the expression is evaluated. + **/ + var description : String; + /** + Set if the error occurred on the DevTools side before the expression is evaluated, + contains the array of the values that may be substituted into the description string to provide more information about + the cause of the error. + **/ + var details : Array; + /** + Set if the evaluated code produces an unhandled exception. + **/ + var isException : Bool; + /** + Set if the evaluated code produces an unhandled exception. + **/ + var value : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/devtools_inspectedwindow/devtoolsinspectedwindow/EvalOptionsType.hx b/externs/webextension_polyfill/namespaces/devtools_inspectedwindow/devtoolsinspectedwindow/EvalOptionsType.hx new file mode 100644 index 0000000..34ef479 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/devtools_inspectedwindow/devtoolsinspectedwindow/EvalOptionsType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.namespaces.devtools_inspectedwindow.devtoolsinspectedwindow; + +/** + The options parameter can contain one or more options. +**/ +typedef EvalOptionsType = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/devtools_inspectedwindow/devtoolsinspectedwindow/ReloadReloadOptionsType.hx b/externs/webextension_polyfill/namespaces/devtools_inspectedwindow/devtoolsinspectedwindow/ReloadReloadOptionsType.hx new file mode 100644 index 0000000..840149f --- /dev/null +++ b/externs/webextension_polyfill/namespaces/devtools_inspectedwindow/devtoolsinspectedwindow/ReloadReloadOptionsType.hx @@ -0,0 +1,28 @@ +package webextension_polyfill.namespaces.devtools_inspectedwindow.devtoolsinspectedwindow; + +typedef ReloadReloadOptionsType = { + /** + When true, the loader will bypass the cache for all inspected page resources loaded before the load + event is fired. The effect is similar to pressing Ctrl+Shift+R in the inspected window or within the Developer Tools + window. + Optional. + **/ + @:optional + var ignoreCache : Bool; + /** + If specified, the string will override the value of the User-Agent HTTP header that's sent while loading + the resources of the inspected page. The string will also override the value of the navigator.userAgent + property that's returned to any scripts that are running within the inspected page. + Optional. + **/ + @:optional + var userAgent : String; + /** + If specified, the script will be injected into every frame of the inspected page immediately upon load, + before any of the frame's scripts. The script will not be injected after subsequent reloads—for example, + if the user presses Ctrl+R. + Optional. + **/ + @:optional + var injectedScript : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/devtools_inspectedwindow/devtoolsinspectedwindow/Resource.hx b/externs/webextension_polyfill/namespaces/devtools_inspectedwindow/devtoolsinspectedwindow/Resource.hx new file mode 100644 index 0000000..b2831de --- /dev/null +++ b/externs/webextension_polyfill/namespaces/devtools_inspectedwindow/devtoolsinspectedwindow/Resource.hx @@ -0,0 +1,11 @@ +package webextension_polyfill.namespaces.devtools_inspectedwindow.devtoolsinspectedwindow; + +/** + A resource within the inspected page, such as a document, a script, or an image. +**/ +typedef Resource = { + /** + The URL of the resource. + **/ + var url : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/devtools_inspectedwindow/devtoolsinspectedwindow/Static.hx b/externs/webextension_polyfill/namespaces/devtools_inspectedwindow/devtoolsinspectedwindow/Static.hx new file mode 100644 index 0000000..5e9f03c --- /dev/null +++ b/externs/webextension_polyfill/namespaces/devtools_inspectedwindow/devtoolsinspectedwindow/Static.hx @@ -0,0 +1,22 @@ +package webextension_polyfill.namespaces.devtools_inspectedwindow.devtoolsinspectedwindow; + +typedef Static = { + /** + Evaluates a JavaScript expression in the context of the main frame of the inspected page. + The expression must evaluate to a JSON-compliant object, otherwise an exception is thrown. + The eval function can report either a DevTools-side error or a JavaScript exception that occurs during evaluation. + In either case, the result parameter of the callback is undefined. + In the case of a DevTools-side error, the isException parameter is non-null and has isError + set to true and code set to an error code. In the case of a JavaScript error, isException + is set to true and value is set to the string value of thrown object. + **/ + function eval(expression:String, ?options:EvalOptionsType):js.lib.Promise>; + /** + Reloads the inspected page. + **/ + function reload(?reloadOptions:ReloadReloadOptionsType):Void; + /** + The ID of the tab being inspected. This ID may be used with chrome.tabs.* API. + **/ + var tabId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/devtools_network/devtoolsnetwork/GetHARCallbackHarLogType.hx b/externs/webextension_polyfill/namespaces/devtools_network/devtoolsnetwork/GetHARCallbackHarLogType.hx new file mode 100644 index 0000000..ff2d152 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/devtools_network/devtoolsnetwork/GetHARCallbackHarLogType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.namespaces.devtools_network.devtoolsnetwork; + +/** + A HAR log. See HAR specification for details. +**/ +typedef GetHARCallbackHarLogType = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/devtools_network/devtoolsnetwork/Request.hx b/externs/webextension_polyfill/namespaces/devtools_network/devtoolsnetwork/Request.hx new file mode 100644 index 0000000..cd3d399 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/devtools_network/devtoolsnetwork/Request.hx @@ -0,0 +1,11 @@ +package webextension_polyfill.namespaces.devtools_network.devtoolsnetwork; + +/** + Represents a network request for a document resource (script, image and so on). See HAR Specification for reference. +**/ +typedef Request = { + /** + Returns content of the response body. + **/ + function getContent():js.lib.Promise>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/devtools_network/devtoolsnetwork/Static.hx b/externs/webextension_polyfill/namespaces/devtools_network/devtoolsnetwork/Static.hx new file mode 100644 index 0000000..e1dc1d4 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/devtools_network/devtoolsnetwork/Static.hx @@ -0,0 +1,16 @@ +package webextension_polyfill.namespaces.devtools_network.devtoolsnetwork; + +typedef Static = { + /** + Returns HAR log that contains all known network requests. + **/ + function getHAR():js.lib.Promise; + /** + Fired when a network request is finished and all request data are available. + **/ + var onRequestFinished : webextension_polyfill.events.Event<(request:Request) -> Void>; + /** + Fired when the inspected window navigates to a new page. + **/ + var onNavigated : webextension_polyfill.events.Event<(url:String) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/devtools_panels/devtoolspanels/Button.hx b/externs/webextension_polyfill/namespaces/devtools_panels/devtoolspanels/Button.hx new file mode 100644 index 0000000..c9d0a1f --- /dev/null +++ b/externs/webextension_polyfill/namespaces/devtools_panels/devtoolspanels/Button.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.namespaces.devtools_panels.devtoolspanels; + +/** + A button created by the extension. +**/ +typedef Button = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/devtools_panels/devtoolspanels/ElementsPanel.hx b/externs/webextension_polyfill/namespaces/devtools_panels/devtoolspanels/ElementsPanel.hx new file mode 100644 index 0000000..bfd1cd3 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/devtools_panels/devtoolspanels/ElementsPanel.hx @@ -0,0 +1,15 @@ +package webextension_polyfill.namespaces.devtools_panels.devtoolspanels; + +/** + Represents the Elements panel. +**/ +typedef ElementsPanel = { + /** + Creates a pane within panel's sidebar. + **/ + function createSidebarPane(title:String):js.lib.Promise; + /** + Fired when an object is selected in the panel. + **/ + var onSelectionChanged : webextension_polyfill.events.Event<() -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/devtools_panels/devtoolspanels/ExtensionPanel.hx b/externs/webextension_polyfill/namespaces/devtools_panels/devtoolspanels/ExtensionPanel.hx new file mode 100644 index 0000000..1267c64 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/devtools_panels/devtoolspanels/ExtensionPanel.hx @@ -0,0 +1,15 @@ +package webextension_polyfill.namespaces.devtools_panels.devtoolspanels; + +/** + Represents a panel created by extension. +**/ +typedef ExtensionPanel = { + /** + Fired when the user switches to the panel. + **/ + var onShown : webextension_polyfill.events.Event<(window:js.html.Window) -> Void>; + /** + Fired when the user switches away from the panel. + **/ + var onHidden : webextension_polyfill.events.Event<() -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/devtools_panels/devtoolspanels/ExtensionSidebarPane.hx b/externs/webextension_polyfill/namespaces/devtools_panels/devtoolspanels/ExtensionSidebarPane.hx new file mode 100644 index 0000000..8859e68 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/devtools_panels/devtoolspanels/ExtensionSidebarPane.hx @@ -0,0 +1,28 @@ +package webextension_polyfill.namespaces.devtools_panels.devtoolspanels; + +/** + A sidebar created by the extension. +**/ +typedef ExtensionSidebarPane = { + /** + Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane. + **/ + function setExpression(expression:String, ?rootTitle:String):js.lib.Promise; + /** + Sets a JSON-compliant object to be displayed in the sidebar pane. + **/ + function setObject(jsonObject:ts.AnyOf3, haxe.DynamicAccess>, ?rootTitle:String):js.lib.Promise; + /** + Sets an HTML page to be displayed in the sidebar pane. + **/ + function setPage(path:String):Void; + /** + Fired when the sidebar pane becomes visible as a result of user switching to the panel that hosts it. + **/ + var onShown : webextension_polyfill.events.Event<(window:js.html.Window) -> Void>; + /** + Fired when the sidebar pane becomes hidden as a result of the user switching away from the panel that hosts the sidebar + pane. + **/ + var onHidden : webextension_polyfill.events.Event<() -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/devtools_panels/devtoolspanels/SourcesPanel.hx b/externs/webextension_polyfill/namespaces/devtools_panels/devtoolspanels/SourcesPanel.hx new file mode 100644 index 0000000..bf07677 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/devtools_panels/devtoolspanels/SourcesPanel.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.namespaces.devtools_panels.devtoolspanels; + +/** + Represents the Sources panel. +**/ +typedef SourcesPanel = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/devtools_panels/devtoolspanels/Static.hx b/externs/webextension_polyfill/namespaces/devtools_panels/devtoolspanels/Static.hx new file mode 100644 index 0000000..c48b595 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/devtools_panels/devtoolspanels/Static.hx @@ -0,0 +1,24 @@ +package webextension_polyfill.namespaces.devtools_panels.devtoolspanels; + +typedef Static = { + /** + Creates an extension panel. + **/ + function create(title:String, iconPath:String, pagePath:String):js.lib.Promise; + /** + Fired when the devtools theme changes. + **/ + var onThemeChanged : webextension_polyfill.events.Event<(themeName:String) -> Void>; + /** + Elements panel. + **/ + var elements : ElementsPanel; + /** + Sources panel. + **/ + var sources : SourcesPanel; + /** + The name of the current devtools theme. + **/ + var themeName : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/privacy_network/privacynetwork/HTTPSOnlyModeOption.hx b/externs/webextension_polyfill/namespaces/privacy_network/privacynetwork/HTTPSOnlyModeOption.hx new file mode 100644 index 0000000..1daf436 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/privacy_network/privacynetwork/HTTPSOnlyModeOption.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.namespaces.privacy_network.privacynetwork; + +/** + The mode for https-only mode. +**/ +typedef HTTPSOnlyModeOption = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/privacy_network/privacynetwork/IPHandlingPolicy.hx b/externs/webextension_polyfill/namespaces/privacy_network/privacynetwork/IPHandlingPolicy.hx new file mode 100644 index 0000000..268846c --- /dev/null +++ b/externs/webextension_polyfill/namespaces/privacy_network/privacynetwork/IPHandlingPolicy.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.namespaces.privacy_network.privacynetwork; + +/** + The IP handling policy of WebRTC. +**/ +typedef IPHandlingPolicy = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/privacy_network/privacynetwork/Static.hx b/externs/webextension_polyfill/namespaces/privacy_network/privacynetwork/Static.hx new file mode 100644 index 0000000..9de2e16 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/privacy_network/privacynetwork/Static.hx @@ -0,0 +1,35 @@ +package webextension_polyfill.namespaces.privacy_network.privacynetwork; + +typedef Static = { + /** + If enabled, the browser attempts to speed up your web browsing experience by pre-resolving DNS entries, + prerendering sites (<link rel='prefetch' ...>), and preemptively opening TCP and SSL connections to + servers. This preference's value is a boolean, defaulting to true. + **/ + var networkPredictionEnabled : webextension_polyfill.types.Setting; + /** + Allow users to enable and disable RTCPeerConnections (aka WebRTC). + **/ + var peerConnectionEnabled : webextension_polyfill.types.Setting; + /** + Allow users to specify the media performance/privacy tradeoffs which impacts how WebRTC traffic will be routed and how + much local address information is exposed. This preference's value is of type IPHandlingPolicy, defaulting to + default. + **/ + var webRTCIPHandlingPolicy : webextension_polyfill.types.Setting; + /** + This property controls the minimum and maximum TLS versions. This setting's value is an object of + $(ref:tlsVersionRestrictionConfig). + **/ + var tlsVersionRestriction : webextension_polyfill.types.Setting; + /** + Allow users to query the mode for 'HTTPS-Only Mode'. This setting's value is of type HTTPSOnlyModeOption, + defaulting to never. + **/ + var httpsOnlyMode : webextension_polyfill.types.Setting; + /** + Allow users to query the status of 'Global Privacy Control'. This setting's value is of type boolean, + defaulting to false. + **/ + var globalPrivacyControl : webextension_polyfill.types.Setting; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/privacy_network/privacynetwork/TlsVersionRestrictionConfig.hx b/externs/webextension_polyfill/namespaces/privacy_network/privacynetwork/TlsVersionRestrictionConfig.hx new file mode 100644 index 0000000..694cbb8 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/privacy_network/privacynetwork/TlsVersionRestrictionConfig.hx @@ -0,0 +1,19 @@ +package webextension_polyfill.namespaces.privacy_network.privacynetwork; + +/** + An object which describes TLS minimum and maximum versions. +**/ +typedef TlsVersionRestrictionConfig = { + /** + The minimum TLS version supported. + Optional. + **/ + @:optional + var minimum : webextension_polyfill.webrequest.SecurityInfoProtocolVersionEnum; + /** + The maximum TLS version supported. + Optional. + **/ + @:optional + var maximum : webextension_polyfill.webrequest.SecurityInfoProtocolVersionEnum; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/privacy_network/privacynetwork/TlsVersionRestrictionConfigMaximumEnum.hx b/externs/webextension_polyfill/namespaces/privacy_network/privacynetwork/TlsVersionRestrictionConfigMaximumEnum.hx new file mode 100644 index 0000000..fe7f0fe --- /dev/null +++ b/externs/webextension_polyfill/namespaces/privacy_network/privacynetwork/TlsVersionRestrictionConfigMaximumEnum.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.namespaces.privacy_network.privacynetwork; + +/** + The maximum TLS version supported. +**/ +typedef TlsVersionRestrictionConfigMaximumEnum = webextension_polyfill.webrequest.SecurityInfoProtocolVersionEnum; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/privacy_network/privacynetwork/TlsVersionRestrictionConfigMinimumEnum.hx b/externs/webextension_polyfill/namespaces/privacy_network/privacynetwork/TlsVersionRestrictionConfigMinimumEnum.hx new file mode 100644 index 0000000..d8bcff2 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/privacy_network/privacynetwork/TlsVersionRestrictionConfigMinimumEnum.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.namespaces.privacy_network.privacynetwork; + +/** + The minimum TLS version supported. +**/ +typedef TlsVersionRestrictionConfigMinimumEnum = webextension_polyfill.webrequest.SecurityInfoProtocolVersionEnum; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/privacy_services/privacyservices/Static.hx b/externs/webextension_polyfill/namespaces/privacy_services/privacyservices/Static.hx new file mode 100644 index 0000000..9be7bf9 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/privacy_services/privacyservices/Static.hx @@ -0,0 +1,9 @@ +package webextension_polyfill.namespaces.privacy_services.privacyservices; + +typedef Static = { + /** + If enabled, the password manager will ask if you want to save passwords. This preference's value is a boolean, + defaulting to true. + **/ + var passwordSavingEnabled : webextension_polyfill.types.Setting; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/privacy_websites/privacywebsites/CookieConfig.hx b/externs/webextension_polyfill/namespaces/privacy_websites/privacywebsites/CookieConfig.hx new file mode 100644 index 0000000..0895ec7 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/privacy_websites/privacywebsites/CookieConfig.hx @@ -0,0 +1,13 @@ +package webextension_polyfill.namespaces.privacy_websites.privacywebsites; + +/** + The settings for cookies. +**/ +typedef CookieConfig = { + /** + The type of cookies to allow. + Optional. + **/ + @:optional + var behavior : CookieConfigBehaviorEnum; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/privacy_websites/privacywebsites/CookieConfigBehaviorEnum.hx b/externs/webextension_polyfill/namespaces/privacy_websites/privacywebsites/CookieConfigBehaviorEnum.hx new file mode 100644 index 0000000..4715212 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/privacy_websites/privacywebsites/CookieConfigBehaviorEnum.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.namespaces.privacy_websites.privacywebsites; + +/** + The type of cookies to allow. +**/ +typedef CookieConfigBehaviorEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/privacy_websites/privacywebsites/Static.hx b/externs/webextension_polyfill/namespaces/privacy_websites/privacywebsites/Static.hx new file mode 100644 index 0000000..91c38e9 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/privacy_websites/privacywebsites/Static.hx @@ -0,0 +1,41 @@ +package webextension_polyfill.namespaces.privacy_websites.privacywebsites; + +typedef Static = { + /** + If enabled, the browser sends auditing pings when requested by a website (<a ping>). + The value of this preference is of type boolean, and the default value is true. + **/ + var hyperlinkAuditingEnabled : webextension_polyfill.types.Setting; + /** + If enabled, the browser sends referer headers with your requests. Yes, + the name of this preference doesn't match the misspelled header. No, we're not going to change it. + The value of this preference is of type boolean, and the default value is true. + **/ + var referrersEnabled : webextension_polyfill.types.Setting; + /** + If enabled, the browser attempts to appear similar to other users by reporting generic information to websites. + This can prevent websites from uniquely identifying users. Examples of data that is spoofed include number of CPU cores, + precision of JavaScript timers, the local timezone, and disabling features such as GamePad support, + and the WebSpeech and Navigator APIs. The value of this preference is of type boolean, and the default value is + false. + **/ + var resistFingerprinting : webextension_polyfill.types.Setting; + /** + If enabled, the browser will associate all data (including cookies, HSTS data, cached images, and more) + for any third party domains with the domain in the address bar. This prevents third party trackers from using directly + stored information to identify you across different websites, but may break websites where you login with a third party + account (such as a Facebook or Google login.) The value of this preference is of type boolean, + and the default value is false. + **/ + var firstPartyIsolate : webextension_polyfill.types.Setting; + /** + Allow users to specify the mode for tracking protection. This setting's value is of type TrackingProtectionModeOption, + defaulting to private_browsing_only. + **/ + var trackingProtectionMode : webextension_polyfill.types.Setting; + /** + Allow users to specify the default settings for allowing cookies, as well as whether all cookies should be created as + non-persistent cookies. This setting's value is of type CookieConfig. + **/ + var cookieConfig : webextension_polyfill.types.Setting; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/namespaces/privacy_websites/privacywebsites/TrackingProtectionModeOption.hx b/externs/webextension_polyfill/namespaces/privacy_websites/privacywebsites/TrackingProtectionModeOption.hx new file mode 100644 index 0000000..17aeef8 --- /dev/null +++ b/externs/webextension_polyfill/namespaces/privacy_websites/privacywebsites/TrackingProtectionModeOption.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.namespaces.privacy_websites.privacywebsites; + +/** + The mode for tracking protection. +**/ +typedef TrackingProtectionModeOption = webextension_polyfill.namespaces.privacy_network.privacynetwork.HTTPSOnlyModeOption; \ No newline at end of file diff --git a/externs/webextension_polyfill/networkstatus/NetworkLinkInfo.hx b/externs/webextension_polyfill/networkstatus/NetworkLinkInfo.hx new file mode 100644 index 0000000..df0c890 --- /dev/null +++ b/externs/webextension_polyfill/networkstatus/NetworkLinkInfo.hx @@ -0,0 +1,18 @@ +package webextension_polyfill.networkstatus; + +typedef NetworkLinkInfo = { + /** + Status of the network link, if "unknown" then link is usually assumed to be "up" + **/ + var status : NetworkLinkInfoStatusEnum; + /** + If known, the type of network connection that is avialable. + **/ + var type : NetworkLinkInfoTypeEnum; + /** + If known, the network id or name. + Optional. + **/ + @:optional + var id : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/networkstatus/NetworkLinkInfoStatusEnum.hx b/externs/webextension_polyfill/networkstatus/NetworkLinkInfoStatusEnum.hx new file mode 100644 index 0000000..684af2d --- /dev/null +++ b/externs/webextension_polyfill/networkstatus/NetworkLinkInfoStatusEnum.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.networkstatus; + +/** + Status of the network link, if "unknown" then link is usually assumed to be "up" +**/ +typedef NetworkLinkInfoStatusEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/networkstatus/NetworkLinkInfoTypeEnum.hx b/externs/webextension_polyfill/networkstatus/NetworkLinkInfoTypeEnum.hx new file mode 100644 index 0000000..e32c218 --- /dev/null +++ b/externs/webextension_polyfill/networkstatus/NetworkLinkInfoTypeEnum.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.networkstatus; + +/** + If known, the type of network connection that is avialable. +**/ +typedef NetworkLinkInfoTypeEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/networkstatus/Static.hx b/externs/webextension_polyfill/networkstatus/Static.hx new file mode 100644 index 0000000..99161ef --- /dev/null +++ b/externs/webextension_polyfill/networkstatus/Static.hx @@ -0,0 +1,12 @@ +package webextension_polyfill.networkstatus; + +typedef Static = { + /** + Returns the $(ref:NetworkLinkInfo} of the current network connection. + **/ + function getLinkInfo():Void; + /** + Fired when the network connection state changes. + **/ + var onConnectionChanged : webextension_polyfill.events.Event<(details:NetworkLinkInfo) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/normandyaddonstudy/Static.hx b/externs/webextension_polyfill/normandyaddonstudy/Static.hx new file mode 100644 index 0000000..9fc7e60 --- /dev/null +++ b/externs/webextension_polyfill/normandyaddonstudy/Static.hx @@ -0,0 +1,20 @@ +package webextension_polyfill.normandyaddonstudy; + +typedef Static = { + /** + Returns a study object for the current study. + **/ + function getStudy():Void; + /** + Marks the study as ended and then uninstalls the addon. + **/ + function endStudy(reason:String):Void; + /** + Returns an object with metadata about the client which may be required for constructing survey URLs. + **/ + function getClientMetadata():Void; + /** + Fired when a user unenrolls from a study but before the addon is uninstalled. + **/ + var onUnenroll : webextension_polyfill.events.Event<(reason:String) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/normandyaddonstudy/Study.hx b/externs/webextension_polyfill/normandyaddonstudy/Study.hx new file mode 100644 index 0000000..e6516f6 --- /dev/null +++ b/externs/webextension_polyfill/normandyaddonstudy/Study.hx @@ -0,0 +1,60 @@ +package webextension_polyfill.normandyaddonstudy; + +typedef Study = { + /** + The ID of the recipe for the study. + **/ + var recipeId : Float; + /** + A slug to identify the study. + **/ + var slug : String; + /** + The name presented on about:studies. + **/ + var userFacingName : String; + /** + The description presented on about:studies. + **/ + var userFacingDescription : String; + /** + The study branch in which the user is enrolled. + **/ + var branch : String; + /** + The state of the study. + **/ + var active : Bool; + /** + The ID of the extension installed by the study. + **/ + var addonId : String; + /** + The URL of the XPI that was downloaded and installed by the study. + **/ + var addonUrl : String; + /** + The version of the extension installed by the study. + **/ + var addonVersion : String; + /** + The start date for the study. + **/ + var studyStartDate : webextension_polyfill.extensiontypes.DateType; + /** + The end date for the study. + **/ + var studyEndDate : webextension_polyfill.extensiontypes.DateType; + /** + The record ID for the extension in Normandy server's database. + **/ + var extensionApiId : Float; + /** + A hash of the extension XPI file. + **/ + var extensionHash : String; + /** + The algorithm used to hash the extension XPI file. + **/ + var extensionHashAlgorithm : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/notifications/CreateNotificationOptions.hx b/externs/webextension_polyfill/notifications/CreateNotificationOptions.hx new file mode 100644 index 0000000..3185391 --- /dev/null +++ b/externs/webextension_polyfill/notifications/CreateNotificationOptions.hx @@ -0,0 +1,70 @@ +package webextension_polyfill.notifications; + +typedef CreateNotificationOptions = { + /** + Which type of notification to display. + **/ + var type : TemplateType; + /** + A URL to the sender's avatar, app icon, or a thumbnail for image notifications. + Optional. + **/ + @:optional + var iconUrl : String; + /** + A URL to the app icon mask. + Optional. + **/ + @:optional + var appIconMaskUrl : String; + /** + Title of the notification (e.g. sender name for email). + **/ + var title : String; + /** + Main notification content. + **/ + var message : String; + /** + Alternate notification content with a lower-weight font. + Optional. + **/ + @:optional + var contextMessage : String; + /** + Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default. + Optional. + **/ + @:optional + var priority : Float; + /** + A timestamp associated with the notification, in milliseconds past the epoch. + Optional. + **/ + @:optional + var eventTime : Float; + /** + A URL to the image thumbnail for image-type notifications. + Optional. + **/ + @:optional + var imageUrl : String; + /** + Items for multi-item notifications. + Optional. + **/ + @:optional + var items : Array; + /** + Current progress ranges from 0 to 100. + Optional. + **/ + @:optional + var progress : Float; + /** + Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification. + Optional. + **/ + @:optional + var isClickable : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/notifications/NotificationItem.hx b/externs/webextension_polyfill/notifications/NotificationItem.hx new file mode 100644 index 0000000..e0a476d --- /dev/null +++ b/externs/webextension_polyfill/notifications/NotificationItem.hx @@ -0,0 +1,12 @@ +package webextension_polyfill.notifications; + +typedef NotificationItem = { + /** + Title of one item of a list notification. + **/ + var title : String; + /** + Additional details about this item. + **/ + var message : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/notifications/PermissionLevel.hx b/externs/webextension_polyfill/notifications/PermissionLevel.hx new file mode 100644 index 0000000..e422a88 --- /dev/null +++ b/externs/webextension_polyfill/notifications/PermissionLevel.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.notifications; + +typedef PermissionLevel = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/notifications/Static.hx b/externs/webextension_polyfill/notifications/Static.hx new file mode 100644 index 0000000..69fdd09 --- /dev/null +++ b/externs/webextension_polyfill/notifications/Static.hx @@ -0,0 +1,35 @@ +package webextension_polyfill.notifications; + +typedef Static = { + /** + Creates and displays a notification. + + Creates and displays a notification. + **/ + @:overload(function(options:CreateNotificationOptions):js.lib.Promise { }) + function create(notificationId:Null, options:CreateNotificationOptions):js.lib.Promise; + /** + Clears an existing notification. + **/ + function clear(notificationId:String):js.lib.Promise; + /** + Retrieves all the notifications. + **/ + function getAll():js.lib.Promise>; + /** + Fired when the notification closed, either by the system or by user action. + **/ + var onClosed : webextension_polyfill.events.Event<(notificationId:String, byUser:Bool) -> Void>; + /** + Fired when the user clicked in a non-button area of the notification. + **/ + var onClicked : webextension_polyfill.events.Event<(notificationId:String) -> Void>; + /** + Fired when the user pressed a button in the notification. + **/ + var onButtonClicked : webextension_polyfill.events.Event<(notificationId:String, buttonIndex:Float) -> Void>; + /** + Fired when the notification is shown. + **/ + var onShown : webextension_polyfill.events.Event<(notificationId:String) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/notifications/TemplateType.hx b/externs/webextension_polyfill/notifications/TemplateType.hx new file mode 100644 index 0000000..a7f98cd --- /dev/null +++ b/externs/webextension_polyfill/notifications/TemplateType.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.notifications; + +typedef TemplateType = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/notifications/UpdateNotificationOptions.hx b/externs/webextension_polyfill/notifications/UpdateNotificationOptions.hx new file mode 100644 index 0000000..9e5dacf --- /dev/null +++ b/externs/webextension_polyfill/notifications/UpdateNotificationOptions.hx @@ -0,0 +1,76 @@ +package webextension_polyfill.notifications; + +typedef UpdateNotificationOptions = { + /** + Which type of notification to display. + Optional. + **/ + @:optional + var type : TemplateType; + /** + A URL to the sender's avatar, app icon, or a thumbnail for image notifications. + Optional. + **/ + @:optional + var iconUrl : String; + /** + A URL to the app icon mask. + Optional. + **/ + @:optional + var appIconMaskUrl : String; + /** + Title of the notification (e.g. sender name for email). + Optional. + **/ + @:optional + var title : String; + /** + Main notification content. + Optional. + **/ + @:optional + var message : String; + /** + Alternate notification content with a lower-weight font. + Optional. + **/ + @:optional + var contextMessage : String; + /** + Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default. + Optional. + **/ + @:optional + var priority : Float; + /** + A timestamp associated with the notification, in milliseconds past the epoch. + Optional. + **/ + @:optional + var eventTime : Float; + /** + A URL to the image thumbnail for image-type notifications. + Optional. + **/ + @:optional + var imageUrl : String; + /** + Items for multi-item notifications. + Optional. + **/ + @:optional + var items : Array; + /** + Current progress ranges from 0 to 100. + Optional. + **/ + @:optional + var progress : Float; + /** + Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification. + Optional. + **/ + @:optional + var isClickable : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/omnibox/DefaultSuggestResult.hx b/externs/webextension_polyfill/omnibox/DefaultSuggestResult.hx new file mode 100644 index 0000000..b68854f --- /dev/null +++ b/externs/webextension_polyfill/omnibox/DefaultSuggestResult.hx @@ -0,0 +1,11 @@ +package webextension_polyfill.omnibox; + +/** + A suggest result. +**/ +typedef DefaultSuggestResult = { + /** + The text that is displayed in the URL dropdown. + **/ + var description : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/omnibox/DescriptionStyleType.hx b/externs/webextension_polyfill/omnibox/DescriptionStyleType.hx new file mode 100644 index 0000000..08eaa70 --- /dev/null +++ b/externs/webextension_polyfill/omnibox/DescriptionStyleType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.omnibox; + +/** + The style type. +**/ +typedef DescriptionStyleType = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/omnibox/OnInputEnteredDisposition.hx b/externs/webextension_polyfill/omnibox/OnInputEnteredDisposition.hx new file mode 100644 index 0000000..d6e3474 --- /dev/null +++ b/externs/webextension_polyfill/omnibox/OnInputEnteredDisposition.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.omnibox; + +/** + The window disposition for the omnibox query. This is the recommended context to display results. For example, + if the omnibox command is to navigate to a certain URL, a disposition of 'newForegroundTab' means the navigation should + take place in a new selected tab. +**/ +typedef OnInputEnteredDisposition = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/omnibox/Static.hx b/externs/webextension_polyfill/omnibox/Static.hx new file mode 100644 index 0000000..2aa5adf --- /dev/null +++ b/externs/webextension_polyfill/omnibox/Static.hx @@ -0,0 +1,30 @@ +package webextension_polyfill.omnibox; + +typedef Static = { + /** + Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the + first suggestion row underneath the URL bar. + **/ + function setDefaultSuggestion(suggestion:DefaultSuggestResult):Void; + /** + User has started a keyword input session by typing the extension's keyword. This is guaranteed to be sent exactly once + per input session, and before any onInputChanged events. + **/ + var onInputStarted : webextension_polyfill.events.Event<() -> Void>; + /** + User has changed what is typed into the omnibox. + **/ + var onInputChanged : webextension_polyfill.events.Event<(text:String, suggest:(suggestResults:Array) -> Void) -> Void>; + /** + User has accepted what is typed into the omnibox. + **/ + var onInputEntered : webextension_polyfill.events.Event<(text:String, disposition:OnInputEnteredDisposition) -> Void>; + /** + User has ended the keyword input session without accepting the input. + **/ + var onInputCancelled : webextension_polyfill.events.Event<() -> Void>; + /** + User has deleted a suggested result. + **/ + var onDeleteSuggestion : webextension_polyfill.events.Event<(text:String) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/omnibox/SuggestResult.hx b/externs/webextension_polyfill/omnibox/SuggestResult.hx new file mode 100644 index 0000000..d4dcceb --- /dev/null +++ b/externs/webextension_polyfill/omnibox/SuggestResult.hx @@ -0,0 +1,24 @@ +package webextension_polyfill.omnibox; + +/** + A suggest result. +**/ +typedef SuggestResult = { + /** + The text that is put into the URL bar, and that is sent to the extension when the user chooses this entry. + **/ + var content : String; + /** + The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. + The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), + and 'dim' (for dim helper text). The styles can be nested, eg. dimmed match. + You must escape the five predefined entities to display them as text: stackoverflow.com/a/1091953/89484 + **/ + var description : String; + /** + Whether the suggest result can be deleted by the user. + Optional. + **/ + @:optional + var deletable : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/pageaction/GetPopupDetailsType.hx b/externs/webextension_polyfill/pageaction/GetPopupDetailsType.hx new file mode 100644 index 0000000..beeb4d7 --- /dev/null +++ b/externs/webextension_polyfill/pageaction/GetPopupDetailsType.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.pageaction; + +typedef GetPopupDetailsType = { + /** + Specify the tab to get the popup from. + **/ + var tabId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/pageaction/GetTitleDetailsType.hx b/externs/webextension_polyfill/pageaction/GetTitleDetailsType.hx new file mode 100644 index 0000000..13ba152 --- /dev/null +++ b/externs/webextension_polyfill/pageaction/GetTitleDetailsType.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.pageaction; + +typedef GetTitleDetailsType = { + /** + Specify the tab to get the title from. + **/ + var tabId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/pageaction/ImageDataType.hx b/externs/webextension_polyfill/pageaction/ImageDataType.hx new file mode 100644 index 0000000..b8eded2 --- /dev/null +++ b/externs/webextension_polyfill/pageaction/ImageDataType.hx @@ -0,0 +1,19 @@ +package webextension_polyfill.pageaction; + +/** + Pixel data for an image. Must be an ImageData object (for example, from a canvas element). +**/ +typedef ImageDataType = { + /** + Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255. + **/ + final data : js.lib.Uint8ClampedArray; + /** + Returns the actual dimensions of the data in the ImageData object, in pixels. + **/ + final height : Float; + /** + Returns the actual dimensions of the data in the ImageData object, in pixels. + **/ + final width : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/pageaction/IsShownDetailsType.hx b/externs/webextension_polyfill/pageaction/IsShownDetailsType.hx new file mode 100644 index 0000000..a64e11c --- /dev/null +++ b/externs/webextension_polyfill/pageaction/IsShownDetailsType.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.pageaction; + +typedef IsShownDetailsType = { + /** + Specify the tab to get the shownness from. + **/ + var tabId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/pageaction/OnClickData.hx b/externs/webextension_polyfill/pageaction/OnClickData.hx new file mode 100644 index 0000000..ac2c68b --- /dev/null +++ b/externs/webextension_polyfill/pageaction/OnClickData.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.pageaction; + +/** + Information sent when a page action is clicked. +**/ +typedef OnClickData = { + /** + An array of keyboard modifiers that were held while the menu item was clicked. + **/ + var modifiers : Array; + /** + An integer value of button by which menu item was clicked. + Optional. + **/ + @:optional + var button : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/pageaction/OnClickDataModifiersItemEnum.hx b/externs/webextension_polyfill/pageaction/OnClickDataModifiersItemEnum.hx new file mode 100644 index 0000000..72f01ba --- /dev/null +++ b/externs/webextension_polyfill/pageaction/OnClickDataModifiersItemEnum.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.pageaction; + +typedef OnClickDataModifiersItemEnum = webextension_polyfill.action.OnClickDataModifiersItemEnum; \ No newline at end of file diff --git a/externs/webextension_polyfill/pageaction/SetIconDetailsType.hx b/externs/webextension_polyfill/pageaction/SetIconDetailsType.hx new file mode 100644 index 0000000..4284e13 --- /dev/null +++ b/externs/webextension_polyfill/pageaction/SetIconDetailsType.hx @@ -0,0 +1,29 @@ +package webextension_polyfill.pageaction; + +typedef SetIconDetailsType = { + /** + The id of the tab for which you want to modify the page action. + **/ + var tabId : Float; + /** + Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. + If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. + If the number of image pixels that fit into one screen space unit equals scale, then image with size + scale * 19 will be selected. Initially only scales 1 and 2 will be supported. + At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details. + imageData = {'19': foo}' + Optional. + **/ + @:optional + var imageData : ts.AnyOf2>; + /** + Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. + If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. + If the number of image pixels that fit into one screen space unit equals scale, then image with size + scale * 19 will be selected. Initially only scales 1 and 2 will be supported. + At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}' + Optional. + **/ + @:optional + var path : ts.AnyOf2>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/pageaction/SetPopupDetailsType.hx b/externs/webextension_polyfill/pageaction/SetPopupDetailsType.hx new file mode 100644 index 0000000..464732e --- /dev/null +++ b/externs/webextension_polyfill/pageaction/SetPopupDetailsType.hx @@ -0,0 +1,12 @@ +package webextension_polyfill.pageaction; + +typedef SetPopupDetailsType = { + /** + The id of the tab for which you want to modify the page action. + **/ + var tabId : Float; + /** + The html file to show in a popup. If set to the empty string (''), no popup is shown. + **/ + var popup : Null; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/pageaction/SetTitleDetailsType.hx b/externs/webextension_polyfill/pageaction/SetTitleDetailsType.hx new file mode 100644 index 0000000..1b9f499 --- /dev/null +++ b/externs/webextension_polyfill/pageaction/SetTitleDetailsType.hx @@ -0,0 +1,12 @@ +package webextension_polyfill.pageaction; + +typedef SetTitleDetailsType = { + /** + The id of the tab for which you want to modify the page action. + **/ + var tabId : Float; + /** + The tooltip string. + **/ + var title : Null; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/pageaction/Static.hx b/externs/webextension_polyfill/pageaction/Static.hx new file mode 100644 index 0000000..c474985 --- /dev/null +++ b/externs/webextension_polyfill/pageaction/Static.hx @@ -0,0 +1,46 @@ +package webextension_polyfill.pageaction; + +typedef Static = { + /** + Shows the page action. The page action is shown whenever the tab is selected. + **/ + function show(tabId:Float):js.lib.Promise; + /** + Hides the page action. + **/ + function hide(tabId:Float):js.lib.Promise; + /** + Checks whether the page action is shown. + **/ + function isShown(details:IsShownDetailsType):js.lib.Promise; + /** + Sets the title of the page action. This is displayed in a tooltip over the page action. + **/ + function setTitle(details:SetTitleDetailsType):Void; + /** + Gets the title of the page action. + **/ + function getTitle(details:GetTitleDetailsType):js.lib.Promise; + /** + Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data + from a canvas element, or as dictionary of either one of those. Either the path or the imageData + property must be specified. + **/ + function setIcon(details:SetIconDetailsType):js.lib.Promise; + /** + Sets the html document to be opened as a popup when the user clicks on the page action's icon. + **/ + function setPopup(details:SetPopupDetailsType):js.lib.Promise; + /** + Gets the html document set as the popup for this page action. + **/ + function getPopup(details:GetPopupDetailsType):js.lib.Promise; + /** + Opens the extension page action in the active window. + **/ + function openPopup():js.lib.Promise; + /** + Fired when a page action icon is clicked. This event will not fire if the page action has a popup. + **/ + var onClicked : webextension_polyfill.events.Event<(tab:webextension_polyfill.tabs.Tab, info:Null) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/permissions/AnyPermissions.hx b/externs/webextension_polyfill/permissions/AnyPermissions.hx new file mode 100644 index 0000000..ea8df64 --- /dev/null +++ b/externs/webextension_polyfill/permissions/AnyPermissions.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.permissions; + +typedef AnyPermissions = { + /** + Optional. + **/ + @:optional + var permissions : Array; + /** + Optional. + **/ + @:optional + var origins : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/permissions/Permissions.hx b/externs/webextension_polyfill/permissions/Permissions.hx new file mode 100644 index 0000000..d5dabcf --- /dev/null +++ b/externs/webextension_polyfill/permissions/Permissions.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.permissions; + +typedef Permissions = { + /** + Optional. + **/ + @:optional + var permissions : Array; + /** + Optional. + **/ + @:optional + var origins : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/permissions/Static.hx b/externs/webextension_polyfill/permissions/Static.hx new file mode 100644 index 0000000..c47b56e --- /dev/null +++ b/externs/webextension_polyfill/permissions/Static.hx @@ -0,0 +1,28 @@ +package webextension_polyfill.permissions; + +typedef Static = { + /** + Get a list of all the extension's permissions. + **/ + function getAll():js.lib.Promise; + /** + Check if the extension has the given permissions. + **/ + function contains(permissions:AnyPermissions):js.lib.Promise; + /** + Request the given permissions. + **/ + function request(permissions:Permissions):js.lib.Promise; + /** + Relinquish the given permissions. + **/ + function remove(permissions:Permissions):js.lib.Promise; + /** + Fired when the extension acquires new permissions. + **/ + var onAdded : webextension_polyfill.events.Event<(permissions:Permissions) -> Void>; + /** + Fired when permissions are removed from the extension. + **/ + var onRemoved : webextension_polyfill.events.Event<(permissions:Permissions) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/pkcs11/ModuleSlot.hx b/externs/webextension_polyfill/pkcs11/ModuleSlot.hx new file mode 100644 index 0000000..0474e9e --- /dev/null +++ b/externs/webextension_polyfill/pkcs11/ModuleSlot.hx @@ -0,0 +1,12 @@ +package webextension_polyfill.pkcs11; + +typedef ModuleSlot = { + /** + The name of the slot. + **/ + var name : String; + /** + The token of the slot. + **/ + var token : Null; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/pkcs11/Static.hx b/externs/webextension_polyfill/pkcs11/Static.hx new file mode 100644 index 0000000..96ec85d --- /dev/null +++ b/externs/webextension_polyfill/pkcs11/Static.hx @@ -0,0 +1,20 @@ +package webextension_polyfill.pkcs11; + +typedef Static = { + /** + checks whether a PKCS#11 module, given by name, is installed + **/ + function isModuleInstalled(name:String):js.lib.Promise; + /** + Install a PKCS#11 module with a given name + **/ + function installModule(name:String, ?flags:Float):js.lib.Promise; + /** + Remove an installed PKCS#11 module from firefox + **/ + function uninstallModule(name:String):js.lib.Promise; + /** + Enumerate a module's slots, each with their name and whether a token is present + **/ + function getModuleSlots(name:String):js.lib.Promise>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/pkcs11/Token.hx b/externs/webextension_polyfill/pkcs11/Token.hx new file mode 100644 index 0000000..5c3e948 --- /dev/null +++ b/externs/webextension_polyfill/pkcs11/Token.hx @@ -0,0 +1,28 @@ +package webextension_polyfill.pkcs11; + +typedef Token = { + /** + Name of the token. + **/ + var name : String; + /** + Name of the token's manufacturer. + **/ + var manufacturer : String; + /** + Hardware version, as a PKCS #11 version number (two 32-bit integers separated with a dot, like "1.0". + **/ + var HWVersion : String; + /** + Firmware version, as a PKCS #11 version number (two 32-bit integers separated with a dot, like "1.0". + **/ + var FWVersion : String; + /** + Serial number, whose format is defined by the token specification. + **/ + var serial : String; + /** + true if the token is logged on already, false otherwise. + **/ + var isLoggedIn : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/privacy/Static.hx b/externs/webextension_polyfill/privacy/Static.hx new file mode 100644 index 0000000..ab60e10 --- /dev/null +++ b/externs/webextension_polyfill/privacy/Static.hx @@ -0,0 +1,7 @@ +package webextension_polyfill.privacy; + +typedef Static = { + var network : webextension_polyfill.namespaces.privacy_network.privacynetwork.Static; + var services : webextension_polyfill.namespaces.privacy_services.privacyservices.Static; + var websites : webextension_polyfill.namespaces.privacy_websites.privacywebsites.Static; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/proxy/OnErrorErrorType.hx b/externs/webextension_polyfill/proxy/OnErrorErrorType.hx new file mode 100644 index 0000000..c335f54 --- /dev/null +++ b/externs/webextension_polyfill/proxy/OnErrorErrorType.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.proxy; + +typedef OnErrorErrorType = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/proxy/OnRequestDetailsType.hx b/externs/webextension_polyfill/proxy/OnRequestDetailsType.hx new file mode 100644 index 0000000..5fc3512 --- /dev/null +++ b/externs/webextension_polyfill/proxy/OnRequestDetailsType.hx @@ -0,0 +1,79 @@ +package webextension_polyfill.proxy; + +typedef OnRequestDetailsType = { + /** + The ID of the request. Request IDs are unique within a browser session. As a result, + they could be used to relate different events of the same request. + **/ + var requestId : String; + var url : String; + /** + Standard HTTP method. + **/ + var method : String; + /** + The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in + which the request happens. If the document of a (sub-)frame is loaded (type is main_frame + or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. + Frame IDs are unique within a tab. + **/ + var frameId : Float; + /** + ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. + **/ + var parentFrameId : Float; + /** + True for private browsing requests. + Optional. + **/ + @:optional + var incognito : Bool; + /** + The cookie store ID of the contextual identity. + Optional. + **/ + @:optional + var cookieStoreId : String; + /** + URL of the resource that triggered this request. + Optional. + **/ + @:optional + var originUrl : String; + /** + URL of the page into which the requested resource will be loaded. + Optional. + **/ + @:optional + var documentUrl : String; + /** + The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. + **/ + var tabId : Float; + /** + How the requested resource will be used. + **/ + var type : webextension_polyfill.declarativenetrequest.ResourceType; + /** + The time when this signal is triggered, in milliseconds since the epoch. + **/ + var timeStamp : Float; + /** + Indicates if this response was fetched from disk cache. + **/ + var fromCache : Bool; + /** + The HTTP request headers that are going to be sent out with this request. + Optional. + **/ + @:optional + var requestHeaders : webextension_polyfill.webrequest.HttpHeaders; + /** + Url classification if the request has been classified. + **/ + var urlClassification : webextension_polyfill.webrequest.UrlClassification; + /** + Indicates if this request and its content window hierarchy is third party. + **/ + var thirdParty : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/proxy/OnRequestEvent.hx b/externs/webextension_polyfill/proxy/OnRequestEvent.hx new file mode 100644 index 0000000..3589270 --- /dev/null +++ b/externs/webextension_polyfill/proxy/OnRequestEvent.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.proxy; + +/** + Fired when proxy data is needed for a request. +**/ +typedef OnRequestEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnRequestDetailsType) -> Void, filter:webextension_polyfill.webrequest.RequestFilter, ?extraInfoSpec:Array):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnRequestDetailsType) -> Void):Void; + function hasListener(callback:(details:OnRequestDetailsType) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/proxy/ProxyConfig.hx b/externs/webextension_polyfill/proxy/ProxyConfig.hx new file mode 100644 index 0000000..c6d9be8 --- /dev/null +++ b/externs/webextension_polyfill/proxy/ProxyConfig.hx @@ -0,0 +1,75 @@ +package webextension_polyfill.proxy; + +/** + An object which describes proxy settings. +**/ +typedef ProxyConfig = { + /** + The type of proxy to use. + Optional. + **/ + @:optional + var proxyType : ProxyConfigProxyTypeEnum; + /** + The address of the http proxy, can include a port. + Optional. + **/ + @:optional + var http : String; + /** + Use the http proxy server for all protocols. + Optional. + **/ + @:optional + var httpProxyAll : Bool; + /** + The address of the ssl proxy, can include a port. + Optional. + **/ + @:optional + var ssl : String; + /** + The address of the socks proxy, can include a port. + Optional. + **/ + @:optional + var socks : String; + /** + The version of the socks proxy. + Optional. + **/ + @:optional + var socksVersion : Float; + /** + A list of hosts which should not be proxied. + Optional. + **/ + @:optional + var passthrough : String; + /** + A URL to use to configure the proxy. + Optional. + **/ + @:optional + var autoConfigUrl : String; + /** + Do not prompt for authentication if password is saved. + Optional. + **/ + @:optional + var autoLogin : Bool; + /** + Proxy DNS when using SOCKS v5. + Optional. + **/ + @:optional + var proxyDNS : Bool; + /** + If true (the default value), do not use newer TLS protocol features that might have interoperability problems on the + Internet. This is intended only for use with critical infrastructure like the updates, + and is only available to privileged addons. + Optional. + **/ + @:optional + var respectBeConservative : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/proxy/ProxyConfigProxyTypeEnum.hx b/externs/webextension_polyfill/proxy/ProxyConfigProxyTypeEnum.hx new file mode 100644 index 0000000..6a91164 --- /dev/null +++ b/externs/webextension_polyfill/proxy/ProxyConfigProxyTypeEnum.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.proxy; + +/** + The type of proxy to use. +**/ +typedef ProxyConfigProxyTypeEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/proxy/Static.hx b/externs/webextension_polyfill/proxy/Static.hx new file mode 100644 index 0000000..443dbe9 --- /dev/null +++ b/externs/webextension_polyfill/proxy/Static.hx @@ -0,0 +1,16 @@ +package webextension_polyfill.proxy; + +typedef Static = { + /** + Fired when proxy data is needed for a request. + **/ + var onRequest : OnRequestEvent; + /** + Notifies about errors caused by the invalid use of the proxy API. + **/ + var onError : webextension_polyfill.events.Event<(error:OnErrorErrorType) -> Void>; + /** + Configures proxy settings. This setting's value is an object of type ProxyConfig. + **/ + var settings : webextension_polyfill.types.Setting; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/runtime/BrowserInfo.hx b/externs/webextension_polyfill/runtime/BrowserInfo.hx new file mode 100644 index 0000000..95c319f --- /dev/null +++ b/externs/webextension_polyfill/runtime/BrowserInfo.hx @@ -0,0 +1,23 @@ +package webextension_polyfill.runtime; + +/** + An object containing information about the current browser. +**/ +typedef BrowserInfo = { + /** + The name of the browser, for example 'Firefox'. + **/ + var name : String; + /** + The name of the browser vendor, for example 'Mozilla'. + **/ + var vendor : String; + /** + The browser's version, for example '42.0.0' or '0.8.1pre'. + **/ + var version : String; + /** + The browser's build ID/date, for example '20160101'. + **/ + var buildID : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/runtime/ConnectConnectInfoType.hx b/externs/webextension_polyfill/runtime/ConnectConnectInfoType.hx new file mode 100644 index 0000000..78f5ab4 --- /dev/null +++ b/externs/webextension_polyfill/runtime/ConnectConnectInfoType.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.runtime; + +typedef ConnectConnectInfoType = { + /** + Will be passed into onConnect for processes that are listening for the connection event. + Optional. + **/ + @:optional + var name : String; + /** + Whether the TLS channel ID will be passed into onConnectExternal for processes that are listening for the connection + event. + Optional. + **/ + @:optional + var includeTlsChannelId : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/runtime/MessageSender.hx b/externs/webextension_polyfill/runtime/MessageSender.hx new file mode 100644 index 0000000..bedea73 --- /dev/null +++ b/externs/webextension_polyfill/runtime/MessageSender.hx @@ -0,0 +1,35 @@ +package webextension_polyfill.runtime; + +/** + An object containing information about the script context that sent a message or request. +**/ +typedef MessageSender = { + /** + 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. + Optional. + **/ + @:optional + var tab : webextension_polyfill.tabs.Tab; + /** + 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. + Optional. + **/ + @:optional + var frameId : Float; + /** + The ID of the extension or app that opened the connection, if any. + Optional. + **/ + @:optional + var id : String; + /** + 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. + Optional. + **/ + @:optional + var url : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/runtime/OnInstalledDetailsType.hx b/externs/webextension_polyfill/runtime/OnInstalledDetailsType.hx new file mode 100644 index 0000000..98cc555 --- /dev/null +++ b/externs/webextension_polyfill/runtime/OnInstalledDetailsType.hx @@ -0,0 +1,19 @@ +package webextension_polyfill.runtime; + +typedef OnInstalledDetailsType = { + /** + The reason that this event is being dispatched. + **/ + var reason : OnInstalledReason; + /** + Indicates the previous version of the extension, which has just been updated. This is present only if 'reason' is + 'update'. + Optional. + **/ + @:optional + var previousVersion : String; + /** + Indicates whether the addon is installed as a temporary extension. + **/ + var temporary : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/runtime/OnInstalledReason.hx b/externs/webextension_polyfill/runtime/OnInstalledReason.hx new file mode 100644 index 0000000..e652e43 --- /dev/null +++ b/externs/webextension_polyfill/runtime/OnInstalledReason.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.runtime; + +/** + The reason that this event is being dispatched. +**/ +typedef OnInstalledReason = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/runtime/OnRestartRequiredReason.hx b/externs/webextension_polyfill/runtime/OnRestartRequiredReason.hx new file mode 100644 index 0000000..b376dc6 --- /dev/null +++ b/externs/webextension_polyfill/runtime/OnRestartRequiredReason.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.runtime; + +/** + The reason that the event is being dispatched. 'app_update' is used when the restart is needed because the application + is updated to a newer version. 'os_update' is used when the restart is needed because the browser/OS is updated to a + newer version. 'periodic' is used when the system runs for more than the permitted uptime set in the enterprise policy. +**/ +typedef OnRestartRequiredReason = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/runtime/OnUpdateAvailableDetailsType.hx b/externs/webextension_polyfill/runtime/OnUpdateAvailableDetailsType.hx new file mode 100644 index 0000000..38d5f6b --- /dev/null +++ b/externs/webextension_polyfill/runtime/OnUpdateAvailableDetailsType.hx @@ -0,0 +1,11 @@ +package webextension_polyfill.runtime; + +/** + The manifest details of the available update. +**/ +typedef OnUpdateAvailableDetailsType = { + /** + The version number of the available update. + **/ + var version : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/runtime/PlatformArch.hx b/externs/webextension_polyfill/runtime/PlatformArch.hx new file mode 100644 index 0000000..cc8a165 --- /dev/null +++ b/externs/webextension_polyfill/runtime/PlatformArch.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.runtime; + +/** + The machine's processor architecture. +**/ +typedef PlatformArch = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/runtime/PlatformInfo.hx b/externs/webextension_polyfill/runtime/PlatformInfo.hx new file mode 100644 index 0000000..97bfa83 --- /dev/null +++ b/externs/webextension_polyfill/runtime/PlatformInfo.hx @@ -0,0 +1,15 @@ +package webextension_polyfill.runtime; + +/** + An object containing information about the current platform. +**/ +typedef PlatformInfo = { + /** + The operating system the browser is running on. + **/ + var os : PlatformOs; + /** + The machine's processor architecture. + **/ + var arch : PlatformArch; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/runtime/PlatformOs.hx b/externs/webextension_polyfill/runtime/PlatformOs.hx new file mode 100644 index 0000000..a773c95 --- /dev/null +++ b/externs/webextension_polyfill/runtime/PlatformOs.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.runtime; + +/** + The operating system the browser is running on. +**/ +typedef PlatformOs = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/runtime/Port.hx b/externs/webextension_polyfill/runtime/Port.hx new file mode 100644 index 0000000..6731e1f --- /dev/null +++ b/externs/webextension_polyfill/runtime/Port.hx @@ -0,0 +1,30 @@ +package webextension_polyfill.runtime; + +/** + An object which allows two way communication with other pages. +**/ +typedef Port = { + var name : String; + function disconnect():Void; + var onDisconnect : webextension_polyfill.events.Event<(port:Port) -> Void>; + var onMessage : webextension_polyfill.events.Event<(message:Dynamic, port:Port) -> Void>; + /** + Send a message to the other end. This takes one argument, which is a JSON object representing the message to send. + It will be delivered to any script listening to the port's onMessage event, or to the native application if this port + is connected to a native application. + **/ + function postMessage(message:Dynamic):Void; + /** + This property will only be present on ports passed to onConnect/onConnectExternal listeners. + Optional. + **/ + @:optional + var sender : MessageSender; + /** + If the port was disconnected due to an error, this will be set to an object with a string property message, + giving you more information about the error. See onDisconnect. + Optional. + **/ + @:optional + var error : PortErrorType; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/runtime/PortErrorType.hx b/externs/webextension_polyfill/runtime/PortErrorType.hx new file mode 100644 index 0000000..0ba2e79 --- /dev/null +++ b/externs/webextension_polyfill/runtime/PortErrorType.hx @@ -0,0 +1,9 @@ +package webextension_polyfill.runtime; + +/** + If the port was disconnected due to an error, this will be set to an object with a string property message, + giving you more information about the error. See onDisconnect. +**/ +typedef PortErrorType = { + var message : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/runtime/PropertyLastErrorType.hx b/externs/webextension_polyfill/runtime/PropertyLastErrorType.hx new file mode 100644 index 0000000..5898d0a --- /dev/null +++ b/externs/webextension_polyfill/runtime/PropertyLastErrorType.hx @@ -0,0 +1,13 @@ +package webextension_polyfill.runtime; + +/** + This will be defined during an API method callback if there was an error +**/ +typedef PropertyLastErrorType = { + /** + Details about the error which occurred. + Optional. + **/ + @:optional + var message : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/runtime/RequestUpdateCheckCallbackDetailsType.hx b/externs/webextension_polyfill/runtime/RequestUpdateCheckCallbackDetailsType.hx new file mode 100644 index 0000000..e937510 --- /dev/null +++ b/externs/webextension_polyfill/runtime/RequestUpdateCheckCallbackDetailsType.hx @@ -0,0 +1,11 @@ +package webextension_polyfill.runtime; + +/** + If an update is available, this contains more information about the available update. +**/ +typedef RequestUpdateCheckCallbackDetailsType = { + /** + The version of the available update. + **/ + var version : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/runtime/RequestUpdateCheckStatus.hx b/externs/webextension_polyfill/runtime/RequestUpdateCheckStatus.hx new file mode 100644 index 0000000..34929f3 --- /dev/null +++ b/externs/webextension_polyfill/runtime/RequestUpdateCheckStatus.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.runtime; + +/** + Result of the update check. +**/ +typedef RequestUpdateCheckStatus = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/runtime/SendMessageOptionsType.hx b/externs/webextension_polyfill/runtime/SendMessageOptionsType.hx new file mode 100644 index 0000000..c072a46 --- /dev/null +++ b/externs/webextension_polyfill/runtime/SendMessageOptionsType.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.runtime; + +typedef SendMessageOptionsType = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/runtime/Static.hx b/externs/webextension_polyfill/runtime/Static.hx new file mode 100644 index 0000000..c527702 --- /dev/null +++ b/externs/webextension_polyfill/runtime/Static.hx @@ -0,0 +1,144 @@ +package webextension_polyfill.runtime; + +typedef Static = { + /** + 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. + **/ + function getBackgroundPage():js.lib.Promise; + /** +

Open your Extension's options page, if possible.

The precise behavior may depend on your manifest's + $(topic:optionsV2)[options_ui] or $(topic:options)[options_page] key, + or what the browser happens to support at the time.

If your Extension does not declare an options page, + or the browser failed to create one for some other reason, the callback will set $(ref:lastError).

+ **/ + function openOptionsPage():js.lib.Promise; + /** + Returns details about the app or extension from the manifest. The object returned is a serialization of the full + $(topic:manifest)[manifest file]. + **/ + function getManifest():webextension_polyfill.manifest.WebExtensionManifest; + /** + Converts a relative path within an app/extension install directory to a fully-qualified URL. + **/ + function getURL(path:String):String; + /** + Get the frameId of any window global or frame element. + **/ + function getFrameId(target:Dynamic):Float; + /** + Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, + and implement surveys. Maximum 1023 characters. + **/ + function setUninstallURL(?url:String):js.lib.Promise; + /** + Reloads the app or extension. + **/ + function reload():Void; + /** + Requests an update check for this app/extension. + **/ + function requestUpdateCheck():js.lib.Promise>; + /** + Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. + This is useful for content scripts connecting to their extension processes, inter-app/extension communication, + and $(topic:manifest/externally_connectable)[web messaging]. Note that this does not connect to any listeners in a + content script. Extensions may connect to content scripts embedded in tabs via $(ref:tabs.connect). + + Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. + This is useful for content scripts connecting to their extension processes, inter-app/extension communication, + and $(topic:manifest/externally_connectable)[web messaging]. Note that this does not connect to any listeners in a + content script. Extensions may connect to content scripts embedded in tabs via $(ref:tabs.connect). + **/ + @:overload(function(?connectInfo:ConnectConnectInfoType):Port { }) + function connect(?extensionId:String, ?connectInfo:ConnectConnectInfoType):Port; + /** + Connects to a native application in the host machine. + **/ + function connectNative(application:String):Port; + /** + Sends a single message to event listeners within your extension/app or a different extension/app. + Similar to $(ref:runtime.connect) but only sends a single message, with an optional response. + If sending to your extension, the $(ref:runtime.onMessage) event will be fired in each page, or $(ref:runtime. + onMessageExternal), if a different extension. Note that extensions cannot send messages to content scripts using this + method. To send messages to content scripts, use $(ref:tabs.sendMessage). + + Sends a single message to event listeners within your extension/app or a different extension/app. + Similar to $(ref:runtime.connect) but only sends a single message, with an optional response. + If sending to your extension, the $(ref:runtime.onMessage) event will be fired in each page, or $(ref:runtime. + onMessageExternal), if a different extension. Note that extensions cannot send messages to content scripts using this + method. To send messages to content scripts, use $(ref:tabs.sendMessage). + **/ + @:overload(function(message:Dynamic, ?options:SendMessageOptionsType):js.lib.Promise { }) + function sendMessage(extensionId:Null, message:Dynamic, ?options:SendMessageOptionsType):js.lib.Promise; + /** + Send a single message to a native application. + **/ + function sendNativeMessage(application:String, message:Dynamic):js.lib.Promise; + /** + Returns information about the current browser. + **/ + function getBrowserInfo():js.lib.Promise; + /** + Returns information about the current platform. + **/ + function getPlatformInfo():js.lib.Promise; + /** + Fired when a profile that has this extension installed first starts up. This event is not fired for incognito profiles. + **/ + var onStartup : webextension_polyfill.events.Event<() -> Void>; + /** + Fired when the extension is first installed, when the extension is updated to a new version, + and when the browser is updated to a new version. + **/ + var onInstalled : webextension_polyfill.events.Event<(details:OnInstalledDetailsType) -> Void>; + /** + Sent to the event page just before it is unloaded. This gives the extension opportunity to do some clean up. + Note that since the page is unloading, any asynchronous operations started while handling this event are not guaranteed + to complete. If more activity for the event page occurs before it gets unloaded the onSuspendCanceled event will be sent + and the page won't be unloaded. + **/ + var onSuspend : webextension_polyfill.events.Event<() -> Void>; + /** + Sent after onSuspend to indicate that the app won't be unloaded after all. + **/ + var onSuspendCanceled : webextension_polyfill.events.Event<() -> Void>; + /** + Fired when an update is available, but isn't installed immediately because the app is currently running. + If you do nothing, the update will be installed the next time the background page gets unloaded, + if you want it to be installed sooner you can explicitly call $(ref:runtime.reload). + If your extension is using a persistent background page, the background page of course never gets unloaded, + so unless you call $(ref:runtime.reload) manually in response to this event the update will not get installed until the + next time the browser itself restarts. If no handlers are listening for this event, + and your extension has a persistent background page, it behaves as if $(ref:runtime.reload) + is called in response to this event. + **/ + var onUpdateAvailable : webextension_polyfill.events.Event<(details:OnUpdateAvailableDetailsType) -> Void>; + /** + Fired when a connection is made from either an extension process or a content script. + **/ + var onConnect : webextension_polyfill.events.Event<(port:Port) -> Void>; + /** + Fired when a connection is made from another extension. + **/ + var onConnectExternal : webextension_polyfill.events.Event<(port:Port) -> Void>; + /** + Fired when a message is sent from either an extension process or a content script. + **/ + var onMessage : webextension_polyfill.events.Event<(message:Dynamic, sender:MessageSender, sendResponse:() -> Void) -> ts.AnyOf3>>; + /** + Fired when a message is sent from another extension/app. Cannot be used in a content script. + **/ + var onMessageExternal : webextension_polyfill.events.Event<(message:Dynamic, sender:MessageSender, sendResponse:() -> Void) -> ts.AnyOf3>>; + /** + This will be defined during an API method callback if there was an error + Optional. + **/ + @:optional + var lastError : PropertyLastErrorType; + /** + The ID of the extension/app. + **/ + var id : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/scripting/CSSInjection.hx b/externs/webextension_polyfill/scripting/CSSInjection.hx new file mode 100644 index 0000000..1c2ab78 --- /dev/null +++ b/externs/webextension_polyfill/scripting/CSSInjection.hx @@ -0,0 +1,42 @@ +package webextension_polyfill.scripting; + +/** + Details of the css to insert. +**/ +typedef CSSInjection = { + /** + A string containing the CSS to inject. Exactly one of files and css must be specified. + Optional. + + A string containing the CSS to inject. Exactly one of files and css must be specified. + Optional. + **/ + @:optional + var css : String; + /** + The path of the CSS files to inject, relative to the extension's root directory. Exactly one of files + and css must be specified. + Optional. + + The path of the CSS files to inject, relative to the extension's root directory. NOTE: Currently a maximum of one file + is supported. Exactly one of files and css must be specified. + Optional. + **/ + @:optional + var files : Array; + /** + The style origin for the injection. Defaults to 'AUTHOR'. + Optional. + + The style origin for the injection. Defaults to 'AUTHOR'. + Optional. + **/ + @:optional + var origin : CSSInjectionOriginEnum; + /** + Details specifying the target into which to inject the CSS. + + Details specifying the target into which to insert the CSS. + **/ + var target : InjectionTarget; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/scripting/CSSInjectionOriginEnum.hx b/externs/webextension_polyfill/scripting/CSSInjectionOriginEnum.hx new file mode 100644 index 0000000..01ba604 --- /dev/null +++ b/externs/webextension_polyfill/scripting/CSSInjectionOriginEnum.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.scripting; + +/** + The style origin for the injection. Defaults to 'AUTHOR'. +**/ +typedef CSSInjectionOriginEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/scripting/ContentScriptFilter.hx b/externs/webextension_polyfill/scripting/ContentScriptFilter.hx new file mode 100644 index 0000000..140e2db --- /dev/null +++ b/externs/webextension_polyfill/scripting/ContentScriptFilter.hx @@ -0,0 +1,11 @@ +package webextension_polyfill.scripting; + +typedef ContentScriptFilter = { + /** + The IDs of specific scripts to retrieve with getRegisteredContentScripts() or to unregister with + unregisterContentScripts(). + Optional. + **/ + @:optional + var ids : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/scripting/ExecutionWorld.hx b/externs/webextension_polyfill/scripting/ExecutionWorld.hx new file mode 100644 index 0000000..f8c6849 --- /dev/null +++ b/externs/webextension_polyfill/scripting/ExecutionWorld.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.scripting; + +/** + The JavaScript world for a script to execute within. We currently only support the 'ISOLATED' world. +**/ +typedef ExecutionWorld = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/scripting/InjectionResult.hx b/externs/webextension_polyfill/scripting/InjectionResult.hx new file mode 100644 index 0000000..7c8e290 --- /dev/null +++ b/externs/webextension_polyfill/scripting/InjectionResult.hx @@ -0,0 +1,32 @@ +package webextension_polyfill.scripting; + +/** + Result of a script injection. +**/ +typedef InjectionResult = { + /** + The frame ID associated with the injection. + **/ + var frameId : Float; + /** + The result of the script execution. + Optional. + **/ + @:optional + var result : Dynamic; + /** + The error property is set when the script execution failed. The value is typically an (Error) + object with a message property, but could be any value (including primitives and undefined) + if the script threw or rejected with such a value. + Optional. + **/ + @:optional + var error : Dynamic; + /** + Whether the script should inject into all frames within the tab. Defaults to false. + This must not be true if frameIds is specified. + Optional. + **/ + @:optional + var allFrames : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/scripting/InjectionTarget.hx b/externs/webextension_polyfill/scripting/InjectionTarget.hx new file mode 100644 index 0000000..443ebb0 --- /dev/null +++ b/externs/webextension_polyfill/scripting/InjectionTarget.hx @@ -0,0 +1,24 @@ +package webextension_polyfill.scripting; + +/** + Details of the script to insert. +**/ +typedef InjectionTarget = { + /** + The IDs of specific frames to inject into. + Optional. + **/ + @:optional + var frameIds : Array; + /** + Whether the script should inject into all frames within the tab. Defaults to false. + This must not be true if frameIds is specified. + Optional. + **/ + @:optional + var allFrames : Bool; + /** + The ID of the tab into which to inject. + **/ + var tabId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/scripting/RegisteredContentScript.hx b/externs/webextension_polyfill/scripting/RegisteredContentScript.hx new file mode 100644 index 0000000..4185bde --- /dev/null +++ b/externs/webextension_polyfill/scripting/RegisteredContentScript.hx @@ -0,0 +1,55 @@ +package webextension_polyfill.scripting; + +typedef RegisteredContentScript = { + /** + If specified true, it will inject into all frames, even if the frame is not the top-most frame in the tab. + Each frame is checked independently for URL requirements; it will not inject into child frames if the URL requirements + are not met. Defaults to false, meaning that only the top frame is matched. + Optional. + **/ + @:optional + var allFrames : Bool; + /** + Excludes pages that this content script would otherwise be injected into. + Optional. + **/ + @:optional + var excludeMatches : Array; + /** + The id of the content script, specified in the API call. + **/ + var id : String; + /** + The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this + array. + Optional. + **/ + @:optional + var js : Array; + /** + Specifies which pages this content script will be injected into. Must be specified for registerContentScripts() + . + Optional. + **/ + @:optional + var matches : Array; + /** + Specifies when JavaScript files are injected into the web page. The preferred and default value is + document_idle. + Optional. + **/ + @:optional + var runAt : webextension_polyfill.extensiontypes.RunAt; + /** + Specifies if this content script will persist into future sessions. This is currently NOT supported. + Optional. + **/ + @:optional + var persistAcrossSessions : Bool; + /** + The list of CSS files to be injected into matching pages. These are injected in the order they appear in this array. + Optional. + **/ + @:optional + var css : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/scripting/ScriptInjection.hx b/externs/webextension_polyfill/scripting/ScriptInjection.hx new file mode 100644 index 0000000..e7f5916 --- /dev/null +++ b/externs/webextension_polyfill/scripting/ScriptInjection.hx @@ -0,0 +1,43 @@ +package webextension_polyfill.scripting; + +/** + Details of a script injection +**/ +typedef ScriptInjection = { + /** + The arguments to curry into a provided function. This is only valid if the func parameter is specified. + These arguments must be JSON-serializable. + Optional. + **/ + @:optional + var args : Array; + /** + The path of the JS files to inject, relative to the extension's root directory. Exactly one of files + and func must be specified. + Optional. + **/ + @:optional + var files : Array; + /** + A JavaScript function to inject. This function will be serialized, and then deserialized for injection. + This means that any bound parameters and execution context will be lost. Exactly one of files and + func must be specified. + **/ + @:optional + function func(args:haxe.extern.Rest):Dynamic; + /** + Details specifying the target into which to inject the script. + **/ + var target : InjectionTarget; + /** + Optional. + **/ + @:optional + var world : String; + /** + Whether the injection should be triggered in the target as soon as possible (but not necessarily prior to page load). + Optional. + **/ + @:optional + var injectImmediately : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/scripting/Static.hx b/externs/webextension_polyfill/scripting/Static.hx new file mode 100644 index 0000000..e73a487 --- /dev/null +++ b/externs/webextension_polyfill/scripting/Static.hx @@ -0,0 +1,32 @@ +package webextension_polyfill.scripting; + +typedef Static = { + /** + Injects a script into a target context. The script will be run at document_idle. + **/ + function executeScript(injection:ScriptInjection):js.lib.Promise>; + /** + Inserts a CSS stylesheet into a target context. If multiple frames are specified, unsuccessful injections are ignored. + **/ + function insertCSS(injection:CSSInjection):js.lib.Promise; + /** + Removes a CSS stylesheet that was previously inserted by this extension from a target context. + **/ + function removeCSS(injection:CSSInjection):js.lib.Promise; + /** + Registers one or more content scripts for this extension. + **/ + function registerContentScripts(scripts:Array):js.lib.Promise; + /** + Returns all dynamically registered content scripts for this extension that match the given filter. + **/ + function getRegisteredContentScripts(?filter:ContentScriptFilter):js.lib.Promise>; + /** + Unregisters one or more content scripts for this extension. + **/ + function unregisterContentScripts(?filter:ContentScriptFilter):js.lib.Promise; + /** + Updates one or more content scripts for this extension. + **/ + function updateContentScripts(scripts:Array):js.lib.Promise; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/scripting/StyleOrigin.hx b/externs/webextension_polyfill/scripting/StyleOrigin.hx new file mode 100644 index 0000000..6d3b92d --- /dev/null +++ b/externs/webextension_polyfill/scripting/StyleOrigin.hx @@ -0,0 +1,12 @@ +package webextension_polyfill.scripting; + +/** + The origin for a style change. See style origins for more info. + + "AUTHOR": The author origin is the style origin which contains all of the styles which are part of the document, + whether embedded within the HTML or loaded from an external stylesheet file. + "USER": The user origin is the style origin containing any CSS that the user of the web browser has added. + These may be from adding styles using a developer tool or from a browser extension that automatically applies custom + styles to content, such as Stylus or Stylish. +**/ +typedef StyleOrigin = CSSInjectionOriginEnum; \ No newline at end of file diff --git a/externs/webextension_polyfill/scripting/UpdateContentScriptsScriptsItemType.hx b/externs/webextension_polyfill/scripting/UpdateContentScriptsScriptsItemType.hx new file mode 100644 index 0000000..e629b6c --- /dev/null +++ b/externs/webextension_polyfill/scripting/UpdateContentScriptsScriptsItemType.hx @@ -0,0 +1,55 @@ +package webextension_polyfill.scripting; + +typedef UpdateContentScriptsScriptsItemType = { + /** + Specifies if this content script will persist into future sessions. + Optional. + **/ + @:optional + var persistAcrossSessions : Bool; + /** + If specified true, it will inject into all frames, even if the frame is not the top-most frame in the tab. + Each frame is checked independently for URL requirements; it will not inject into child frames if the URL requirements + are not met. Defaults to false, meaning that only the top frame is matched. + Optional. + **/ + @:optional + var allFrames : Bool; + /** + Excludes pages that this content script would otherwise be injected into. + Optional. + **/ + @:optional + var excludeMatches : Array; + /** + The id of the content script, specified in the API call. + **/ + var id : String; + /** + The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this + array. + Optional. + **/ + @:optional + var js : Array; + /** + Specifies which pages this content script will be injected into. Must be specified for registerContentScripts() + . + Optional. + **/ + @:optional + var matches : Array; + /** + Specifies when JavaScript files are injected into the web page. The preferred and default value is + document_idle. + Optional. + **/ + @:optional + var runAt : webextension_polyfill.extensiontypes.RunAt; + /** + The list of CSS files to be injected into matching pages. These are injected in the order they appear in this array. + Optional. + **/ + @:optional + var css : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/search/Disposition.hx b/externs/webextension_polyfill/search/Disposition.hx new file mode 100644 index 0000000..d3a0b01 --- /dev/null +++ b/externs/webextension_polyfill/search/Disposition.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.search; + +/** + Location where search results should be displayed. +**/ +typedef Disposition = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/search/QueryQueryInfoType.hx b/externs/webextension_polyfill/search/QueryQueryInfoType.hx new file mode 100644 index 0000000..c0099f2 --- /dev/null +++ b/externs/webextension_polyfill/search/QueryQueryInfoType.hx @@ -0,0 +1,20 @@ +package webextension_polyfill.search; + +typedef QueryQueryInfoType = { + /** + String to query with the default search provider. + **/ + var text : String; + /** + Location where search results should be displayed. CURRENT_TAB is the default. + Optional. + **/ + @:optional + var disposition : Disposition; + /** + Location where search results should be displayed. tabId cannot be used with disposition. + Optional. + **/ + @:optional + var tabId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/search/SearchEngine.hx b/externs/webextension_polyfill/search/SearchEngine.hx new file mode 100644 index 0000000..bb5a18a --- /dev/null +++ b/externs/webextension_polyfill/search/SearchEngine.hx @@ -0,0 +1,19 @@ +package webextension_polyfill.search; + +/** + An object encapsulating a search engine +**/ +typedef SearchEngine = { + var name : String; + var isDefault : Bool; + /** + Optional. + **/ + @:optional + var alias : String; + /** + Optional. + **/ + @:optional + var favIconUrl : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/search/SearchSearchPropertiesType.hx b/externs/webextension_polyfill/search/SearchSearchPropertiesType.hx new file mode 100644 index 0000000..9cabb5a --- /dev/null +++ b/externs/webextension_polyfill/search/SearchSearchPropertiesType.hx @@ -0,0 +1,27 @@ +package webextension_polyfill.search; + +typedef SearchSearchPropertiesType = { + /** + Terms to search for. + **/ + var query : String; + /** + Search engine to use. Uses the default if not specified. + Optional. + **/ + @:optional + var engine : String; + /** + Location where search results should be displayed. NEW_TAB is the default. + Optional. + **/ + @:optional + var disposition : Disposition; + /** + The ID of the tab for the search results. If not specified, a new tab is created, unless disposition is set. + tabId cannot be used with disposition. + Optional. + **/ + @:optional + var tabId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/search/Static.hx b/externs/webextension_polyfill/search/Static.hx new file mode 100644 index 0000000..8b98cff --- /dev/null +++ b/externs/webextension_polyfill/search/Static.hx @@ -0,0 +1,16 @@ +package webextension_polyfill.search; + +typedef Static = { + /** + Gets a list of search engines. + **/ + function get():js.lib.Promise>; + /** + Perform a search. + **/ + function search(searchProperties:SearchSearchPropertiesType):Void; + /** + Use the chrome.search API to search via the default provider. + **/ + function query(queryInfo:QueryQueryInfoType):js.lib.Promise; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/sessions/Device.hx b/externs/webextension_polyfill/sessions/Device.hx new file mode 100644 index 0000000..7ca12b7 --- /dev/null +++ b/externs/webextension_polyfill/sessions/Device.hx @@ -0,0 +1,13 @@ +package webextension_polyfill.sessions; + +typedef Device = { + var info : String; + /** + The name of the foreign device. + **/ + var deviceName : String; + /** + A list of open window sessions for the foreign device, sorted from most recently to least recently modified session. + **/ + var sessions : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/sessions/Filter.hx b/externs/webextension_polyfill/sessions/Filter.hx new file mode 100644 index 0000000..1589a98 --- /dev/null +++ b/externs/webextension_polyfill/sessions/Filter.hx @@ -0,0 +1,11 @@ +package webextension_polyfill.sessions; + +typedef Filter = { + /** + The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of + entries ($(ref:sessions.MAX_SESSION_RESULTS)). + Optional. + **/ + @:optional + var maxResults : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/sessions/Session.hx b/externs/webextension_polyfill/sessions/Session.hx new file mode 100644 index 0000000..126595c --- /dev/null +++ b/externs/webextension_polyfill/sessions/Session.hx @@ -0,0 +1,20 @@ +package webextension_polyfill.sessions; + +typedef Session = { + /** + The time when the window or tab was closed or modified, represented in milliseconds since the epoch. + **/ + var lastModified : Float; + /** + The $(ref:tabs.Tab), if this entry describes a tab. Either this or $(ref:sessions.Session.window) will be set. + Optional. + **/ + @:optional + var tab : webextension_polyfill.tabs.Tab; + /** + The $(ref:windows.Window), if this entry describes a window. Either this or $(ref:sessions.Session.tab) will be set. + Optional. + **/ + @:optional + var window : webextension_polyfill.windows.Window; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/sessions/Static.hx b/externs/webextension_polyfill/sessions/Static.hx new file mode 100644 index 0000000..eba9c40 --- /dev/null +++ b/externs/webextension_polyfill/sessions/Static.hx @@ -0,0 +1,52 @@ +package webextension_polyfill.sessions; + +typedef Static = { + /** + Forget a recently closed tab. + **/ + function forgetClosedTab(windowId:Float, sessionId:String):js.lib.Promise; + /** + Forget a recently closed window. + **/ + function forgetClosedWindow(sessionId:String):js.lib.Promise; + /** + Gets the list of recently closed tabs and/or windows. + **/ + function getRecentlyClosed(?filter:Filter):js.lib.Promise>; + /** + Reopens a $(ref:windows.Window) or $(ref:tabs.Tab), with an optional callback to run when the entry has been restored. + **/ + function restore(?sessionId:String):js.lib.Promise; + /** + Set a key/value pair on a given tab. + **/ + function setTabValue(tabId:Float, key:String, value:Dynamic):js.lib.Promise; + /** + Retrieve a value that was set for a given key on a given tab. + **/ + function getTabValue(tabId:Float, key:String):js.lib.Promise; + /** + Remove a key/value pair that was set on a given tab. + **/ + function removeTabValue(tabId:Float, key:String):js.lib.Promise; + /** + Set a key/value pair on a given window. + **/ + function setWindowValue(windowId:Float, key:String, value:Dynamic):js.lib.Promise; + /** + Retrieve a value that was set for a given key on a given window. + **/ + function getWindowValue(windowId:Float, key:String):js.lib.Promise; + /** + Remove a key/value pair that was set on a given window. + **/ + function removeWindowValue(windowId:Float, key:String):js.lib.Promise; + /** + Fired when recently closed tabs and/or windows are changed. This event does not monitor synced sessions changes. + **/ + var onChanged : webextension_polyfill.events.Event<() -> Void>; + /** + The maximum number of $(ref:sessions.Session) that will be included in a requested list. + **/ + var MAX_SESSION_RESULTS : Int; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/sidebaraction/GetPanelDetailsType.hx b/externs/webextension_polyfill/sidebaraction/GetPanelDetailsType.hx new file mode 100644 index 0000000..9641eaf --- /dev/null +++ b/externs/webextension_polyfill/sidebaraction/GetPanelDetailsType.hx @@ -0,0 +1,16 @@ +package webextension_polyfill.sidebaraction; + +typedef GetPanelDetailsType = { + /** + Specify the tab to get the panel from. If no tab nor window is specified, the global panel is returned. + Optional. + **/ + @:optional + var tabId : Float; + /** + Specify the window to get the panel from. If no tab nor window is specified, the global panel is returned. + Optional. + **/ + @:optional + var windowId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/sidebaraction/GetTitleDetailsType.hx b/externs/webextension_polyfill/sidebaraction/GetTitleDetailsType.hx new file mode 100644 index 0000000..407c894 --- /dev/null +++ b/externs/webextension_polyfill/sidebaraction/GetTitleDetailsType.hx @@ -0,0 +1,16 @@ +package webextension_polyfill.sidebaraction; + +typedef GetTitleDetailsType = { + /** + Specify the tab to get the title from. If no tab nor window is specified, the global title is returned. + Optional. + **/ + @:optional + var tabId : Float; + /** + Specify the window to get the title from. If no tab nor window is specified, the global title is returned. + Optional. + **/ + @:optional + var windowId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/sidebaraction/ImageDataType.hx b/externs/webextension_polyfill/sidebaraction/ImageDataType.hx new file mode 100644 index 0000000..470074e --- /dev/null +++ b/externs/webextension_polyfill/sidebaraction/ImageDataType.hx @@ -0,0 +1,19 @@ +package webextension_polyfill.sidebaraction; + +/** + Pixel data for an image. Must be an ImageData object (for example, from a canvas element). +**/ +typedef ImageDataType = { + /** + Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255. + **/ + final data : js.lib.Uint8ClampedArray; + /** + Returns the actual dimensions of the data in the ImageData object, in pixels. + **/ + final height : Float; + /** + Returns the actual dimensions of the data in the ImageData object, in pixels. + **/ + final width : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/sidebaraction/IsOpenDetailsType.hx b/externs/webextension_polyfill/sidebaraction/IsOpenDetailsType.hx new file mode 100644 index 0000000..06b8729 --- /dev/null +++ b/externs/webextension_polyfill/sidebaraction/IsOpenDetailsType.hx @@ -0,0 +1,10 @@ +package webextension_polyfill.sidebaraction; + +typedef IsOpenDetailsType = { + /** + Specify the window to get the openness from. + Optional. + **/ + @:optional + var windowId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/sidebaraction/SetIconDetailsType.hx b/externs/webextension_polyfill/sidebaraction/SetIconDetailsType.hx new file mode 100644 index 0000000..ae69c85 --- /dev/null +++ b/externs/webextension_polyfill/sidebaraction/SetIconDetailsType.hx @@ -0,0 +1,37 @@ +package webextension_polyfill.sidebaraction; + +typedef SetIconDetailsType = { + /** + Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. + If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. + If the number of image pixels that fit into one screen space unit equals scale, then image with size + scale * 19 will be selected. Initially only scales 1 and 2 will be supported. + At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details. + imageData = {'19': foo}' + Optional. + **/ + @:optional + var imageData : ts.AnyOf2>; + /** + Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. + If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. + If the number of image pixels that fit into one screen space unit equals scale, then image with size + scale * 19 will be selected. Initially only scales 1 and 2 will be supported. + At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}' + Optional. + **/ + @:optional + var path : ts.AnyOf2; + /** + Sets the sidebar icon for the tab specified by tabId. Automatically resets when the tab is closed. + Optional. + **/ + @:optional + var tabId : Float; + /** + Sets the sidebar icon for the window specified by windowId. + Optional. + **/ + @:optional + var windowId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/sidebaraction/SetIconDetailsTypePathC2Type.hx b/externs/webextension_polyfill/sidebaraction/SetIconDetailsTypePathC2Type.hx new file mode 100644 index 0000000..df8110d --- /dev/null +++ b/externs/webextension_polyfill/sidebaraction/SetIconDetailsTypePathC2Type.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.sidebaraction; + +typedef SetIconDetailsTypePathC2Type = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/sidebaraction/SetPanelDetailsType.hx b/externs/webextension_polyfill/sidebaraction/SetPanelDetailsType.hx new file mode 100644 index 0000000..11b488c --- /dev/null +++ b/externs/webextension_polyfill/sidebaraction/SetPanelDetailsType.hx @@ -0,0 +1,20 @@ +package webextension_polyfill.sidebaraction; + +typedef SetPanelDetailsType = { + /** + Sets the sidebar url for the tab specified by tabId. Automatically resets when the tab is closed. + Optional. + **/ + @:optional + var tabId : Float; + /** + Sets the sidebar url for the window specified by windowId. + Optional. + **/ + @:optional + var windowId : Float; + /** + The url to the html file to show in a sidebar. If set to the empty string (''), no sidebar is shown. + **/ + var panel : Null; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/sidebaraction/SetTitleDetailsType.hx b/externs/webextension_polyfill/sidebaraction/SetTitleDetailsType.hx new file mode 100644 index 0000000..225e432 --- /dev/null +++ b/externs/webextension_polyfill/sidebaraction/SetTitleDetailsType.hx @@ -0,0 +1,20 @@ +package webextension_polyfill.sidebaraction; + +typedef SetTitleDetailsType = { + /** + The string the sidebar action should display when moused over. + **/ + var title : Null; + /** + Sets the sidebar title for the tab specified by tabId. Automatically resets when the tab is closed. + Optional. + **/ + @:optional + var tabId : Float; + /** + Sets the sidebar title for the window specified by windowId. + Optional. + **/ + @:optional + var windowId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/sidebaraction/Static.hx b/externs/webextension_polyfill/sidebaraction/Static.hx new file mode 100644 index 0000000..caa227b --- /dev/null +++ b/externs/webextension_polyfill/sidebaraction/Static.hx @@ -0,0 +1,42 @@ +package webextension_polyfill.sidebaraction; + +typedef Static = { + /** + Sets the title of the sidebar action. This shows up in the tooltip. + **/ + function setTitle(details:SetTitleDetailsType):js.lib.Promise; + /** + Gets the title of the sidebar action. + **/ + function getTitle(details:GetTitleDetailsType):js.lib.Promise; + /** + Sets the icon for the sidebar action. The icon can be specified either as the path to an image file or as the pixel data + from a canvas element, or as dictionary of either one of those. Either the path or the + imageData property must be specified. + **/ + function setIcon(details:SetIconDetailsType):js.lib.Promise; + /** + Sets the url to the html document to be opened in the sidebar when the user clicks on the sidebar action's icon. + **/ + function setPanel(details:SetPanelDetailsType):js.lib.Promise; + /** + Gets the url to the html document set as the panel for this sidebar action. + **/ + function getPanel(details:GetPanelDetailsType):js.lib.Promise; + /** + Opens the extension sidebar in the active window. + **/ + function open():js.lib.Promise; + /** + Closes the extension sidebar in the active window if the sidebar belongs to the extension. + **/ + function close():js.lib.Promise; + /** + Toggles the extension sidebar in the active window. + **/ + function toggle():Void; + /** + Checks whether the sidebar action is open. + **/ + function isOpen(details:IsOpenDetailsType):js.lib.Promise; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/storage/LocalStorageArea.hx b/externs/webextension_polyfill/storage/LocalStorageArea.hx new file mode 100644 index 0000000..d591576 --- /dev/null +++ b/externs/webextension_polyfill/storage/LocalStorageArea.hx @@ -0,0 +1,30 @@ +package webextension_polyfill.storage; + +typedef LocalStorageArea = { + /** + The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of + every value plus every key's length. This value will be ignored if the extension has the unlimitedStorage + permission. Updates that would cause this limit to be exceeded fail immediately and set $(ref:runtime.lastError). + **/ + var QUOTA_BYTES : Int; + /** + Gets one or more items from storage. + **/ + function get(?keys:ts.AnyOf3, haxe.DynamicAccess>):js.lib.Promise>; + /** + Sets multiple items. + **/ + function set(items:haxe.DynamicAccess):js.lib.Promise; + /** + Removes one or more items from storage. + **/ + function remove(keys:ts.AnyOf2>):js.lib.Promise; + /** + Removes all items from storage. + **/ + function clear():js.lib.Promise; + /** + Fired when one or more items change. + **/ + var onChanged : webextension_polyfill.events.Event<(changes:StorageAreaOnChangedChangesType) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/storage/ManagedStorageArea.hx b/externs/webextension_polyfill/storage/ManagedStorageArea.hx new file mode 100644 index 0000000..c3e94d5 --- /dev/null +++ b/externs/webextension_polyfill/storage/ManagedStorageArea.hx @@ -0,0 +1,28 @@ +package webextension_polyfill.storage; + +typedef ManagedStorageArea = { + /** + The maximum size (in bytes) of the managed storage JSON manifest file. Files larger than this limit will fail to load. + **/ + var QUOTA_BYTES : Int; + /** + Gets one or more items from storage. + **/ + function get(?keys:ts.AnyOf3, haxe.DynamicAccess>):js.lib.Promise>; + /** + Sets multiple items. + **/ + function set(items:haxe.DynamicAccess):js.lib.Promise; + /** + Removes one or more items from storage. + **/ + function remove(keys:ts.AnyOf2>):js.lib.Promise; + /** + Removes all items from storage. + **/ + function clear():js.lib.Promise; + /** + Fired when one or more items change. + **/ + var onChanged : webextension_polyfill.events.Event<(changes:StorageAreaOnChangedChangesType) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/storage/Static.hx b/externs/webextension_polyfill/storage/Static.hx new file mode 100644 index 0000000..eb1ccc1 --- /dev/null +++ b/externs/webextension_polyfill/storage/Static.hx @@ -0,0 +1,16 @@ +package webextension_polyfill.storage; + +typedef Static = { + /** + Fired when one or more items change. + **/ + var onChanged : webextension_polyfill.events.Event<(changes:haxe.DynamicAccess, areaName:String) -> Void>; + var sync : SyncStorageAreaSync; + var local : LocalStorageArea; + var managed : ManagedStorageArea; + /** + Items in the session storage area are kept in memory, and only until the either browser or extension is + closed or reloaded. + **/ + var session : StorageArea; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/storage/StorageArea.hx b/externs/webextension_polyfill/storage/StorageArea.hx new file mode 100644 index 0000000..164d57b --- /dev/null +++ b/externs/webextension_polyfill/storage/StorageArea.hx @@ -0,0 +1,24 @@ +package webextension_polyfill.storage; + +typedef StorageArea = { + /** + Gets one or more items from storage. + **/ + function get(?keys:ts.AnyOf3, haxe.DynamicAccess>):js.lib.Promise>; + /** + Sets multiple items. + **/ + function set(items:haxe.DynamicAccess):js.lib.Promise; + /** + Removes one or more items from storage. + **/ + function remove(keys:ts.AnyOf2>):js.lib.Promise; + /** + Removes all items from storage. + **/ + function clear():js.lib.Promise; + /** + Fired when one or more items change. + **/ + var onChanged : webextension_polyfill.events.Event<(changes:StorageAreaOnChangedChangesType) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/storage/StorageAreaOnChangedChangesType.hx b/externs/webextension_polyfill/storage/StorageAreaOnChangedChangesType.hx new file mode 100644 index 0000000..ddda859 --- /dev/null +++ b/externs/webextension_polyfill/storage/StorageAreaOnChangedChangesType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.storage; + +/** + Object mapping each key that changed to its corresponding $(ref:storage.StorageChange) for that item. +**/ +typedef StorageAreaOnChangedChangesType = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/storage/StorageAreaSync.hx b/externs/webextension_polyfill/storage/StorageAreaSync.hx new file mode 100644 index 0000000..82933ff --- /dev/null +++ b/externs/webextension_polyfill/storage/StorageAreaSync.hx @@ -0,0 +1,28 @@ +package webextension_polyfill.storage; + +typedef StorageAreaSync = { + /** + Gets one or more items from storage. + **/ + function get(?keys:ts.AnyOf3, haxe.DynamicAccess>):js.lib.Promise>; + /** + Gets the amount of space (in bytes) being used by one or more items. + **/ + function getBytesInUse(?keys:ts.AnyOf2>):js.lib.Promise; + /** + Sets multiple items. + **/ + function set(items:haxe.DynamicAccess):js.lib.Promise; + /** + Removes one or more items from storage. + **/ + function remove(keys:ts.AnyOf2>):js.lib.Promise; + /** + Removes all items from storage. + **/ + function clear():js.lib.Promise; + /** + Fired when one or more items change. + **/ + var onChanged : webextension_polyfill.events.Event<(changes:StorageAreaSyncOnChangedChangesType) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/storage/StorageAreaSyncOnChangedChangesType.hx b/externs/webextension_polyfill/storage/StorageAreaSyncOnChangedChangesType.hx new file mode 100644 index 0000000..f6f6ee8 --- /dev/null +++ b/externs/webextension_polyfill/storage/StorageAreaSyncOnChangedChangesType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.storage; + +/** + Object mapping each key that changed to its corresponding $(ref:storage.StorageChange) for that item. +**/ +typedef StorageAreaSyncOnChangedChangesType = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/storage/StorageChange.hx b/externs/webextension_polyfill/storage/StorageChange.hx new file mode 100644 index 0000000..e21b06b --- /dev/null +++ b/externs/webextension_polyfill/storage/StorageChange.hx @@ -0,0 +1,16 @@ +package webextension_polyfill.storage; + +typedef StorageChange = { + /** + The old value of the item, if there was an old value. + Optional. + **/ + @:optional + var oldValue : Dynamic; + /** + The new value of the item, if there is a new value. + Optional. + **/ + @:optional + var newValue : Dynamic; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/storage/SyncStorageAreaSync.hx b/externs/webextension_polyfill/storage/SyncStorageAreaSync.hx new file mode 100644 index 0000000..45ae3ec --- /dev/null +++ b/externs/webextension_polyfill/storage/SyncStorageAreaSync.hx @@ -0,0 +1,59 @@ +package webextension_polyfill.storage; + +typedef SyncStorageAreaSync = { + /** + The maximum total amount (in bytes) of data that can be stored in sync storage, as measured by the JSON stringification + of every value plus every key's length. Updates that would cause this limit to be exceeded fail immediately and set + $(ref:runtime.lastError). + **/ + var QUOTA_BYTES : Int; + /** + The maximum size (in bytes) of each individual item in sync storage, as measured by the JSON stringification of its + value plus its key length. Updates containing items larger than this limit will fail immediately and set $(ref:runtime. + lastError). + **/ + var QUOTA_BYTES_PER_ITEM : Int; + /** + The maximum number of items that can be stored in sync storage. Updates that would cause this limit to be exceeded will + fail immediately and set $(ref:runtime.lastError). + **/ + var MAX_ITEMS : Int; + /** +

The maximum number of set, remove, or clear + operations that can be performed each hour. This is 1 every 2 seconds, a lower ceiling than the short term higher + writes-per-minute limit.

Updates that would cause this limit to be exceeded fail immediately and set $(ref:runtime. + lastError).

+ **/ + var MAX_WRITE_OPERATIONS_PER_HOUR : Int; + /** +

The maximum number of set, remove, or clear + operations that can be performed each minute. This is 2 per second, providing higher throughput than writes-per-hour + over a shorter period of time.

Updates that would cause this limit to be exceeded fail immediately and set + $(ref:runtime.lastError).

+ **/ + var MAX_WRITE_OPERATIONS_PER_MINUTE : Int; + /** + Gets one or more items from storage. + **/ + function get(?keys:ts.AnyOf3, haxe.DynamicAccess>):js.lib.Promise>; + /** + Gets the amount of space (in bytes) being used by one or more items. + **/ + function getBytesInUse(?keys:ts.AnyOf2>):js.lib.Promise; + /** + Sets multiple items. + **/ + function set(items:haxe.DynamicAccess):js.lib.Promise; + /** + Removes one or more items from storage. + **/ + function remove(keys:ts.AnyOf2>):js.lib.Promise; + /** + Removes all items from storage. + **/ + function clear():js.lib.Promise; + /** + Fired when one or more items change. + **/ + var onChanged : webextension_polyfill.events.Event<(changes:StorageAreaSyncOnChangedChangesType) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/ConnectConnectInfoType.hx b/externs/webextension_polyfill/tabs/ConnectConnectInfoType.hx new file mode 100644 index 0000000..8ba872f --- /dev/null +++ b/externs/webextension_polyfill/tabs/ConnectConnectInfoType.hx @@ -0,0 +1,16 @@ +package webextension_polyfill.tabs; + +typedef ConnectConnectInfoType = { + /** + Will be passed into onConnect for content scripts that are listening for the connection event. + Optional. + **/ + @:optional + var name : String; + /** + Open a port to a specific $(topic:frame_ids)[frame] identified by frameId instead of all frames in the tab. + Optional. + **/ + @:optional + var frameId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/CreateCreatePropertiesType.hx b/externs/webextension_polyfill/tabs/CreateCreatePropertiesType.hx new file mode 100644 index 0000000..e8398b0 --- /dev/null +++ b/externs/webextension_polyfill/tabs/CreateCreatePropertiesType.hx @@ -0,0 +1,74 @@ +package webextension_polyfill.tabs; + +typedef CreateCreatePropertiesType = { + /** + The window to create the new tab in. Defaults to the $(topic:current-window)[current window]. + Optional. + **/ + @:optional + var windowId : Float; + /** + The position the tab should take in the window. The provided value will be clamped to between zero and the number of + tabs in the window. + Optional. + **/ + @:optional + var index : Float; + /** + The URL to navigate the tab to initially. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', + not 'www.google.com'). Relative URLs will be relative to the current page within the extension. + Defaults to the New Tab Page. + Optional. + **/ + @:optional + var url : String; + /** + Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see + $(ref:windows.update)). Defaults to true. + Optional. + **/ + @:optional + var active : Bool; + /** + Whether the tab should be pinned. Defaults to false + Optional. + **/ + @:optional + var pinned : Bool; + /** + The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as the newly created tab. + Optional. + **/ + @:optional + var openerTabId : Float; + /** + The CookieStoreId for the tab that opened this tab. + Optional. + **/ + @:optional + var cookieStoreId : String; + /** + Whether the document in the tab should be opened in reader mode. + Optional. + **/ + @:optional + var openInReaderMode : Bool; + /** + Whether the tab is marked as 'discarded' when created. + Optional. + **/ + @:optional + var discarded : Bool; + /** + The title used for display if the tab is created in discarded mode. + Optional. + **/ + @:optional + var title : String; + /** + Whether the tab should be muted when created. + Optional. + **/ + @:optional + var muted : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/DuplicateDuplicatePropertiesType.hx b/externs/webextension_polyfill/tabs/DuplicateDuplicatePropertiesType.hx new file mode 100644 index 0000000..ee39b5e --- /dev/null +++ b/externs/webextension_polyfill/tabs/DuplicateDuplicatePropertiesType.hx @@ -0,0 +1,18 @@ +package webextension_polyfill.tabs; + +typedef DuplicateDuplicatePropertiesType = { + /** + The position the new tab should take in the window. The provided value will be clamped to between zero and the number of + tabs in the window. + Optional. + **/ + @:optional + var index : Float; + /** + Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see + $(ref:windows.update)). Defaults to true. + Optional. + **/ + @:optional + var active : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/HighlightHighlightInfoType.hx b/externs/webextension_polyfill/tabs/HighlightHighlightInfoType.hx new file mode 100644 index 0000000..ef5ac5f --- /dev/null +++ b/externs/webextension_polyfill/tabs/HighlightHighlightInfoType.hx @@ -0,0 +1,23 @@ +package webextension_polyfill.tabs; + +typedef HighlightHighlightInfoType = { + /** + The window that contains the tabs. + Optional. + **/ + @:optional + var windowId : Float; + /** + If true, the $(ref:windows.Window) returned will have a tabs property that contains a list of the $(ref:tabs. + Tab) objects. The Tab objects only contain the url, title and + favIconUrl properties if the extension's manifest file includes the "tabs" permission. If false, + the $(ref:windows.Window) won't have the tabs property. + Optional. + **/ + @:optional + var populate : Bool; + /** + One or more tab indices to highlight. + **/ + var tabs : ts.AnyOf2>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/MoveInSuccessionOptionsType.hx b/externs/webextension_polyfill/tabs/MoveInSuccessionOptionsType.hx new file mode 100644 index 0000000..93436a5 --- /dev/null +++ b/externs/webextension_polyfill/tabs/MoveInSuccessionOptionsType.hx @@ -0,0 +1,20 @@ +package webextension_polyfill.tabs; + +typedef MoveInSuccessionOptionsType = { + /** + Whether to move the tabs before (false) or after (true) tabId in the succession. Defaults to false. + Optional. + **/ + @:optional + var append : Bool; + /** + Whether to link up the current predecessors or successor (depending on options.append) + of tabId to the other side of the chain after it is prepended or appended. If true, + one of the following happens: if options.append is false, the first tab in the array is set as the successor of any + current predecessors of tabId; if options.append is true, the current successor of tabId is set as the successor of the + last tab in the array. Defaults to false. + Optional. + **/ + @:optional + var insert : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/MoveMovePropertiesType.hx b/externs/webextension_polyfill/tabs/MoveMovePropertiesType.hx new file mode 100644 index 0000000..cf38e7e --- /dev/null +++ b/externs/webextension_polyfill/tabs/MoveMovePropertiesType.hx @@ -0,0 +1,14 @@ +package webextension_polyfill.tabs; + +typedef MoveMovePropertiesType = { + /** + Defaults to the window the tab is currently in. + Optional. + **/ + @:optional + var windowId : Float; + /** + The position to move the window to. -1 will place the tab at the end of the window. + **/ + var index : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/MutedInfo.hx b/externs/webextension_polyfill/tabs/MutedInfo.hx new file mode 100644 index 0000000..8e4dbf5 --- /dev/null +++ b/externs/webextension_polyfill/tabs/MutedInfo.hx @@ -0,0 +1,25 @@ +package webextension_polyfill.tabs; + +/** + Tab muted state and the reason for the last state change. +**/ +typedef MutedInfo = { + /** + Whether the tab is prevented from playing sound (but hasn't necessarily recently produced sound). + Equivalent to whether the muted audio indicator is showing. + **/ + var muted : Bool; + /** + The reason the tab was muted or unmuted. Not set if the tab's mute state has never been changed. + Optional. + **/ + @:optional + var reason : MutedInfoReason; + /** + The ID of the extension that changed the muted state. Not set if an extension was not the reason the muted state last + changed. + Optional. + **/ + @:optional + var extensionId : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/MutedInfoReason.hx b/externs/webextension_polyfill/tabs/MutedInfoReason.hx new file mode 100644 index 0000000..d5f0f0b --- /dev/null +++ b/externs/webextension_polyfill/tabs/MutedInfoReason.hx @@ -0,0 +1,10 @@ +package webextension_polyfill.tabs; + +/** + An event that caused a muted state change. + + "user": A user input action has set/overridden the muted state. + "capture": Tab capture started, forcing a muted state change. + "extension": An extension, identified by the extensionId field, set the muted state. +**/ +typedef MutedInfoReason = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/OnActivatedActiveInfoType.hx b/externs/webextension_polyfill/tabs/OnActivatedActiveInfoType.hx new file mode 100644 index 0000000..58b7341 --- /dev/null +++ b/externs/webextension_polyfill/tabs/OnActivatedActiveInfoType.hx @@ -0,0 +1,18 @@ +package webextension_polyfill.tabs; + +typedef OnActivatedActiveInfoType = { + /** + The ID of the tab that has become active. + **/ + var tabId : Float; + /** + The ID of the tab that was previously active, if that tab is still open. + Optional. + **/ + @:optional + var previousTabId : Float; + /** + The ID of the window the active tab changed inside of. + **/ + var windowId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/OnAttachedAttachInfoType.hx b/externs/webextension_polyfill/tabs/OnAttachedAttachInfoType.hx new file mode 100644 index 0000000..b7c6f54 --- /dev/null +++ b/externs/webextension_polyfill/tabs/OnAttachedAttachInfoType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.tabs; + +typedef OnAttachedAttachInfoType = { + var newWindowId : Float; + var newPosition : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/OnDetachedDetachInfoType.hx b/externs/webextension_polyfill/tabs/OnDetachedDetachInfoType.hx new file mode 100644 index 0000000..0a006a7 --- /dev/null +++ b/externs/webextension_polyfill/tabs/OnDetachedDetachInfoType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.tabs; + +typedef OnDetachedDetachInfoType = { + var oldWindowId : Float; + var oldPosition : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/OnHighlightedHighlightInfoType.hx b/externs/webextension_polyfill/tabs/OnHighlightedHighlightInfoType.hx new file mode 100644 index 0000000..31c5317 --- /dev/null +++ b/externs/webextension_polyfill/tabs/OnHighlightedHighlightInfoType.hx @@ -0,0 +1,12 @@ +package webextension_polyfill.tabs; + +typedef OnHighlightedHighlightInfoType = { + /** + The window whose tabs changed. + **/ + var windowId : Float; + /** + All highlighted tabs in the window. + **/ + var tabIds : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/OnMovedMoveInfoType.hx b/externs/webextension_polyfill/tabs/OnMovedMoveInfoType.hx new file mode 100644 index 0000000..22e57ec --- /dev/null +++ b/externs/webextension_polyfill/tabs/OnMovedMoveInfoType.hx @@ -0,0 +1,7 @@ +package webextension_polyfill.tabs; + +typedef OnMovedMoveInfoType = { + var windowId : Float; + var fromIndex : Float; + var toIndex : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/OnRemovedRemoveInfoType.hx b/externs/webextension_polyfill/tabs/OnRemovedRemoveInfoType.hx new file mode 100644 index 0000000..1d8f24d --- /dev/null +++ b/externs/webextension_polyfill/tabs/OnRemovedRemoveInfoType.hx @@ -0,0 +1,12 @@ +package webextension_polyfill.tabs; + +typedef OnRemovedRemoveInfoType = { + /** + The window whose tab is closed. + **/ + var windowId : Float; + /** + True when the tab is being closed because its window is being closed. + **/ + var isWindowClosing : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/OnUpdatedChangeInfoType.hx b/externs/webextension_polyfill/tabs/OnUpdatedChangeInfoType.hx new file mode 100644 index 0000000..13b794d --- /dev/null +++ b/externs/webextension_polyfill/tabs/OnUpdatedChangeInfoType.hx @@ -0,0 +1,88 @@ +package webextension_polyfill.tabs; + +/** + Lists the changes to the state of the tab that was updated. +**/ +typedef OnUpdatedChangeInfoType = { + /** + The tab's new attention state. + Optional. + **/ + @:optional + var attention : Bool; + /** + The tab's new audible state. + Optional. + **/ + @:optional + var audible : Bool; + /** + The tab's new autoDiscardable state. + Optional. + **/ + @:optional + var autoDiscardable : Bool; + /** + True while the tab is not loaded with content. + Optional. + **/ + @:optional + var discarded : Bool; + /** + The tab's new favicon URL. This property is only present if the extension's manifest includes the "tabs" + permission. + Optional. + **/ + @:optional + var favIconUrl : String; + /** + The tab's new hidden state. + Optional. + **/ + @:optional + var hidden : Bool; + /** + Whether the document in the tab can be rendered in reader mode. + Optional. + **/ + @:optional + var isArticle : Bool; + /** + The tab's new muted state and the reason for the change. + Optional. + **/ + @:optional + var mutedInfo : MutedInfo; + /** + The tab's new pinned state. + Optional. + **/ + @:optional + var pinned : Bool; + /** + The tab's new sharing state for screen, microphone and camera. + Optional. + **/ + @:optional + var sharingState : SharingState; + /** + The status of the tab. Can be either loading or complete. + Optional. + **/ + @:optional + var status : String; + /** + The title of the tab if it has changed. This property is only present if the extension's manifest includes the + "tabs" permission. + Optional. + **/ + @:optional + var title : String; + /** + The tab's URL if it has changed. This property is only present if the extension's manifest includes the + "tabs" permission. + Optional. + **/ + @:optional + var url : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/OnUpdatedEvent.hx b/externs/webextension_polyfill/tabs/OnUpdatedEvent.hx new file mode 100644 index 0000000..c32acee --- /dev/null +++ b/externs/webextension_polyfill/tabs/OnUpdatedEvent.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.tabs; + +/** + Fired when a tab is updated. +**/ +typedef OnUpdatedEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(tabId:Float, changeInfo:OnUpdatedChangeInfoType, tab:Tab) -> Void, ?filter:UpdateFilter):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(tabId:Float, changeInfo:OnUpdatedChangeInfoType, tab:Tab) -> Void):Void; + function hasListener(callback:(tabId:Float, changeInfo:OnUpdatedChangeInfoType, tab:Tab) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/OnZoomChangeZoomChangeInfoType.hx b/externs/webextension_polyfill/tabs/OnZoomChangeZoomChangeInfoType.hx new file mode 100644 index 0000000..b1f8ad7 --- /dev/null +++ b/externs/webextension_polyfill/tabs/OnZoomChangeZoomChangeInfoType.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.tabs; + +typedef OnZoomChangeZoomChangeInfoType = { + var tabId : Float; + var oldZoomFactor : Float; + var newZoomFactor : Float; + var zoomSettings : ZoomSettings; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/PageSettings.hx b/externs/webextension_polyfill/tabs/PageSettings.hx new file mode 100644 index 0000000..a0cd27b --- /dev/null +++ b/externs/webextension_polyfill/tabs/PageSettings.hx @@ -0,0 +1,145 @@ +package webextension_polyfill.tabs; + +/** + Defines the page settings to be used when saving a page as a pdf file. +**/ +typedef PageSettings = { + /** + The name of the file. May include optional .pdf extension. + Optional. + **/ + @:optional + var toFileName : String; + /** + The page size unit: 0 = inches, 1 = millimeters. Default: 0. + Optional. + **/ + @:optional + var paperSizeUnit : Float; + /** + The paper width in paper size units. Default: 8.5. + Optional. + **/ + @:optional + var paperWidth : Float; + /** + The paper height in paper size units. Default: 11.0. + Optional. + **/ + @:optional + var paperHeight : Float; + /** + The page content orientation: 0 = portrait, 1 = landscape. Default: 0. + Optional. + **/ + @:optional + var orientation : Float; + /** + The page content scaling factor: 1.0 = 100% = normal size. Default: 1.0. + Optional. + **/ + @:optional + var scaling : Float; + /** + Whether the page content should shrink to fit the page width (overrides scaling). Default: true. + Optional. + **/ + @:optional + var shrinkToFit : Bool; + /** + Whether the page background colors should be shown. Default: false. + Optional. + **/ + @:optional + var showBackgroundColors : Bool; + /** + Whether the page background images should be shown. Default: false. + Optional. + **/ + @:optional + var showBackgroundImages : Bool; + /** + The spacing between the left header/footer and the left edge of the paper (inches). Default: 0. + Optional. + **/ + @:optional + var edgeLeft : Float; + /** + The spacing between the right header/footer and the right edge of the paper (inches). Default: 0. + Optional. + **/ + @:optional + var edgeRight : Float; + /** + The spacing between the top of the headers and the top edge of the paper (inches). Default: 0 + Optional. + **/ + @:optional + var edgeTop : Float; + /** + The spacing between the bottom of the footers and the bottom edge of the paper (inches). Default: 0. + Optional. + **/ + @:optional + var edgeBottom : Float; + /** + The margin between the page content and the left edge of the paper (inches). Default: 0.5. + Optional. + **/ + @:optional + var marginLeft : Float; + /** + The margin between the page content and the right edge of the paper (inches). Default: 0.5. + Optional. + **/ + @:optional + var marginRight : Float; + /** + The margin between the page content and the top edge of the paper (inches). Default: 0.5. + Optional. + **/ + @:optional + var marginTop : Float; + /** + The margin between the page content and the bottom edge of the paper (inches). Default: 0.5. + Optional. + **/ + @:optional + var marginBottom : Float; + /** + The text for the page's left header. Default: '&T'. + Optional. + **/ + @:optional + var headerLeft : String; + /** + The text for the page's center header. Default: ''. + Optional. + **/ + @:optional + var headerCenter : String; + /** + The text for the page's right header. Default: '&U'. + Optional. + **/ + @:optional + var headerRight : String; + /** + The text for the page's left footer. Default: '&PT'. + Optional. + **/ + @:optional + var footerLeft : String; + /** + The text for the page's center footer. Default: ''. + Optional. + **/ + @:optional + var footerCenter : String; + /** + The text for the page's right footer. Default: '&D'. + Optional. + **/ + @:optional + var footerRight : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/QueryQueryInfoType.hx b/externs/webextension_polyfill/tabs/QueryQueryInfoType.hx new file mode 100644 index 0000000..e5b0012 --- /dev/null +++ b/externs/webextension_polyfill/tabs/QueryQueryInfoType.hx @@ -0,0 +1,136 @@ +package webextension_polyfill.tabs; + +typedef QueryQueryInfoType = { + /** + Whether the tabs are active in their windows. + Optional. + **/ + @:optional + var active : Bool; + /** + Whether the tabs are drawing attention. + Optional. + **/ + @:optional + var attention : Bool; + /** + Whether the tabs are pinned. + Optional. + **/ + @:optional + var pinned : Bool; + /** + Whether the tabs are audible. + Optional. + **/ + @:optional + var audible : Bool; + /** + Whether the tabs can be discarded automatically by the browser when resources are low. + Optional. + **/ + @:optional + var autoDiscardable : Bool; + /** + Whether the tabs are muted. + Optional. + **/ + @:optional + var muted : Bool; + /** + Whether the tabs are highlighted. Works as an alias of active. + Optional. + **/ + @:optional + var highlighted : Bool; + /** + Whether the tabs are in the $(topic:current-window)[current window]. + Optional. + **/ + @:optional + var currentWindow : Bool; + /** + Whether the tabs are in the last focused window. + Optional. + **/ + @:optional + var lastFocusedWindow : Bool; + /** + Whether the tabs have completed loading. + Optional. + **/ + @:optional + var status : TabStatus; + /** + True while the tabs are not loaded with content. + Optional. + **/ + @:optional + var discarded : Bool; + /** + True while the tabs are hidden. + Optional. + **/ + @:optional + var hidden : Bool; + /** + Match page titles against a pattern. + Optional. + **/ + @:optional + var title : String; + /** + Match tabs against one or more $(topic:match_patterns)[URL patterns]. Note that fragment identifiers are not matched. + Optional. + **/ + @:optional + var url : ts.AnyOf2>; + /** + The ID of the parent window, or $(ref:windows.WINDOW_ID_CURRENT) for the $(topic:current-window)[current window]. + Optional. + **/ + @:optional + var windowId : Float; + /** + The type of window the tabs are in. + Optional. + **/ + @:optional + var windowType : WindowType; + /** + The position of the tabs within their windows. + Optional. + **/ + @:optional + var index : Float; + /** + The CookieStoreId used for the tab. + Optional. + **/ + @:optional + var cookieStoreId : ts.AnyOf2>; + /** + The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab. + Optional. + **/ + @:optional + var openerTabId : Float; + /** + True for any screen sharing, or a string to specify type of screen sharing. + Optional. + **/ + @:optional + var screen : ts.AnyOf2; + /** + True if the tab is using the camera. + Optional. + **/ + @:optional + var camera : Bool; + /** + True if the tab is using the microphone. + Optional. + **/ + @:optional + var microphone : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/ReloadReloadPropertiesType.hx b/externs/webextension_polyfill/tabs/ReloadReloadPropertiesType.hx new file mode 100644 index 0000000..7027772 --- /dev/null +++ b/externs/webextension_polyfill/tabs/ReloadReloadPropertiesType.hx @@ -0,0 +1,10 @@ +package webextension_polyfill.tabs; + +typedef ReloadReloadPropertiesType = { + /** + Whether using any local cache. Default is false. + Optional. + **/ + @:optional + var bypassCache : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/SendMessageOptionsType.hx b/externs/webextension_polyfill/tabs/SendMessageOptionsType.hx new file mode 100644 index 0000000..e54f48a --- /dev/null +++ b/externs/webextension_polyfill/tabs/SendMessageOptionsType.hx @@ -0,0 +1,11 @@ +package webextension_polyfill.tabs; + +typedef SendMessageOptionsType = { + /** + Send a message to a specific $(topic:frame_ids)[frame] identified by frameId + instead of all frames in the tab. + Optional. + **/ + @:optional + var frameId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/SharingState.hx b/externs/webextension_polyfill/tabs/SharingState.hx new file mode 100644 index 0000000..3c85ae8 --- /dev/null +++ b/externs/webextension_polyfill/tabs/SharingState.hx @@ -0,0 +1,22 @@ +package webextension_polyfill.tabs; + +/** + Tab sharing state for screen, microphone and camera. +**/ +typedef SharingState = { + /** + If the tab is sharing the screen the value will be one of "Screen", "Window", or "Application", + or undefined if not screen sharing. + Optional. + **/ + @:optional + var screen : String; + /** + True if the tab is using the camera. + **/ + var camera : Bool; + /** + True if the tab is using the microphone. + **/ + var microphone : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/Static.hx b/externs/webextension_polyfill/tabs/Static.hx new file mode 100644 index 0000000..9f3968d --- /dev/null +++ b/externs/webextension_polyfill/tabs/Static.hx @@ -0,0 +1,219 @@ +package webextension_polyfill.tabs; + +typedef Static = { + /** + Retrieves details about the specified tab. + **/ + function get(tabId:Float):js.lib.Promise; + /** + Gets the tab that this script call is being made from. May be undefined if called from a non-tab context (for example: a + background page or popup view). + **/ + function getCurrent():js.lib.Promise; + /** + Connects to the content script(s) in the specified tab. The $(ref:runtime.onConnect) + event is fired in each content script running in the specified tab for the current extension. For more details, + see $(topic:messaging)[Content Script Messaging]. + **/ + function connect(tabId:Float, ?connectInfo:ConnectConnectInfoType):webextension_polyfill.runtime.Port; + /** + Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response + is sent back. The $(ref:runtime.onMessage) event is fired in each content script running in the specified tab for the + current extension. + **/ + function sendMessage(tabId:Float, message:Dynamic, ?options:SendMessageOptionsType):js.lib.Promise; + /** + Creates a new tab. + **/ + function create(createProperties:CreateCreatePropertiesType):js.lib.Promise; + /** + Duplicates a tab. + **/ + function duplicate(tabId:Float, ?duplicateProperties:DuplicateDuplicatePropertiesType):js.lib.Promise; + /** + Gets all tabs that have the specified properties, or all tabs if no properties are specified. + **/ + function query(queryInfo:QueryQueryInfoType):js.lib.Promise>; + /** + Highlights the given tabs. + **/ + function highlight(highlightInfo:HighlightHighlightInfoType):js.lib.Promise; + /** + Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified. + + Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified. + **/ + @:overload(function(updateProperties:UpdateUpdatePropertiesType):js.lib.Promise { }) + function update(tabId:Null, updateProperties:UpdateUpdatePropertiesType):js.lib.Promise; + /** + Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and + from normal (window.type === "normal") windows. + **/ + function move(tabIds:ts.AnyOf2>, moveProperties:MoveMovePropertiesType):js.lib.Promise>>; + /** + Reload a tab. + **/ + function reload(?tabId:Float, ?reloadProperties:ReloadReloadPropertiesType):js.lib.Promise; + /** + Warm up a tab + **/ + function warmup(tabId:Float):Void; + /** + Closes one or more tabs. + **/ + function remove(tabIds:ts.AnyOf2>):js.lib.Promise; + /** + discards one or more tabs. + **/ + function discard(tabIds:ts.AnyOf2>):js.lib.Promise; + /** + Detects the primary language of the content in a tab. + **/ + function detectLanguage(?tabId:Float):js.lib.Promise; + /** + Toggles reader mode for the document in the tab. + **/ + function toggleReaderMode(?tabId:Float):js.lib.Promise; + /** + Captures an area of a specified tab. You must have $(topic:declare_permissions)[<all_urls>] + permission to use this method. + **/ + function captureTab(?tabId:Float, ?options:webextension_polyfill.extensiontypes.ImageDetails):js.lib.Promise; + /** + Captures an area of the currently active tab in the specified window. You must have $(topic:declare_permissions) + [<all_urls>] permission to use this method. + **/ + function captureVisibleTab(?windowId:Float, ?options:webextension_polyfill.extensiontypes.ImageDetails):js.lib.Promise; + /** + Injects JavaScript code into a page. For details, see the $(topic:content_scripts)[programmatic injection] + section of the content scripts doc. + + Injects JavaScript code into a page. For details, see the $(topic:content_scripts)[programmatic injection] + section of the content scripts doc. + **/ + @:overload(function(details:webextension_polyfill.extensiontypes.InjectDetails):js.lib.Promise> { }) + function executeScript(tabId:Null, details:webextension_polyfill.extensiontypes.InjectDetails):js.lib.Promise>; + /** + Injects CSS into a page. For details, see the $(topic:content_scripts)[programmatic injection] + section of the content scripts doc. + + Injects CSS into a page. For details, see the $(topic:content_scripts)[programmatic injection] + section of the content scripts doc. + **/ + @:overload(function(details:webextension_polyfill.extensiontypes.InjectDetails):js.lib.Promise { }) + function insertCSS(tabId:Null, details:webextension_polyfill.extensiontypes.InjectDetails):js.lib.Promise; + /** + Removes injected CSS from a page. For details, see the $(topic:content_scripts)[programmatic injection] + section of the content scripts doc. + + Removes injected CSS from a page. For details, see the $(topic:content_scripts)[programmatic injection] + section of the content scripts doc. + **/ + @:overload(function(details:webextension_polyfill.extensiontypes.InjectDetails):js.lib.Promise { }) + function removeCSS(tabId:Null, details:webextension_polyfill.extensiontypes.InjectDetails):js.lib.Promise; + /** + Zooms a specified tab. + + Zooms a specified tab. + **/ + @:overload(function(zoomFactor:Float):js.lib.Promise { }) + function setZoom(tabId:Null, zoomFactor:Float):js.lib.Promise; + /** + Gets the current zoom factor of a specified tab. + **/ + function getZoom(?tabId:Float):js.lib.Promise; + /** + Sets the zoom settings for a specified tab, which define how zoom changes are handled. + These settings are reset to defaults upon navigating the tab. + + Sets the zoom settings for a specified tab, which define how zoom changes are handled. + These settings are reset to defaults upon navigating the tab. + **/ + @:overload(function(zoomSettings:ZoomSettings):js.lib.Promise { }) + function setZoomSettings(tabId:Null, zoomSettings:ZoomSettings):js.lib.Promise; + /** + Gets the current zoom settings of a specified tab. + **/ + function getZoomSettings(?tabId:Float):js.lib.Promise; + /** + Prints page in active tab. + **/ + function print():Void; + /** + Shows print preview for page in active tab. + **/ + function printPreview():js.lib.Promise; + /** + Saves page in active tab as a PDF file. + **/ + function saveAsPDF(pageSettings:PageSettings):js.lib.Promise; + /** + Shows one or more tabs. + **/ + function show(tabIds:ts.AnyOf2>):js.lib.Promise; + /** + Hides one or more tabs. The "tabHide" permission is required to hide tabs. Not all tabs are hidable. + Returns an array of hidden tabs. + **/ + function hide(tabIds:ts.AnyOf2>):js.lib.Promise>; + /** + Removes an array of tabs from their lines of succession and prepends or appends them in a chain to another tab. + **/ + function moveInSuccession(tabIds:Array, ?tabId:Float, ?options:MoveInSuccessionOptionsType):Void; + /** + Navigate to next page in tab's history, if available + **/ + function goForward(?tabId:Float):js.lib.Promise; + /** + Navigate to previous page in tab's history, if available. + **/ + function goBack(?tabId:Float):js.lib.Promise; + /** + Fired when a tab is created. Note that the tab's URL may not be set at the time this event fired, + but you can listen to onUpdated events to be notified when a URL is set. + **/ + var onCreated : webextension_polyfill.events.Event<(tab:Tab) -> Void>; + /** + Fired when a tab is updated. + **/ + var onUpdated : OnUpdatedEvent; + /** + Fired when a tab is moved within a window. Only one move event is fired, representing the tab the user directly moved. + Move events are not fired for the other tabs that must move in response. This event is not fired when a tab is moved + between windows. For that, see $(ref:tabs.onDetached). + **/ + var onMoved : webextension_polyfill.events.Event<(tabId:Float, moveInfo:OnMovedMoveInfoType) -> Void>; + /** + Fires when the active tab in a window changes. Note that the tab's URL may not be set at the time this event fired, + but you can listen to onUpdated events to be notified when a URL is set. + **/ + var onActivated : webextension_polyfill.events.Event<(activeInfo:OnActivatedActiveInfoType) -> Void>; + /** + Fired when the highlighted or selected tabs in a window changes. + **/ + var onHighlighted : webextension_polyfill.events.Event<(highlightInfo:OnHighlightedHighlightInfoType) -> Void>; + /** + Fired when a tab is detached from a window, for example because it is being moved between windows. + **/ + var onDetached : webextension_polyfill.events.Event<(tabId:Float, detachInfo:OnDetachedDetachInfoType) -> Void>; + /** + Fired when a tab is attached to a window, for example because it was moved between windows. + **/ + var onAttached : webextension_polyfill.events.Event<(tabId:Float, attachInfo:OnAttachedAttachInfoType) -> Void>; + /** + Fired when a tab is closed. + **/ + var onRemoved : webextension_polyfill.events.Event<(tabId:Float, removeInfo:OnRemovedRemoveInfoType) -> Void>; + /** + Fired when a tab is replaced with another tab due to prerendering or instant. + **/ + var onReplaced : webextension_polyfill.events.Event<(addedTabId:Float, removedTabId:Float) -> Void>; + /** + Fired when a tab is zoomed. + **/ + var onZoomChange : webextension_polyfill.events.Event<(ZoomChangeInfo:OnZoomChangeZoomChangeInfoType) -> Void>; + /** + An ID which represents the absence of a browser tab. + **/ + var TAB_ID_NONE : Int; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/Tab.hx b/externs/webextension_polyfill/tabs/Tab.hx new file mode 100644 index 0000000..2400158 --- /dev/null +++ b/externs/webextension_polyfill/tabs/Tab.hx @@ -0,0 +1,169 @@ +package webextension_polyfill.tabs; + +typedef Tab = { + /** + 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. + Optional. + **/ + @:optional + var id : Float; + /** + The zero-based index of the tab within its window. + **/ + var index : Float; + /** + The ID of the window the tab is contained within. + Optional. + **/ + @:optional + var windowId : Float; + /** + The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists. + Optional. + **/ + @:optional + var openerTabId : Float; + /** + Whether the tab is highlighted. Works as an alias of active + **/ + var highlighted : Bool; + /** + Whether the tab is active in its window. (Does not necessarily mean the window is focused.) + **/ + var active : Bool; + /** + Whether the tab is pinned. + **/ + var pinned : Bool; + /** + The last time the tab was accessed as the number of milliseconds since epoch. + Optional. + **/ + @:optional + var lastAccessed : Float; + /** + 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. + Optional. + **/ + @:optional + var audible : Bool; + /** + Whether the tab can be discarded automatically by the browser when resources are low. + Optional. + **/ + @:optional + var autoDiscardable : Bool; + /** + Current tab muted state and the reason for the last state change. + Optional. + **/ + @:optional + var mutedInfo : MutedInfo; + /** + The URL the tab is displaying. This property is only present if the extension's manifest includes the "tabs" + permission. + Optional. + **/ + @:optional + var url : String; + /** + The title of the tab. This property is only present if the extension's manifest includes the "tabs" + permission. + Optional. + **/ + @:optional + var title : String; + /** + 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. + Optional. + **/ + @:optional + var favIconUrl : String; + /** + Either loading or complete. + Optional. + **/ + @:optional + var status : String; + /** + True while the tab is not loaded with content. + Optional. + **/ + @:optional + var discarded : Bool; + /** + Whether the tab is in an incognito window. + **/ + var incognito : Bool; + /** + The width of the tab in pixels. + Optional. + **/ + @:optional + var width : Float; + /** + The height of the tab in pixels. + Optional. + **/ + @:optional + var height : Float; + /** + True if the tab is hidden. + Optional. + **/ + @:optional + var hidden : Bool; + /** + The session ID used to uniquely identify a Tab obtained from the $(ref:sessions) API. + Optional. + **/ + @:optional + var sessionId : String; + /** + The CookieStoreId used for the tab. + Optional. + **/ + @:optional + var cookieStoreId : String; + /** + Whether the document in the tab can be rendered in reader mode. + Optional. + **/ + @:optional + var isArticle : Bool; + /** + Whether the document in the tab is being rendered in reader mode. + Optional. + **/ + @:optional + var isInReaderMode : Bool; + /** + Current tab sharing state for screen, microphone and camera. + Optional. + **/ + @:optional + var sharingState : SharingState; + /** + Whether the tab is drawing attention. + Optional. + **/ + @:optional + var attention : Bool; + /** + The ID of this tab's successor, if any; $(ref:tabs.TAB_ID_NONE) otherwise. + Optional. + **/ + @:optional + var successorTabId : Float; + /** + The URL the tab is navigating to, before it has committed. This property is only present if the extension's manifest + includes the "tabs" permission and there is a pending navigation. + Optional. + **/ + @:optional + var pendingUrl : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/TabStatus.hx b/externs/webextension_polyfill/tabs/TabStatus.hx new file mode 100644 index 0000000..441c7a5 --- /dev/null +++ b/externs/webextension_polyfill/tabs/TabStatus.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.tabs; + +/** + Whether the tabs have completed loading. +**/ +typedef TabStatus = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/UpdateFilter.hx b/externs/webextension_polyfill/tabs/UpdateFilter.hx new file mode 100644 index 0000000..772ae4d --- /dev/null +++ b/externs/webextension_polyfill/tabs/UpdateFilter.hx @@ -0,0 +1,30 @@ +package webextension_polyfill.tabs; + +/** + An object describing filters to apply to tabs.onUpdated events. +**/ +typedef UpdateFilter = { + /** + 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. + Optional. + **/ + @:optional + var urls : Array; + /** + A list of property names. Events that do not match any of the names will be filtered out. + Optional. + **/ + @:optional + var properties : Array; + /** + Optional. + **/ + @:optional + var tabId : Float; + /** + Optional. + **/ + @:optional + var windowId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/UpdatePropertyName.hx b/externs/webextension_polyfill/tabs/UpdatePropertyName.hx new file mode 100644 index 0000000..67558d6 --- /dev/null +++ b/externs/webextension_polyfill/tabs/UpdatePropertyName.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.tabs; + +/** + Event names supported in onUpdated. +**/ +typedef UpdatePropertyName = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/UpdateUpdatePropertiesType.hx b/externs/webextension_polyfill/tabs/UpdateUpdatePropertiesType.hx new file mode 100644 index 0000000..6b26f16 --- /dev/null +++ b/externs/webextension_polyfill/tabs/UpdateUpdatePropertiesType.hx @@ -0,0 +1,58 @@ +package webextension_polyfill.tabs; + +typedef UpdateUpdatePropertiesType = { + /** + A URL to navigate the tab to. + Optional. + **/ + @:optional + var url : String; + /** + Whether the tab should be active. Does not affect whether the window is focused (see $(ref:windows.update)). + Optional. + **/ + @:optional + var active : Bool; + /** + Whether the tab should be discarded automatically by the browser when resources are low. + Optional. + **/ + @:optional + var autoDiscardable : Bool; + /** + Adds or removes the tab from the current selection. + Optional. + **/ + @:optional + var highlighted : Bool; + /** + Whether the tab should be pinned. + Optional. + **/ + @:optional + var pinned : Bool; + /** + Whether the tab should be muted. + Optional. + **/ + @:optional + var muted : Bool; + /** + The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab. + Optional. + **/ + @:optional + var openerTabId : Float; + /** + Whether the load should replace the current history entry for the tab. + Optional. + **/ + @:optional + var loadReplace : Bool; + /** + The ID of this tab's successor. If specified, the successor tab must be in the same window as this tab. + Optional. + **/ + @:optional + var successorTabId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/WindowType.hx b/externs/webextension_polyfill/tabs/WindowType.hx new file mode 100644 index 0000000..1d340a1 --- /dev/null +++ b/externs/webextension_polyfill/tabs/WindowType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.tabs; + +/** + The type of window. +**/ +typedef WindowType = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/ZoomSettings.hx b/externs/webextension_polyfill/tabs/ZoomSettings.hx new file mode 100644 index 0000000..7812b50 --- /dev/null +++ b/externs/webextension_polyfill/tabs/ZoomSettings.hx @@ -0,0 +1,27 @@ +package webextension_polyfill.tabs; + +/** + Defines how zoom changes in a tab are handled and at what scope. +**/ +typedef ZoomSettings = { + /** + Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to + automatic. + Optional. + **/ + @:optional + var mode : ZoomSettingsMode; + /** + 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. + Optional. + **/ + @:optional + var scope : ZoomSettingsScope; + /** + Used to return the default zoom level for the current tab in calls to tabs.getZoomSettings. + Optional. + **/ + @:optional + var defaultZoomFactor : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/ZoomSettingsMode.hx b/externs/webextension_polyfill/tabs/ZoomSettingsMode.hx new file mode 100644 index 0000000..8b220ac --- /dev/null +++ b/externs/webextension_polyfill/tabs/ZoomSettingsMode.hx @@ -0,0 +1,15 @@ +package webextension_polyfill.tabs; + +/** + Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to + automatic. + + "automatic": Zoom changes are handled automatically by the browser. + "manual": Overrides the automatic handling of zoom changes. The onZoomChange event will still be dispatched, + and it is the responsibility of the extension to listen for this event and manually scale the page. + This mode does not support per-origin zooming, and will thus ignore the scope + zoom setting and assume per-tab. + "disabled": Disables all zooming in the tab. The tab will revert to the default zoom level, + and all attempted zoom changes will be ignored. +**/ +typedef ZoomSettingsMode = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/tabs/ZoomSettingsScope.hx b/externs/webextension_polyfill/tabs/ZoomSettingsScope.hx new file mode 100644 index 0000000..6f2d263 --- /dev/null +++ b/externs/webextension_polyfill/tabs/ZoomSettingsScope.hx @@ -0,0 +1,15 @@ +package webextension_polyfill.tabs; + +/** + 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. + + "per-origin": Zoom changes will persist in the zoomed page's origin, i.e. all other tabs navigated to that same origin + will be zoomed as well. Moreover, per-origin zoom changes are saved with the origin, + meaning that when navigating to other pages in the same origin, they will all be zoomed to the same zoom factor. + The per-origin scope is only available in the automatic mode. + "per-tab": Zoom changes only take effect in this tab, and zoom changes in other tabs will not affect the zooming of this + tab. Also, per-tab zoom changes are reset on navigation; navigating a tab will always load pages with their + per-origin zoom factors. +**/ +typedef ZoomSettingsScope = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/theme/Static.hx b/externs/webextension_polyfill/theme/Static.hx new file mode 100644 index 0000000..7f15b7d --- /dev/null +++ b/externs/webextension_polyfill/theme/Static.hx @@ -0,0 +1,23 @@ +package webextension_polyfill.theme; + +typedef Static = { + /** + Returns the current theme for the specified window or the last focused window. + **/ + function getCurrent(?windowId:Float):js.lib.Promise; + /** + Make complete updates to the theme. Resolves when the update has completed. + + Make complete updates to the theme. Resolves when the update has completed. + **/ + @:overload(function(details:webextension_polyfill.manifest.ThemeType):js.lib.Promise { }) + function update(windowId:Null, details:webextension_polyfill.manifest.ThemeType):js.lib.Promise; + /** + Removes the updates made to the theme. + **/ + function reset(?windowId:Float):js.lib.Promise; + /** + Fired when a new theme has been applied + **/ + var onUpdated : webextension_polyfill.events.Event<(updateInfo:ThemeUpdateInfo) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/theme/ThemeUpdateInfo.hx b/externs/webextension_polyfill/theme/ThemeUpdateInfo.hx new file mode 100644 index 0000000..56bdf1d --- /dev/null +++ b/externs/webextension_polyfill/theme/ThemeUpdateInfo.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.theme; + +/** + Info provided in the onUpdated listener. +**/ +typedef ThemeUpdateInfo = { + /** + The new theme after update + **/ + var theme : ThemeUpdateInfoThemeType; + /** + The id of the window the theme has been applied to + Optional. + **/ + @:optional + var windowId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/theme/ThemeUpdateInfoThemeType.hx b/externs/webextension_polyfill/theme/ThemeUpdateInfoThemeType.hx new file mode 100644 index 0000000..c956f95 --- /dev/null +++ b/externs/webextension_polyfill/theme/ThemeUpdateInfoThemeType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.theme; + +/** + The new theme after update +**/ +typedef ThemeUpdateInfoThemeType = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/topsites/GetOptionsType.hx b/externs/webextension_polyfill/topsites/GetOptionsType.hx new file mode 100644 index 0000000..ba530e4 --- /dev/null +++ b/externs/webextension_polyfill/topsites/GetOptionsType.hx @@ -0,0 +1,47 @@ +package webextension_polyfill.topsites; + +typedef GetOptionsType = { + /** + The number of top sites to return, defaults to the value used by Firefox + Optional. + **/ + @:optional + var limit : Float; + /** + Limit the result to a single top site link per domain + Optional. + **/ + @:optional + var onePerDomain : Bool; + /** + Include sites that the user has blocked from appearing on the Firefox new tab. + Optional. + **/ + @:optional + var includeBlocked : Bool; + /** + Include sites favicon if available. + Optional. + **/ + @:optional + var includeFavicon : Bool; + /** + Include sites that the user has pinned on the Firefox new tab. + Optional. + **/ + @:optional + var includePinned : Bool; + /** + Include search shortcuts appearing on the Firefox new tab. + Optional. + **/ + @:optional + var includeSearchShortcuts : Bool; + /** + Return the sites that exactly appear on the user's new-tab page. When true, all other options are ignored except limit + and includeFavicon. If the user disabled newtab Top Sites, the newtab parameter will be ignored. + Optional. + **/ + @:optional + var newtab : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/topsites/MostVisitedURL.hx b/externs/webextension_polyfill/topsites/MostVisitedURL.hx new file mode 100644 index 0000000..057f615 --- /dev/null +++ b/externs/webextension_polyfill/topsites/MostVisitedURL.hx @@ -0,0 +1,29 @@ +package webextension_polyfill.topsites; + +/** + An object encapsulating a most visited URL, such as the URLs on the new tab page. +**/ +typedef MostVisitedURL = { + /** + The most visited URL. + **/ + var url : String; + /** + The title of the page. + Optional. + **/ + @:optional + var title : String; + /** + Data URL for the favicon, if available. + Optional. + **/ + @:optional + var favicon : String; + /** + The entry type, either url for a normal page link, or search for a search shortcut. + Optional. + **/ + @:optional + var type : MostVisitedURLTypeEnum; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/topsites/MostVisitedURLTypeEnum.hx b/externs/webextension_polyfill/topsites/MostVisitedURLTypeEnum.hx new file mode 100644 index 0000000..79a707a --- /dev/null +++ b/externs/webextension_polyfill/topsites/MostVisitedURLTypeEnum.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.topsites; + +/** + The entry type, either url for a normal page link, or search for a search shortcut. +**/ +typedef MostVisitedURLTypeEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/topsites/Static.hx b/externs/webextension_polyfill/topsites/Static.hx new file mode 100644 index 0000000..e2aa1dc --- /dev/null +++ b/externs/webextension_polyfill/topsites/Static.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.topsites; + +typedef Static = { + /** + Gets a list of top sites. + **/ + function get(?options:GetOptionsType):js.lib.Promise>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/types/LevelOfControl.hx b/externs/webextension_polyfill/types/LevelOfControl.hx new file mode 100644 index 0000000..ffb3c89 --- /dev/null +++ b/externs/webextension_polyfill/types/LevelOfControl.hx @@ -0,0 +1,9 @@ +package webextension_polyfill.types; + +/** + One of
  • not_controllable: cannot be controlled by any extension
  • + controlled_by_other_extensions: controlled by extensions with higher precedence
  • + controllable_by_this_extension: can be controlled by this extension
  • controlled_by_this_extension + : controlled by this extension
+**/ +typedef LevelOfControl = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/types/Setting.hx b/externs/webextension_polyfill/types/Setting.hx new file mode 100644 index 0000000..2c25d23 --- /dev/null +++ b/externs/webextension_polyfill/types/Setting.hx @@ -0,0 +1,20 @@ +package webextension_polyfill.types; + +typedef Setting = { + /** + Gets the value of a setting. + **/ + function get(details:SettingGetDetailsType):js.lib.Promise; + /** + Sets the value of a setting. + **/ + function set(details:SettingSetDetailsType):js.lib.Promise; + /** + Clears the setting, restoring any default value. + **/ + function clear(details:SettingClearDetailsType):js.lib.Promise; + /** + Fired after the setting changes. + **/ + var onChange : webextension_polyfill.events.Event<(details:SettingOnChangeDetailsType) -> Void>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/types/SettingClearDetailsType.hx b/externs/webextension_polyfill/types/SettingClearDetailsType.hx new file mode 100644 index 0000000..973c153 --- /dev/null +++ b/externs/webextension_polyfill/types/SettingClearDetailsType.hx @@ -0,0 +1,13 @@ +package webextension_polyfill.types; + +/** + Which setting to clear. +**/ +typedef SettingClearDetailsType = { + /** + Where to clear the setting (default: regular). + Optional. + **/ + @:optional + var scope : SettingScope; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/types/SettingGetCallbackDetailsType.hx b/externs/webextension_polyfill/types/SettingGetCallbackDetailsType.hx new file mode 100644 index 0000000..b3292eb --- /dev/null +++ b/externs/webextension_polyfill/types/SettingGetCallbackDetailsType.hx @@ -0,0 +1,22 @@ +package webextension_polyfill.types; + +/** + Details of the currently effective value. +**/ +typedef SettingGetCallbackDetailsType = { + /** + The value of the setting. + **/ + var value : Dynamic; + /** + The level of control of the setting. + **/ + var levelOfControl : LevelOfControl; + /** + Whether the effective value is specific to the incognito session.
This property will only + be present if the incognito property in the details parameter of get() was true. + Optional. + **/ + @:optional + var incognitoSpecific : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/types/SettingGetDetailsType.hx b/externs/webextension_polyfill/types/SettingGetDetailsType.hx new file mode 100644 index 0000000..a6256b8 --- /dev/null +++ b/externs/webextension_polyfill/types/SettingGetDetailsType.hx @@ -0,0 +1,13 @@ +package webextension_polyfill.types; + +/** + Which setting to consider. +**/ +typedef SettingGetDetailsType = { + /** + Whether to return the value that applies to the incognito session (default false). + Optional. + **/ + @:optional + var incognito : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/types/SettingOnChangeDetailsType.hx b/externs/webextension_polyfill/types/SettingOnChangeDetailsType.hx new file mode 100644 index 0000000..ec66191 --- /dev/null +++ b/externs/webextension_polyfill/types/SettingOnChangeDetailsType.hx @@ -0,0 +1,19 @@ +package webextension_polyfill.types; + +typedef SettingOnChangeDetailsType = { + /** + The value of the setting after the change. + **/ + var value : Dynamic; + /** + The level of control of the setting. + **/ + var levelOfControl : LevelOfControl; + /** + Whether the value that has changed is specific to the incognito session.
This property will only + be present if the user has enabled the extension in incognito mode. + Optional. + **/ + @:optional + var incognitoSpecific : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/types/SettingScope.hx b/externs/webextension_polyfill/types/SettingScope.hx new file mode 100644 index 0000000..a0fd6cd --- /dev/null +++ b/externs/webextension_polyfill/types/SettingScope.hx @@ -0,0 +1,12 @@ +package webextension_polyfill.types; + +/** + The scope of the Setting. One of
  • regular: setting for the regular profile (which is inherited by the + incognito profile if not overridden elsewhere),
  • regular_only: setting for the regular profile only + (not inherited by the incognito profile),
  • incognito_persistent: setting for the incognito profile + that survives browser restarts (overrides regular preferences),
  • incognito_session_only + : setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito + session ends (overrides regular and incognito_persistent preferences).
Only regular + is supported by Firefox at this time. +**/ +typedef SettingScope = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/types/SettingSetDetailsType.hx b/externs/webextension_polyfill/types/SettingSetDetailsType.hx new file mode 100644 index 0000000..cb12db8 --- /dev/null +++ b/externs/webextension_polyfill/types/SettingSetDetailsType.hx @@ -0,0 +1,18 @@ +package webextension_polyfill.types; + +/** + Which setting to change. +**/ +typedef SettingSetDetailsType = { + /** + The value of the setting.
Note that every setting has a specific value type, which is described together with the + setting. An extension should not set a value of a different type. + **/ + var value : Dynamic; + /** + Where to set the setting (default: regular). + Optional. + **/ + @:optional + var scope : SettingScope; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/types/Static.hx b/externs/webextension_polyfill/types/Static.hx new file mode 100644 index 0000000..fcb61dd --- /dev/null +++ b/externs/webextension_polyfill/types/Static.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.types; + +typedef Static = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/urlbar/EngagementState.hx b/externs/webextension_polyfill/urlbar/EngagementState.hx new file mode 100644 index 0000000..7af4a19 --- /dev/null +++ b/externs/webextension_polyfill/urlbar/EngagementState.hx @@ -0,0 +1,9 @@ +package webextension_polyfill.urlbar; + +/** + The state of an engagement made with the urlbar by the user. start: The user has started an engagement. + engagement: The user has completed an engagement by picking a result. abandonment + : The user has abandoned their engagement, for example by blurring the urlbar. discard + : The engagement ended in a way that should be ignored by listeners. +**/ +typedef EngagementState = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/urlbar/OnBehaviorRequestedEvent.hx b/externs/webextension_polyfill/urlbar/OnBehaviorRequestedEvent.hx new file mode 100644 index 0000000..7e82917 --- /dev/null +++ b/externs/webextension_polyfill/urlbar/OnBehaviorRequestedEvent.hx @@ -0,0 +1,19 @@ +package webextension_polyfill.urlbar; + +/** + Before a query starts, this event is fired for the given provider. Its purpose is to request the provider's behavior for + the query. The listener should return a behavior in response. By default, providers are inactive, + so if your provider should always be inactive, you don't need to listen for this event. +**/ +typedef OnBehaviorRequestedEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(query:Query) -> OnBehaviorRequestedReturnEnum, providerName:String):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(query:Query) -> OnBehaviorRequestedReturnEnum):Void; + function hasListener(callback:(query:Query) -> OnBehaviorRequestedReturnEnum):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/urlbar/OnBehaviorRequestedReturnEnum.hx b/externs/webextension_polyfill/urlbar/OnBehaviorRequestedReturnEnum.hx new file mode 100644 index 0000000..36103c2 --- /dev/null +++ b/externs/webextension_polyfill/urlbar/OnBehaviorRequestedReturnEnum.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.urlbar; + +/** + The behavior of the provider for the query. +**/ +typedef OnBehaviorRequestedReturnEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/urlbar/OnEngagementEvent.hx b/externs/webextension_polyfill/urlbar/OnEngagementEvent.hx new file mode 100644 index 0000000..47e1f65 --- /dev/null +++ b/externs/webextension_polyfill/urlbar/OnEngagementEvent.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.urlbar; + +/** + This event is fired when the user starts and ends an engagement with the urlbar. +**/ +typedef OnEngagementEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(state:EngagementState) -> Void, providerName:String):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(state:EngagementState) -> Void):Void; + function hasListener(callback:(state:EngagementState) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/urlbar/OnQueryCanceledEvent.hx b/externs/webextension_polyfill/urlbar/OnQueryCanceledEvent.hx new file mode 100644 index 0000000..0661b6f --- /dev/null +++ b/externs/webextension_polyfill/urlbar/OnQueryCanceledEvent.hx @@ -0,0 +1,18 @@ +package webextension_polyfill.urlbar; + +/** + This event is fired for the given provider when a query is canceled. The listener should stop any ongoing fetch or + creation of results and clean up its resources. +**/ +typedef OnQueryCanceledEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(query:Query) -> Void, providerName:String):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(query:Query) -> Void):Void; + function hasListener(callback:(query:Query) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/urlbar/OnResultPickedEvent.hx b/externs/webextension_polyfill/urlbar/OnResultPickedEvent.hx new file mode 100644 index 0000000..e6ea2be --- /dev/null +++ b/externs/webextension_polyfill/urlbar/OnResultPickedEvent.hx @@ -0,0 +1,20 @@ +package webextension_polyfill.urlbar; + +/** + Typically, a provider includes a url property in its results' payloads. + When the user picks a result with a URL, Firefox automatically loads the URL. URLs don't make sense for every result + type, however. When the user picks a result without a URL, this event is fired. The provider should take an appropriate + action in response. Currently the only applicable ResultTypes are dynamic and tip. +**/ +typedef OnResultPickedEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(payload:OnResultPickedPayloadType, elementName:String) -> Void, providerName:String):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(payload:OnResultPickedPayloadType, elementName:String) -> Void):Void; + function hasListener(callback:(payload:OnResultPickedPayloadType, elementName:String) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/urlbar/OnResultPickedPayloadType.hx b/externs/webextension_polyfill/urlbar/OnResultPickedPayloadType.hx new file mode 100644 index 0000000..7a4f82b --- /dev/null +++ b/externs/webextension_polyfill/urlbar/OnResultPickedPayloadType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.urlbar; + +/** + The payload of the result that was picked. +**/ +typedef OnResultPickedPayloadType = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/urlbar/OnResultsRequestedEvent.hx b/externs/webextension_polyfill/urlbar/OnResultsRequestedEvent.hx new file mode 100644 index 0000000..e415996 --- /dev/null +++ b/externs/webextension_polyfill/urlbar/OnResultsRequestedEvent.hx @@ -0,0 +1,19 @@ +package webextension_polyfill.urlbar; + +/** + When a query starts, this event is fired for the given provider if the provider is active for the query and there are no + other providers that are restricting. Its purpose is to request the provider's results for the query. + The listener should return a list of results in response. +**/ +typedef OnResultsRequestedEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(query:Query) -> Array, providerName:String):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(query:Query) -> Array):Void; + function hasListener(callback:(query:Query) -> Array):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/urlbar/Query.hx b/externs/webextension_polyfill/urlbar/Query.hx new file mode 100644 index 0000000..b0b26e8 --- /dev/null +++ b/externs/webextension_polyfill/urlbar/Query.hx @@ -0,0 +1,23 @@ +package webextension_polyfill.urlbar; + +/** + A query performed in the urlbar. +**/ +typedef Query = { + /** + Whether the query's browser context is private. + **/ + var isPrivate : Bool; + /** + The maximum number of results shown to the user. + **/ + var maxResults : Float; + /** + The query's search string. + **/ + var searchString : String; + /** + List of acceptable source types to return. + **/ + var sources : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/urlbar/Result.hx b/externs/webextension_polyfill/urlbar/Result.hx new file mode 100644 index 0000000..fb2417a --- /dev/null +++ b/externs/webextension_polyfill/urlbar/Result.hx @@ -0,0 +1,25 @@ +package webextension_polyfill.urlbar; + +/** + A result of a query. Queries can have many results. Each result is created by a provider. +**/ +typedef Result = { + /** + An object with arbitrary properties depending on the result's type. + **/ + var payload : ResultPayloadType; + /** + The result's source. + **/ + var source : SourceType; + /** + The result's type. + **/ + var type : ResultType; + /** + Suggest a preferred position for this result within the result set. + Optional. + **/ + @:optional + var suggestedIndex : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/urlbar/ResultPayloadType.hx b/externs/webextension_polyfill/urlbar/ResultPayloadType.hx new file mode 100644 index 0000000..694d751 --- /dev/null +++ b/externs/webextension_polyfill/urlbar/ResultPayloadType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.urlbar; + +/** + An object with arbitrary properties depending on the result's type. +**/ +typedef ResultPayloadType = { }; \ No newline at end of file diff --git a/externs/webextension_polyfill/urlbar/ResultType.hx b/externs/webextension_polyfill/urlbar/ResultType.hx new file mode 100644 index 0000000..658edf2 --- /dev/null +++ b/externs/webextension_polyfill/urlbar/ResultType.hx @@ -0,0 +1,9 @@ +package webextension_polyfill.urlbar; + +/** + Possible types of results. dynamic: A result whose view and payload are specified by the extension. + remote_tab: A synced tab from another device. search: A search suggestion from a search engine. + tab: An open tab in the browser. tip: An actionable message to help the user with their query. + url: A URL that's not one of the other types. +**/ +typedef ResultType = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/urlbar/SearchOptions.hx b/externs/webextension_polyfill/urlbar/SearchOptions.hx new file mode 100644 index 0000000..5e13657 --- /dev/null +++ b/externs/webextension_polyfill/urlbar/SearchOptions.hx @@ -0,0 +1,13 @@ +package webextension_polyfill.urlbar; + +/** + Options to the search function. +**/ +typedef SearchOptions = { + /** + Whether to focus the input field and select its contents. + Optional. + **/ + @:optional + var focus : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/urlbar/SourceType.hx b/externs/webextension_polyfill/urlbar/SourceType.hx new file mode 100644 index 0000000..1b8755f --- /dev/null +++ b/externs/webextension_polyfill/urlbar/SourceType.hx @@ -0,0 +1,10 @@ +package webextension_polyfill.urlbar; + +/** + Possible sources of results. bookmarks: The result comes from the user's bookmarks. history + : The result comes from the user's history. local: The result comes from some local source not covered by + another source type. network: The result comes from some network source not covered by another source type. + search: The result comes from a search engine. tabs: The result is an open tab in the browser + or a synced tab from another device. +**/ +typedef SourceType = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/urlbar/Static.hx b/externs/webextension_polyfill/urlbar/Static.hx new file mode 100644 index 0000000..e04f65d --- /dev/null +++ b/externs/webextension_polyfill/urlbar/Static.hx @@ -0,0 +1,48 @@ +package webextension_polyfill.urlbar; + +typedef Static = { + /** + Closes the urlbar view in the current window. + **/ + function closeView():Void; + /** + Focuses the urlbar in the current window. + **/ + function focus(?select:Bool):Void; + /** + Starts a search in the urlbar in the current window. + **/ + function search(searchString:String, ?options:SearchOptions):Void; + /** + Before a query starts, this event is fired for the given provider. Its purpose is to request the provider's behavior for + the query. The listener should return a behavior in response. By default, providers are inactive, + so if your provider should always be inactive, you don't need to listen for this event. + **/ + var onBehaviorRequested : OnBehaviorRequestedEvent; + /** + This event is fired when the user starts and ends an engagement with the urlbar. + **/ + var onEngagement : OnEngagementEvent; + /** + This event is fired for the given provider when a query is canceled. The listener should stop any ongoing fetch or + creation of results and clean up its resources. + **/ + var onQueryCanceled : OnQueryCanceledEvent; + /** + When a query starts, this event is fired for the given provider if the provider is active for the query and there are no + other providers that are restricting. Its purpose is to request the provider's results for the query. + The listener should return a list of results in response. + **/ + var onResultsRequested : OnResultsRequestedEvent; + /** + Typically, a provider includes a url property in its results' payloads. + When the user picks a result with a URL, Firefox automatically loads the URL. URLs don't make sense for every result + type, however. When the user picks a result without a URL, this event is fired. The provider should take an appropriate + action in response. Currently the only applicable ResultTypes are dynamic and tip. + **/ + var onResultPicked : OnResultPickedEvent; + /** + Enables or disables the engagement telemetry. + **/ + var engagementTelemetry : webextension_polyfill.types.Setting; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/userscripts/RegisteredUserScript.hx b/externs/webextension_polyfill/userscripts/RegisteredUserScript.hx new file mode 100644 index 0000000..843f5f4 --- /dev/null +++ b/externs/webextension_polyfill/userscripts/RegisteredUserScript.hx @@ -0,0 +1,11 @@ +package webextension_polyfill.userscripts; + +/** + An object that represents a user script registered programmatically +**/ +typedef RegisteredUserScript = { + /** + Unregister a user script registered programmatically + **/ + function unregister():Void; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/userscripts/Static.hx b/externs/webextension_polyfill/userscripts/Static.hx new file mode 100644 index 0000000..46ab125 --- /dev/null +++ b/externs/webextension_polyfill/userscripts/Static.hx @@ -0,0 +1,9 @@ +package webextension_polyfill.userscripts; + +typedef Static = { + /** + Register a user script programmatically given its $(ref:userScripts.UserScriptOptions), + and resolves to a $(ref:userScripts.RegisteredUserScript) instance + **/ + function register(userScriptOptions:UserScriptOptions):Void; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/userscripts/UserScriptOptions.hx b/externs/webextension_polyfill/userscripts/UserScriptOptions.hx new file mode 100644 index 0000000..54cabda --- /dev/null +++ b/externs/webextension_polyfill/userscripts/UserScriptOptions.hx @@ -0,0 +1,59 @@ +package webextension_polyfill.userscripts; + +/** + Details of a user script +**/ +typedef UserScriptOptions = { + /** + The list of JS files to inject + **/ + var js : Array; + /** + An opaque user script metadata value + Optional. + **/ + @:optional + var scriptMetadata : webextension_polyfill.extensiontypes.PlainJSONValue; + var matches : Array; + /** + Optional. + **/ + @:optional + var excludeMatches : Array; + /** + Optional. + **/ + @:optional + var includeGlobs : Array; + /** + Optional. + **/ + @:optional + var excludeGlobs : Array; + /** + If allFrames is true, implies that the JavaScript should be injected into all frames of current page. + By default, it's false and is only injected into the top frame. + Optional. + **/ + @:optional + var allFrames : Bool; + /** + 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. + Optional. + **/ + @:optional + var matchAboutBlank : Bool; + /** + The soonest that the JavaScript will be injected into the tab. Defaults to "document_idle". + Optional. + **/ + @:optional + var runAt : webextension_polyfill.extensiontypes.RunAt; + /** + limit the set of matched tabs to those that belong to the given cookie store id + Optional. + **/ + @:optional + var cookieStoreId : ts.AnyOf2>; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/EventUrlFilters.hx b/externs/webextension_polyfill/webnavigation/EventUrlFilters.hx new file mode 100644 index 0000000..ecc97e6 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/EventUrlFilters.hx @@ -0,0 +1,5 @@ +package webextension_polyfill.webnavigation; + +typedef EventUrlFilters = { + var url : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/GetAllFramesCallbackDetailsItemType.hx b/externs/webextension_polyfill/webnavigation/GetAllFramesCallbackDetailsItemType.hx new file mode 100644 index 0000000..20b6ab1 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/GetAllFramesCallbackDetailsItemType.hx @@ -0,0 +1,26 @@ +package webextension_polyfill.webnavigation; + +typedef GetAllFramesCallbackDetailsItemType = { + /** + True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired. + Optional. + **/ + @:optional + var errorOccurred : Bool; + /** + The ID of the tab in which the frame is. + **/ + var tabId : Float; + /** + The ID of the frame. 0 indicates that this is the main frame; a positive value indicates the ID of a subframe. + **/ + var frameId : Float; + /** + ID of frame that wraps the frame. Set to -1 of no parent frame exists. + **/ + var parentFrameId : Float; + /** + The URL currently associated with this frame. + **/ + var url : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/GetAllFramesDetailsType.hx b/externs/webextension_polyfill/webnavigation/GetAllFramesDetailsType.hx new file mode 100644 index 0000000..780e54f --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/GetAllFramesDetailsType.hx @@ -0,0 +1,11 @@ +package webextension_polyfill.webnavigation; + +/** + Information about the tab to retrieve all frames from. +**/ +typedef GetAllFramesDetailsType = { + /** + The ID of the tab. + **/ + var tabId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/GetFrameCallbackDetailsType.hx b/externs/webextension_polyfill/webnavigation/GetFrameCallbackDetailsType.hx new file mode 100644 index 0000000..b54cb17 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/GetFrameCallbackDetailsType.hx @@ -0,0 +1,30 @@ +package webextension_polyfill.webnavigation; + +/** + Information about the requested frame, null if the specified frame ID and/or tab ID are invalid. +**/ +typedef GetFrameCallbackDetailsType = { + /** + True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired. + Optional. + **/ + @:optional + var errorOccurred : Bool; + /** + The URL currently associated with this frame, if the frame identified by the frameId existed at one point in the given + tab. The fact that an URL is associated with a given frameId does not imply that the corresponding frame still exists. + **/ + var url : String; + /** + The ID of the tab in which the frame is. + **/ + var tabId : Float; + /** + The ID of the frame. 0 indicates that this is the main frame; a positive value indicates the ID of a subframe. + **/ + var frameId : Float; + /** + ID of frame that wraps the frame. Set to -1 of no parent frame exists. + **/ + var parentFrameId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/GetFrameDetailsType.hx b/externs/webextension_polyfill/webnavigation/GetFrameDetailsType.hx new file mode 100644 index 0000000..b60ecde --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/GetFrameDetailsType.hx @@ -0,0 +1,21 @@ +package webextension_polyfill.webnavigation; + +/** + Information about the frame to retrieve information about. +**/ +typedef GetFrameDetailsType = { + /** + The ID of the tab in which the frame is. + **/ + var tabId : Float; + /** + The ID of the process runs the renderer for this tab. + Optional. + **/ + @:optional + var processId : Float; + /** + The ID of the frame in the given tab. + **/ + var frameId : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/OnBeforeNavigateDetailsType.hx b/externs/webextension_polyfill/webnavigation/OnBeforeNavigateDetailsType.hx new file mode 100644 index 0000000..f165465 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/OnBeforeNavigateDetailsType.hx @@ -0,0 +1,22 @@ +package webextension_polyfill.webnavigation; + +typedef OnBeforeNavigateDetailsType = { + /** + The ID of the tab in which the navigation is about to occur. + **/ + var tabId : Float; + var url : String; + /** + 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. + Frame IDs are unique for a given tab and process. + **/ + var frameId : Float; + /** + ID of frame that wraps the frame. Set to -1 of no parent frame exists. + **/ + var parentFrameId : Float; + /** + The time when the browser was about to start the navigation, in milliseconds since the epoch. + **/ + var timeStamp : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/OnBeforeNavigateEvent.hx b/externs/webextension_polyfill/webnavigation/OnBeforeNavigateEvent.hx new file mode 100644 index 0000000..35de6bc --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/OnBeforeNavigateEvent.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.webnavigation; + +/** + Fired when a navigation is about to occur. +**/ +typedef OnBeforeNavigateEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnBeforeNavigateDetailsType) -> Void, ?filters:EventUrlFilters):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnBeforeNavigateDetailsType) -> Void):Void; + function hasListener(callback:(details:OnBeforeNavigateDetailsType) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/OnCommittedDetailsType.hx b/externs/webextension_polyfill/webnavigation/OnCommittedDetailsType.hx new file mode 100644 index 0000000..b939cc4 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/OnCommittedDetailsType.hx @@ -0,0 +1,26 @@ +package webextension_polyfill.webnavigation; + +typedef OnCommittedDetailsType = { + /** + The ID of the tab in which the navigation occurs. + **/ + var tabId : Float; + var url : String; + /** + 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. + Frame IDs are unique within a tab. + **/ + var frameId : Float; + /** + Cause of the navigation. + **/ + var transitionType : TransitionType; + /** + A list of transition qualifiers. + **/ + var transitionQualifiers : Array; + /** + The time when the navigation was committed, in milliseconds since the epoch. + **/ + var timeStamp : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/OnCommittedEvent.hx b/externs/webextension_polyfill/webnavigation/OnCommittedEvent.hx new file mode 100644 index 0000000..ea56bbe --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/OnCommittedEvent.hx @@ -0,0 +1,19 @@ +package webextension_polyfill.webnavigation; + +/** + Fired when a navigation is committed. The document (and the resources it refers to, such as images and subframes) + might still be downloading, but at least part of the document has been received from the server and the browser has + decided to switch to the new document. +**/ +typedef OnCommittedEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnCommittedDetailsType) -> Void, ?filters:EventUrlFilters):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnCommittedDetailsType) -> Void):Void; + function hasListener(callback:(details:OnCommittedDetailsType) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/OnCompletedDetailsType.hx b/externs/webextension_polyfill/webnavigation/OnCompletedDetailsType.hx new file mode 100644 index 0000000..05546bf --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/OnCompletedDetailsType.hx @@ -0,0 +1,18 @@ +package webextension_polyfill.webnavigation; + +typedef OnCompletedDetailsType = { + /** + The ID of the tab in which the navigation occurs. + **/ + var tabId : Float; + var url : String; + /** + 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. + Frame IDs are unique within a tab. + **/ + var frameId : Float; + /** + The time when the document finished loading, in milliseconds since the epoch. + **/ + var timeStamp : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/OnCompletedEvent.hx b/externs/webextension_polyfill/webnavigation/OnCompletedEvent.hx new file mode 100644 index 0000000..d8ca145 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/OnCompletedEvent.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.webnavigation; + +/** + Fired when a document, including the resources it refers to, is completely loaded and initialized. +**/ +typedef OnCompletedEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnCompletedDetailsType) -> Void, ?filters:EventUrlFilters):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnCompletedDetailsType) -> Void):Void; + function hasListener(callback:(details:OnCompletedDetailsType) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/OnCreatedNavigationTargetDetailsType.hx b/externs/webextension_polyfill/webnavigation/OnCreatedNavigationTargetDetailsType.hx new file mode 100644 index 0000000..5409226 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/OnCreatedNavigationTargetDetailsType.hx @@ -0,0 +1,28 @@ +package webextension_polyfill.webnavigation; + +typedef OnCreatedNavigationTargetDetailsType = { + /** + The ID of the tab in which the navigation is triggered. + **/ + var sourceTabId : Float; + /** + The ID of the process runs the renderer for the source tab. + **/ + var sourceProcessId : Float; + /** + The ID of the frame with sourceTabId in which the navigation is triggered. 0 indicates the main frame. + **/ + var sourceFrameId : Float; + /** + The URL to be opened in the new window. + **/ + var url : String; + /** + The ID of the tab in which the url is opened + **/ + var tabId : Float; + /** + The time when the browser was about to create a new view, in milliseconds since the epoch. + **/ + var timeStamp : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/OnCreatedNavigationTargetEvent.hx b/externs/webextension_polyfill/webnavigation/OnCreatedNavigationTargetEvent.hx new file mode 100644 index 0000000..267a3a5 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/OnCreatedNavigationTargetEvent.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.webnavigation; + +/** + Fired when a new window, or a new tab in an existing window, is created to host a navigation. +**/ +typedef OnCreatedNavigationTargetEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnCreatedNavigationTargetDetailsType) -> Void, ?filters:EventUrlFilters):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnCreatedNavigationTargetDetailsType) -> Void):Void; + function hasListener(callback:(details:OnCreatedNavigationTargetDetailsType) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/OnDOMContentLoadedDetailsType.hx b/externs/webextension_polyfill/webnavigation/OnDOMContentLoadedDetailsType.hx new file mode 100644 index 0000000..fbf0e08 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/OnDOMContentLoadedDetailsType.hx @@ -0,0 +1,18 @@ +package webextension_polyfill.webnavigation; + +typedef OnDOMContentLoadedDetailsType = { + /** + The ID of the tab in which the navigation occurs. + **/ + var tabId : Float; + var url : String; + /** + 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. + Frame IDs are unique within a tab. + **/ + var frameId : Float; + /** + The time when the page's DOM was fully constructed, in milliseconds since the epoch. + **/ + var timeStamp : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/OnDOMContentLoadedEvent.hx b/externs/webextension_polyfill/webnavigation/OnDOMContentLoadedEvent.hx new file mode 100644 index 0000000..601e949 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/OnDOMContentLoadedEvent.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.webnavigation; + +/** + Fired when the page's DOM is fully constructed, but the referenced resources may not finish loading. +**/ +typedef OnDOMContentLoadedEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnDOMContentLoadedDetailsType) -> Void, ?filters:EventUrlFilters):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnDOMContentLoadedDetailsType) -> Void):Void; + function hasListener(callback:(details:OnDOMContentLoadedDetailsType) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/OnErrorOccurredDetailsType.hx b/externs/webextension_polyfill/webnavigation/OnErrorOccurredDetailsType.hx new file mode 100644 index 0000000..952a829 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/OnErrorOccurredDetailsType.hx @@ -0,0 +1,18 @@ +package webextension_polyfill.webnavigation; + +typedef OnErrorOccurredDetailsType = { + /** + The ID of the tab in which the navigation occurs. + **/ + var tabId : Float; + var url : String; + /** + 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. + Frame IDs are unique within a tab. + **/ + var frameId : Float; + /** + The time when the error occurred, in milliseconds since the epoch. + **/ + var timeStamp : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/OnErrorOccurredEvent.hx b/externs/webextension_polyfill/webnavigation/OnErrorOccurredEvent.hx new file mode 100644 index 0000000..8208978 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/OnErrorOccurredEvent.hx @@ -0,0 +1,18 @@ +package webextension_polyfill.webnavigation; + +/** + Fired when an error occurs and the navigation is aborted. This can happen if either a network error occurred, + or the user aborted the navigation. +**/ +typedef OnErrorOccurredEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnErrorOccurredDetailsType) -> Void, ?filters:EventUrlFilters):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnErrorOccurredDetailsType) -> Void):Void; + function hasListener(callback:(details:OnErrorOccurredDetailsType) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/OnHistoryStateUpdatedDetailsType.hx b/externs/webextension_polyfill/webnavigation/OnHistoryStateUpdatedDetailsType.hx new file mode 100644 index 0000000..f731f51 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/OnHistoryStateUpdatedDetailsType.hx @@ -0,0 +1,26 @@ +package webextension_polyfill.webnavigation; + +typedef OnHistoryStateUpdatedDetailsType = { + /** + The ID of the tab in which the navigation occurs. + **/ + var tabId : Float; + var url : String; + /** + 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. + Frame IDs are unique within a tab. + **/ + var frameId : Float; + /** + Cause of the navigation. + **/ + var transitionType : TransitionType; + /** + A list of transition qualifiers. + **/ + var transitionQualifiers : Array; + /** + The time when the navigation was committed, in milliseconds since the epoch. + **/ + var timeStamp : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/OnHistoryStateUpdatedEvent.hx b/externs/webextension_polyfill/webnavigation/OnHistoryStateUpdatedEvent.hx new file mode 100644 index 0000000..397a7f8 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/OnHistoryStateUpdatedEvent.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.webnavigation; + +/** + Fired when the frame's history was updated to a new URL. All future events for that frame will use the updated URL. +**/ +typedef OnHistoryStateUpdatedEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnHistoryStateUpdatedDetailsType) -> Void, ?filters:EventUrlFilters):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnHistoryStateUpdatedDetailsType) -> Void):Void; + function hasListener(callback:(details:OnHistoryStateUpdatedDetailsType) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/OnReferenceFragmentUpdatedDetailsType.hx b/externs/webextension_polyfill/webnavigation/OnReferenceFragmentUpdatedDetailsType.hx new file mode 100644 index 0000000..23666d7 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/OnReferenceFragmentUpdatedDetailsType.hx @@ -0,0 +1,26 @@ +package webextension_polyfill.webnavigation; + +typedef OnReferenceFragmentUpdatedDetailsType = { + /** + The ID of the tab in which the navigation occurs. + **/ + var tabId : Float; + var url : String; + /** + 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. + Frame IDs are unique within a tab. + **/ + var frameId : Float; + /** + Cause of the navigation. + **/ + var transitionType : TransitionType; + /** + A list of transition qualifiers. + **/ + var transitionQualifiers : Array; + /** + The time when the navigation was committed, in milliseconds since the epoch. + **/ + var timeStamp : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/OnReferenceFragmentUpdatedEvent.hx b/externs/webextension_polyfill/webnavigation/OnReferenceFragmentUpdatedEvent.hx new file mode 100644 index 0000000..3d05d45 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/OnReferenceFragmentUpdatedEvent.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.webnavigation; + +/** + Fired when the reference fragment of a frame was updated. All future events for that frame will use the updated URL. +**/ +typedef OnReferenceFragmentUpdatedEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnReferenceFragmentUpdatedDetailsType) -> Void, ?filters:EventUrlFilters):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnReferenceFragmentUpdatedDetailsType) -> Void):Void; + function hasListener(callback:(details:OnReferenceFragmentUpdatedDetailsType) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/OnTabReplacedDetailsType.hx b/externs/webextension_polyfill/webnavigation/OnTabReplacedDetailsType.hx new file mode 100644 index 0000000..892bab8 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/OnTabReplacedDetailsType.hx @@ -0,0 +1,16 @@ +package webextension_polyfill.webnavigation; + +typedef OnTabReplacedDetailsType = { + /** + The ID of the tab that was replaced. + **/ + var replacedTabId : Float; + /** + The ID of the tab that replaced the old tab. + **/ + var tabId : Float; + /** + The time when the replacement happened, in milliseconds since the epoch. + **/ + var timeStamp : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/Static.hx b/externs/webextension_polyfill/webnavigation/Static.hx new file mode 100644 index 0000000..4f05b8c --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/Static.hx @@ -0,0 +1,52 @@ +package webextension_polyfill.webnavigation; + +typedef Static = { + /** + 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. + **/ + function getFrame(details:GetFrameDetailsType):js.lib.Promise>; + /** + Retrieves information about all frames of a given tab. + **/ + function getAllFrames(details:GetAllFramesDetailsType):js.lib.Promise>>; + /** + Fired when a navigation is about to occur. + **/ + var onBeforeNavigate : OnBeforeNavigateEvent; + /** + Fired when a navigation is committed. The document (and the resources it refers to, such as images and subframes) + might still be downloading, but at least part of the document has been received from the server and the browser has + decided to switch to the new document. + **/ + var onCommitted : OnCommittedEvent; + /** + Fired when the page's DOM is fully constructed, but the referenced resources may not finish loading. + **/ + var onDOMContentLoaded : OnDOMContentLoadedEvent; + /** + Fired when a document, including the resources it refers to, is completely loaded and initialized. + **/ + var onCompleted : OnCompletedEvent; + /** + Fired when an error occurs and the navigation is aborted. This can happen if either a network error occurred, + or the user aborted the navigation. + **/ + var onErrorOccurred : OnErrorOccurredEvent; + /** + Fired when a new window, or a new tab in an existing window, is created to host a navigation. + **/ + var onCreatedNavigationTarget : OnCreatedNavigationTargetEvent; + /** + Fired when the reference fragment of a frame was updated. All future events for that frame will use the updated URL. + **/ + var onReferenceFragmentUpdated : OnReferenceFragmentUpdatedEvent; + /** + Fired when the contents of the tab is replaced by a different (usually previously pre-rendered) tab. + **/ + var onTabReplaced : webextension_polyfill.events.Event<(details:OnTabReplacedDetailsType) -> Void>; + /** + Fired when the frame's history was updated to a new URL. All future events for that frame will use the updated URL. + **/ + var onHistoryStateUpdated : OnHistoryStateUpdatedEvent; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/TransitionQualifier.hx b/externs/webextension_polyfill/webnavigation/TransitionQualifier.hx new file mode 100644 index 0000000..3b61da9 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/TransitionQualifier.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.webnavigation; + +typedef TransitionQualifier = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/webnavigation/TransitionType.hx b/externs/webextension_polyfill/webnavigation/TransitionType.hx new file mode 100644 index 0000000..8318424 --- /dev/null +++ b/externs/webextension_polyfill/webnavigation/TransitionType.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.webnavigation; + +/** + Cause of the navigation. The same transition types as defined in the history API are used. + These are the same transition types as defined in the $(topic:transition_types)[history API] except with + "start_page" in place of "auto_toplevel" (for backwards compatibility). +**/ +typedef TransitionType = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/BlockingResponse.hx b/externs/webextension_polyfill/webrequest/BlockingResponse.hx new file mode 100644 index 0000000..20a9a10 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/BlockingResponse.hx @@ -0,0 +1,52 @@ +package webextension_polyfill.webrequest; + +/** + Returns value for event handlers that have the 'blocking' extraInfoSpec applied. Allows the event handler to modify + network requests. +**/ +typedef BlockingResponse = { + /** + If true, the request is cancelled. Used in onBeforeRequest, this prevents the request from being sent. + Optional. + **/ + @:optional + var cancel : Bool; + /** + 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. + Optional. + **/ + @:optional + var redirectUrl : String; + /** + 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. + Optional. + **/ + @:optional + var upgradeToSecure : Bool; + /** + Only used as a response to the onBeforeSendHeaders event. If set, the request is made with these request headers instead. + Optional. + **/ + @:optional + var requestHeaders : HttpHeaders; + /** + 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). + Optional. + **/ + @:optional + var responseHeaders : HttpHeaders; + /** + Only used as a response to the onAuthRequired event. If set, the request is made using the supplied credentials. + Optional. + **/ + @:optional + var authCredentials : BlockingResponseAuthCredentialsType; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/BlockingResponseAuthCredentialsType.hx b/externs/webextension_polyfill/webrequest/BlockingResponseAuthCredentialsType.hx new file mode 100644 index 0000000..e5b1eaa --- /dev/null +++ b/externs/webextension_polyfill/webrequest/BlockingResponseAuthCredentialsType.hx @@ -0,0 +1,9 @@ +package webextension_polyfill.webrequest; + +/** + Only used as a response to the onAuthRequired event. If set, the request is made using the supplied credentials. +**/ +typedef BlockingResponseAuthCredentialsType = { + var username : String; + var password : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/BlockingResponseOrPromise.hx b/externs/webextension_polyfill/webrequest/BlockingResponseOrPromise.hx new file mode 100644 index 0000000..c711814 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/BlockingResponseOrPromise.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.webrequest; + +/** + A BlockingResponse or a Promise +**/ +typedef BlockingResponseOrPromise = ts.AnyOf2>; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/CertificateInfo.hx b/externs/webextension_polyfill/webrequest/CertificateInfo.hx new file mode 100644 index 0000000..b23647f --- /dev/null +++ b/externs/webextension_polyfill/webrequest/CertificateInfo.hx @@ -0,0 +1,22 @@ +package webextension_polyfill.webrequest; + +/** + Contains the certificate properties of the request if it is a secure request. +**/ +typedef CertificateInfo = { + var subject : String; + var issuer : String; + /** + Contains start and end timestamps. + **/ + var validity : CertificateInfoValidityType; + var fingerprint : CertificateInfoFingerprintType; + var serialNumber : String; + var isBuiltInRoot : Bool; + var subjectPublicKeyInfoDigest : CertificateInfoSubjectPublicKeyInfoDigestType; + /** + Optional. + **/ + @:optional + var rawDER : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/CertificateInfoFingerprintType.hx b/externs/webextension_polyfill/webrequest/CertificateInfoFingerprintType.hx new file mode 100644 index 0000000..06131fc --- /dev/null +++ b/externs/webextension_polyfill/webrequest/CertificateInfoFingerprintType.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.webrequest; + +typedef CertificateInfoFingerprintType = { + var sha1 : String; + var sha256 : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/CertificateInfoSubjectPublicKeyInfoDigestType.hx b/externs/webextension_polyfill/webrequest/CertificateInfoSubjectPublicKeyInfoDigestType.hx new file mode 100644 index 0000000..c393e5c --- /dev/null +++ b/externs/webextension_polyfill/webrequest/CertificateInfoSubjectPublicKeyInfoDigestType.hx @@ -0,0 +1,5 @@ +package webextension_polyfill.webrequest; + +typedef CertificateInfoSubjectPublicKeyInfoDigestType = { + var sha256 : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/CertificateInfoValidityType.hx b/externs/webextension_polyfill/webrequest/CertificateInfoValidityType.hx new file mode 100644 index 0000000..16d32dc --- /dev/null +++ b/externs/webextension_polyfill/webrequest/CertificateInfoValidityType.hx @@ -0,0 +1,9 @@ +package webextension_polyfill.webrequest; + +/** + Contains start and end timestamps. +**/ +typedef CertificateInfoValidityType = { + var start : Float; + var end : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/CertificateTransparencyStatus.hx b/externs/webextension_polyfill/webrequest/CertificateTransparencyStatus.hx new file mode 100644 index 0000000..f7f6eb1 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/CertificateTransparencyStatus.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.webrequest; + +typedef CertificateTransparencyStatus = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/GetSecurityInfoOptionsType.hx b/externs/webextension_polyfill/webrequest/GetSecurityInfoOptionsType.hx new file mode 100644 index 0000000..50359bd --- /dev/null +++ b/externs/webextension_polyfill/webrequest/GetSecurityInfoOptionsType.hx @@ -0,0 +1,16 @@ +package webextension_polyfill.webrequest; + +typedef GetSecurityInfoOptionsType = { + /** + Include the entire certificate chain. + Optional. + **/ + @:optional + var certificateChain : Bool; + /** + Include raw certificate data for processing by the extension. + Optional. + **/ + @:optional + var rawDER : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/HttpHeaders.hx b/externs/webextension_polyfill/webrequest/HttpHeaders.hx new file mode 100644 index 0000000..89907b0 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/HttpHeaders.hx @@ -0,0 +1,7 @@ +package webextension_polyfill.webrequest; + +/** + An array of HTTP headers. Each header is represented as a dictionary containing the keys name + and either value or binaryValue. +**/ +typedef HttpHeaders = Array; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/HttpHeadersItemType.hx b/externs/webextension_polyfill/webrequest/HttpHeadersItemType.hx new file mode 100644 index 0000000..bec5d8e --- /dev/null +++ b/externs/webextension_polyfill/webrequest/HttpHeadersItemType.hx @@ -0,0 +1,20 @@ +package webextension_polyfill.webrequest; + +typedef HttpHeadersItemType = { + /** + Name of the HTTP header. + **/ + var name : String; + /** + Value of the HTTP header if it can be represented by UTF-8. + Optional. + **/ + @:optional + var value : String; + /** + Value of the HTTP header if it cannot be represented by UTF-8, stored as individual byte values (0..255). + Optional. + **/ + @:optional + var binaryValue : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnAuthRequiredDetailsType.hx b/externs/webextension_polyfill/webrequest/OnAuthRequiredDetailsType.hx new file mode 100644 index 0000000..cd6708b --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnAuthRequiredDetailsType.hx @@ -0,0 +1,110 @@ +package webextension_polyfill.webrequest; + +typedef OnAuthRequiredDetailsType = { + /** + The ID of the request. Request IDs are unique within a browser session. As a result, + they could be used to relate different events of the same request. + **/ + var requestId : String; + var url : String; + /** + Standard HTTP method. + **/ + var method : String; + /** + The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in + which the request happens. If the document of a (sub-)frame is loaded (type is main_frame + or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. + Frame IDs are unique within a tab. + **/ + var frameId : Float; + /** + ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. + **/ + var parentFrameId : Float; + /** + True for private browsing requests. + Optional. + **/ + @:optional + var incognito : Bool; + /** + The cookie store ID of the contextual identity. + Optional. + **/ + @:optional + var cookieStoreId : String; + /** + URL of the resource that triggered this request. + Optional. + **/ + @:optional + var originUrl : String; + /** + URL of the page into which the requested resource will be loaded. + Optional. + **/ + @:optional + var documentUrl : String; + /** + The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. + **/ + var tabId : Float; + /** + How the requested resource will be used. + **/ + var type : webextension_polyfill.declarativenetrequest.ResourceType; + /** + The time when this signal is triggered, in milliseconds since the epoch. + **/ + var timeStamp : Float; + /** + The authentication scheme, e.g. Basic or Digest. + **/ + var scheme : String; + /** + The authentication realm provided by the server, if there is one. + Optional. + **/ + @:optional + var realm : String; + /** + The server requesting authentication. + **/ + var challenger : OnAuthRequiredDetailsTypeChallengerType; + /** + True for Proxy-Authenticate, false for WWW-Authenticate. + **/ + var isProxy : Bool; + /** + The HTTP response headers that were received along with this response. + Optional. + **/ + @:optional + var responseHeaders : HttpHeaders; + /** + HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., + responses that lack a status line) or an empty string if there are no headers. + **/ + var statusLine : String; + /** + Standard HTTP status code returned by the server. + **/ + var statusCode : Float; + /** + Tracking classification if the request has been classified. + Optional. + **/ + @:optional + var urlClassification : UrlClassification; + /** + Indicates if this request and its content window hierarchy is third party. + **/ + var thirdParty : Bool; + /** + URL of the resource that triggered this request (on chrome). + Optional. + **/ + @:optional + var initiator : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnAuthRequiredDetailsTypeChallengerType.hx b/externs/webextension_polyfill/webrequest/OnAuthRequiredDetailsTypeChallengerType.hx new file mode 100644 index 0000000..0ce8e50 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnAuthRequiredDetailsTypeChallengerType.hx @@ -0,0 +1,9 @@ +package webextension_polyfill.webrequest; + +/** + The server requesting authentication. +**/ +typedef OnAuthRequiredDetailsTypeChallengerType = { + var host : String; + var port : Float; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnAuthRequiredEvent.hx b/externs/webextension_polyfill/webrequest/OnAuthRequiredEvent.hx new file mode 100644 index 0000000..6863b29 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnAuthRequiredEvent.hx @@ -0,0 +1,19 @@ +package webextension_polyfill.webrequest; + +/** + Fired when an authentication failure is received. The listener has three options: it can provide authentication + credentials, it can cancel the request and display the error page, or it can take no action on the challenge. + If bad user credentials are provided, this may be called multiple times for the same request. +**/ +typedef OnAuthRequiredEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnAuthRequiredDetailsType) -> ts.AnyOf3>, filter:RequestFilter, ?extraInfoSpec:Array):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnAuthRequiredDetailsType) -> ts.AnyOf3>):Void; + function hasListener(callback:(details:OnAuthRequiredDetailsType) -> ts.AnyOf3>):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnAuthRequiredOptions.hx b/externs/webextension_polyfill/webrequest/OnAuthRequiredOptions.hx new file mode 100644 index 0000000..c217958 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnAuthRequiredOptions.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.webrequest; + +typedef OnAuthRequiredOptions = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnBeforeRedirectDetailsType.hx b/externs/webextension_polyfill/webrequest/OnBeforeRedirectDetailsType.hx new file mode 100644 index 0000000..4ec59fd --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnBeforeRedirectDetailsType.hx @@ -0,0 +1,106 @@ +package webextension_polyfill.webrequest; + +typedef OnBeforeRedirectDetailsType = { + /** + The ID of the request. Request IDs are unique within a browser session. As a result, + they could be used to relate different events of the same request. + **/ + var requestId : String; + var url : String; + /** + Standard HTTP method. + **/ + var method : String; + /** + The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in + which the request happens. If the document of a (sub-)frame is loaded (type is main_frame + or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. + Frame IDs are unique within a tab. + **/ + var frameId : Float; + /** + ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. + **/ + var parentFrameId : Float; + /** + True for private browsing requests. + Optional. + **/ + @:optional + var incognito : Bool; + /** + The cookie store ID of the contextual identity. + Optional. + **/ + @:optional + var cookieStoreId : String; + /** + URL of the resource that triggered this request. + Optional. + **/ + @:optional + var originUrl : String; + /** + URL of the page into which the requested resource will be loaded. + Optional. + **/ + @:optional + var documentUrl : String; + /** + The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. + **/ + var tabId : Float; + /** + How the requested resource will be used. + **/ + var type : webextension_polyfill.declarativenetrequest.ResourceType; + /** + The time when this signal is triggered, in milliseconds since the epoch. + **/ + var timeStamp : Float; + /** + The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address. + Optional. + **/ + @:optional + var ip : String; + /** + Indicates if this response was fetched from disk cache. + **/ + var fromCache : Bool; + /** + Standard HTTP status code returned by the server. + **/ + var statusCode : Float; + /** + The new URL. + **/ + var redirectUrl : String; + /** + The HTTP response headers that were received along with this redirect. + Optional. + **/ + @:optional + var responseHeaders : HttpHeaders; + /** + HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., + responses that lack a status line) or an empty string if there are no headers. + **/ + var statusLine : String; + /** + Tracking classification if the request has been classified. + Optional. + **/ + @:optional + var urlClassification : UrlClassification; + /** + Indicates if this request and its content window hierarchy is third party. + **/ + var thirdParty : Bool; + /** + URL of the resource that triggered this request (on chrome). + Optional. + **/ + @:optional + var initiator : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnBeforeRedirectEvent.hx b/externs/webextension_polyfill/webrequest/OnBeforeRedirectEvent.hx new file mode 100644 index 0000000..733828d --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnBeforeRedirectEvent.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.webrequest; + +/** + Fired when a server-initiated redirect is about to occur. +**/ +typedef OnBeforeRedirectEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnBeforeRedirectDetailsType) -> Void, filter:RequestFilter, ?extraInfoSpec:Array):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnBeforeRedirectDetailsType) -> Void):Void; + function hasListener(callback:(details:OnBeforeRedirectDetailsType) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnBeforeRedirectOptions.hx b/externs/webextension_polyfill/webrequest/OnBeforeRedirectOptions.hx new file mode 100644 index 0000000..ebea9cd --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnBeforeRedirectOptions.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.webrequest; + +typedef OnBeforeRedirectOptions = OnResponseStartedOptions; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnBeforeRequestDetailsType.hx b/externs/webextension_polyfill/webrequest/OnBeforeRequestDetailsType.hx new file mode 100644 index 0000000..0db70d5 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnBeforeRequestDetailsType.hx @@ -0,0 +1,83 @@ +package webextension_polyfill.webrequest; + +typedef OnBeforeRequestDetailsType = { + /** + The ID of the request. Request IDs are unique within a browser session. As a result, + they could be used to relate different events of the same request. + **/ + var requestId : String; + var url : String; + /** + Standard HTTP method. + **/ + var method : String; + /** + The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in + which the request happens. If the document of a (sub-)frame is loaded (type is main_frame + or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. + Frame IDs are unique within a tab. + **/ + var frameId : Float; + /** + ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. + **/ + var parentFrameId : Float; + /** + True for private browsing requests. + Optional. + **/ + @:optional + var incognito : Bool; + /** + The cookie store ID of the contextual identity. + Optional. + **/ + @:optional + var cookieStoreId : String; + /** + URL of the resource that triggered this request. + Optional. + **/ + @:optional + var originUrl : String; + /** + URL of the page into which the requested resource will be loaded. + Optional. + **/ + @:optional + var documentUrl : String; + /** + Contains the HTTP request body data. Only provided if extraInfoSpec contains 'requestBody'. + Optional. + **/ + @:optional + var requestBody : OnBeforeRequestDetailsTypeRequestBodyType; + /** + The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. + **/ + var tabId : Float; + /** + How the requested resource will be used. + **/ + var type : webextension_polyfill.declarativenetrequest.ResourceType; + /** + The time when this signal is triggered, in milliseconds since the epoch. + **/ + var timeStamp : Float; + /** + Tracking classification if the request has been classified. + Optional. + **/ + @:optional + var urlClassification : UrlClassification; + /** + Indicates if this request and its content window hierarchy is third party. + **/ + var thirdParty : Bool; + /** + URL of the resource that triggered this request (on chrome). + Optional. + **/ + @:optional + var initiator : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnBeforeRequestDetailsTypeRequestBodyType.hx b/externs/webextension_polyfill/webrequest/OnBeforeRequestDetailsTypeRequestBodyType.hx new file mode 100644 index 0000000..df09801 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnBeforeRequestDetailsTypeRequestBodyType.hx @@ -0,0 +1,29 @@ +package webextension_polyfill.webrequest; + +/** + Contains the HTTP request body data. Only provided if extraInfoSpec contains 'requestBody'. +**/ +typedef OnBeforeRequestDetailsTypeRequestBodyType = { + /** + Errors when obtaining request body data. + Optional. + **/ + @:optional + var error : String; + /** + If the request method is POST and the body is a sequence of key-value pairs encoded in UTF8, + encoded as either multipart/form-data, or application/x-www-form-urlencoded, this dictionary is present and for each + key contains the list of all values for that key. If the data is of another media type, or if it is malformed, + the dictionary is not present. An example value of this dictionary is {'key': ['value1', 'value2']}. + Optional. + **/ + @:optional + var formData : haxe.DynamicAccess; + /** + If the request method is PUT or POST, and the body is not already parsed in formData, + then the unparsed request body elements are contained in this array. + Optional. + **/ + @:optional + var raw : Array; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnBeforeRequestEvent.hx b/externs/webextension_polyfill/webrequest/OnBeforeRequestEvent.hx new file mode 100644 index 0000000..d74c1ce --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnBeforeRequestEvent.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.webrequest; + +/** + Fired when a request is about to occur. +**/ +typedef OnBeforeRequestEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnBeforeRequestDetailsType) -> ts.AnyOf3>, filter:RequestFilter, ?extraInfoSpec:Array):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnBeforeRequestDetailsType) -> ts.AnyOf3>):Void; + function hasListener(callback:(details:OnBeforeRequestDetailsType) -> ts.AnyOf3>):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnBeforeRequestOptions.hx b/externs/webextension_polyfill/webrequest/OnBeforeRequestOptions.hx new file mode 100644 index 0000000..a4a7b44 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnBeforeRequestOptions.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.webrequest; + +typedef OnBeforeRequestOptions = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnBeforeSendHeadersDetailsType.hx b/externs/webextension_polyfill/webrequest/OnBeforeSendHeadersDetailsType.hx new file mode 100644 index 0000000..a087a6d --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnBeforeSendHeadersDetailsType.hx @@ -0,0 +1,83 @@ +package webextension_polyfill.webrequest; + +typedef OnBeforeSendHeadersDetailsType = { + /** + The ID of the request. Request IDs are unique within a browser session. As a result, + they could be used to relate different events of the same request. + **/ + var requestId : String; + var url : String; + /** + Standard HTTP method. + **/ + var method : String; + /** + The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in + which the request happens. If the document of a (sub-)frame is loaded (type is main_frame + or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. + Frame IDs are unique within a tab. + **/ + var frameId : Float; + /** + ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. + **/ + var parentFrameId : Float; + /** + True for private browsing requests. + Optional. + **/ + @:optional + var incognito : Bool; + /** + The cookie store ID of the contextual identity. + Optional. + **/ + @:optional + var cookieStoreId : String; + /** + URL of the resource that triggered this request. + Optional. + **/ + @:optional + var originUrl : String; + /** + URL of the page into which the requested resource will be loaded. + Optional. + **/ + @:optional + var documentUrl : String; + /** + The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. + **/ + var tabId : Float; + /** + How the requested resource will be used. + **/ + var type : webextension_polyfill.declarativenetrequest.ResourceType; + /** + The time when this signal is triggered, in milliseconds since the epoch. + **/ + var timeStamp : Float; + /** + The HTTP request headers that are going to be sent out with this request. + Optional. + **/ + @:optional + var requestHeaders : HttpHeaders; + /** + Tracking classification if the request has been classified. + Optional. + **/ + @:optional + var urlClassification : UrlClassification; + /** + Indicates if this request and its content window hierarchy is third party. + **/ + var thirdParty : Bool; + /** + URL of the resource that triggered this request (on chrome). + Optional. + **/ + @:optional + var initiator : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnBeforeSendHeadersEvent.hx b/externs/webextension_polyfill/webrequest/OnBeforeSendHeadersEvent.hx new file mode 100644 index 0000000..04f1b3a --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnBeforeSendHeadersEvent.hx @@ -0,0 +1,18 @@ +package webextension_polyfill.webrequest; + +/** + Fired before sending an HTTP request, once the request headers are available. This may occur after a TCP connection is + made to the server, but before any HTTP data is sent. +**/ +typedef OnBeforeSendHeadersEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnBeforeSendHeadersDetailsType) -> ts.AnyOf3>, filter:RequestFilter, ?extraInfoSpec:Array):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnBeforeSendHeadersDetailsType) -> ts.AnyOf3>):Void; + function hasListener(callback:(details:OnBeforeSendHeadersDetailsType) -> ts.AnyOf3>):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnBeforeSendHeadersOptions.hx b/externs/webextension_polyfill/webrequest/OnBeforeSendHeadersOptions.hx new file mode 100644 index 0000000..da2bc6d --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnBeforeSendHeadersOptions.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.webrequest; + +typedef OnBeforeSendHeadersOptions = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnCompletedDetailsType.hx b/externs/webextension_polyfill/webrequest/OnCompletedDetailsType.hx new file mode 100644 index 0000000..5fd85d6 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnCompletedDetailsType.hx @@ -0,0 +1,108 @@ +package webextension_polyfill.webrequest; + +typedef OnCompletedDetailsType = { + /** + The ID of the request. Request IDs are unique within a browser session. As a result, + they could be used to relate different events of the same request. + **/ + var requestId : String; + var url : String; + /** + Standard HTTP method. + **/ + var method : String; + /** + The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in + which the request happens. If the document of a (sub-)frame is loaded (type is main_frame + or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. + Frame IDs are unique within a tab. + **/ + var frameId : Float; + /** + ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. + **/ + var parentFrameId : Float; + /** + True for private browsing requests. + Optional. + **/ + @:optional + var incognito : Bool; + /** + The cookie store ID of the contextual identity. + Optional. + **/ + @:optional + var cookieStoreId : String; + /** + URL of the resource that triggered this request. + Optional. + **/ + @:optional + var originUrl : String; + /** + URL of the page into which the requested resource will be loaded. + Optional. + **/ + @:optional + var documentUrl : String; + /** + The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. + **/ + var tabId : Float; + /** + How the requested resource will be used. + **/ + var type : webextension_polyfill.declarativenetrequest.ResourceType; + /** + The time when this signal is triggered, in milliseconds since the epoch. + **/ + var timeStamp : Float; + /** + The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address. + Optional. + **/ + @:optional + var ip : String; + /** + Indicates if this response was fetched from disk cache. + **/ + var fromCache : Bool; + /** + Standard HTTP status code returned by the server. + **/ + var statusCode : Float; + /** + The HTTP response headers that were received along with this response. + Optional. + **/ + @:optional + var responseHeaders : HttpHeaders; + /** + HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., + responses that lack a status line) or an empty string if there are no headers. + **/ + var statusLine : String; + /** + Tracking classification if the request has been classified. + **/ + var urlClassification : UrlClassification; + /** + Indicates if this request and its content window hierarchy is third party. + **/ + var thirdParty : Bool; + /** + For http requests, the bytes transferred in the request. Only available in onCompleted. + **/ + var requestSize : Float; + /** + For http requests, the bytes received in the request. Only available in onCompleted. + **/ + var responseSize : Float; + /** + URL of the resource that triggered this request (on chrome). + Optional. + **/ + @:optional + var initiator : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnCompletedEvent.hx b/externs/webextension_polyfill/webrequest/OnCompletedEvent.hx new file mode 100644 index 0000000..ed18062 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnCompletedEvent.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.webrequest; + +/** + Fired when a request is completed. +**/ +typedef OnCompletedEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnCompletedDetailsType) -> Void, filter:RequestFilter, ?extraInfoSpec:Array):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnCompletedDetailsType) -> Void):Void; + function hasListener(callback:(details:OnCompletedDetailsType) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnCompletedOptions.hx b/externs/webextension_polyfill/webrequest/OnCompletedOptions.hx new file mode 100644 index 0000000..181b4ea --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnCompletedOptions.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.webrequest; + +typedef OnCompletedOptions = OnResponseStartedOptions; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnErrorOccurredDetailsType.hx b/externs/webextension_polyfill/webrequest/OnErrorOccurredDetailsType.hx new file mode 100644 index 0000000..f98fcb1 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnErrorOccurredDetailsType.hx @@ -0,0 +1,92 @@ +package webextension_polyfill.webrequest; + +typedef OnErrorOccurredDetailsType = { + /** + The ID of the request. Request IDs are unique within a browser session. As a result, + they could be used to relate different events of the same request. + **/ + var requestId : String; + var url : String; + /** + Standard HTTP method. + **/ + var method : String; + /** + The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in + which the request happens. If the document of a (sub-)frame is loaded (type is main_frame + or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. + Frame IDs are unique within a tab. + **/ + var frameId : Float; + /** + ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. + **/ + var parentFrameId : Float; + /** + True for private browsing requests. + Optional. + **/ + @:optional + var incognito : Bool; + /** + The cookie store ID of the contextual identity. + Optional. + **/ + @:optional + var cookieStoreId : String; + /** + URL of the resource that triggered this request. + Optional. + **/ + @:optional + var originUrl : String; + /** + URL of the page into which the requested resource will be loaded. + Optional. + **/ + @:optional + var documentUrl : String; + /** + The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. + **/ + var tabId : Float; + /** + How the requested resource will be used. + **/ + var type : webextension_polyfill.declarativenetrequest.ResourceType; + /** + The time when this signal is triggered, in milliseconds since the epoch. + **/ + var timeStamp : Float; + /** + The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address. + Optional. + **/ + @:optional + var ip : String; + /** + Indicates if this response was fetched from disk cache. + **/ + var fromCache : Bool; + /** + The error description. This string is not guaranteed to remain backwards compatible between releases. + You must not parse and act based upon its content. + **/ + var error : String; + /** + Tracking classification if the request has been classified. + Optional. + **/ + @:optional + var urlClassification : UrlClassification; + /** + Indicates if this request and its content window hierarchy is third party. + **/ + var thirdParty : Bool; + /** + URL of the resource that triggered this request (on chrome). + Optional. + **/ + @:optional + var initiator : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnErrorOccurredEvent.hx b/externs/webextension_polyfill/webrequest/OnErrorOccurredEvent.hx new file mode 100644 index 0000000..0093ffd --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnErrorOccurredEvent.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.webrequest; + +/** + Fired when an error occurs. +**/ +typedef OnErrorOccurredEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnErrorOccurredDetailsType) -> Void, filter:RequestFilter, ?extraInfoSpec:Array):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnErrorOccurredDetailsType) -> Void):Void; + function hasListener(callback:(details:OnErrorOccurredDetailsType) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnErrorOccurredOptions.hx b/externs/webextension_polyfill/webrequest/OnErrorOccurredOptions.hx new file mode 100644 index 0000000..6742279 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnErrorOccurredOptions.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.webrequest; + +typedef OnErrorOccurredOptions = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnHeadersReceivedDetailsType.hx b/externs/webextension_polyfill/webrequest/OnHeadersReceivedDetailsType.hx new file mode 100644 index 0000000..1664b1b --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnHeadersReceivedDetailsType.hx @@ -0,0 +1,92 @@ +package webextension_polyfill.webrequest; + +typedef OnHeadersReceivedDetailsType = { + /** + The ID of the request. Request IDs are unique within a browser session. As a result, + they could be used to relate different events of the same request. + **/ + var requestId : String; + var url : String; + /** + Standard HTTP method. + **/ + var method : String; + /** + The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in + which the request happens. If the document of a (sub-)frame is loaded (type is main_frame + or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. + Frame IDs are unique within a tab. + **/ + var frameId : Float; + /** + ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. + **/ + var parentFrameId : Float; + /** + True for private browsing requests. + Optional. + **/ + @:optional + var incognito : Bool; + /** + The cookie store ID of the contextual identity. + Optional. + **/ + @:optional + var cookieStoreId : String; + /** + URL of the resource that triggered this request. + Optional. + **/ + @:optional + var originUrl : String; + /** + URL of the page into which the requested resource will be loaded. + Optional. + **/ + @:optional + var documentUrl : String; + /** + The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. + **/ + var tabId : Float; + /** + How the requested resource will be used. + **/ + var type : webextension_polyfill.declarativenetrequest.ResourceType; + /** + The time when this signal is triggered, in milliseconds since the epoch. + **/ + var timeStamp : Float; + /** + HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., + responses that lack a status line). + **/ + var statusLine : String; + /** + The HTTP response headers that have been received with this response. + Optional. + **/ + @:optional + var responseHeaders : HttpHeaders; + /** + Standard HTTP status code returned by the server. + **/ + var statusCode : Float; + /** + Tracking classification if the request has been classified. + Optional. + **/ + @:optional + var urlClassification : UrlClassification; + /** + Indicates if this request and its content window hierarchy is third party. + **/ + var thirdParty : Bool; + /** + URL of the resource that triggered this request (on chrome). + Optional. + **/ + @:optional + var initiator : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnHeadersReceivedEvent.hx b/externs/webextension_polyfill/webrequest/OnHeadersReceivedEvent.hx new file mode 100644 index 0000000..ee70627 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnHeadersReceivedEvent.hx @@ -0,0 +1,17 @@ +package webextension_polyfill.webrequest; + +/** + Fired when HTTP response headers of a request have been received. +**/ +typedef OnHeadersReceivedEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnHeadersReceivedDetailsType) -> ts.AnyOf3>, filter:RequestFilter, ?extraInfoSpec:Array):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnHeadersReceivedDetailsType) -> ts.AnyOf3>):Void; + function hasListener(callback:(details:OnHeadersReceivedDetailsType) -> ts.AnyOf3>):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnHeadersReceivedOptions.hx b/externs/webextension_polyfill/webrequest/OnHeadersReceivedOptions.hx new file mode 100644 index 0000000..a2b6d9f --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnHeadersReceivedOptions.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.webrequest; + +typedef OnHeadersReceivedOptions = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnResponseStartedDetailsType.hx b/externs/webextension_polyfill/webrequest/OnResponseStartedDetailsType.hx new file mode 100644 index 0000000..c56442f --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnResponseStartedDetailsType.hx @@ -0,0 +1,102 @@ +package webextension_polyfill.webrequest; + +typedef OnResponseStartedDetailsType = { + /** + The ID of the request. Request IDs are unique within a browser session. As a result, + they could be used to relate different events of the same request. + **/ + var requestId : String; + var url : String; + /** + Standard HTTP method. + **/ + var method : String; + /** + The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in + which the request happens. If the document of a (sub-)frame is loaded (type is main_frame + or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. + Frame IDs are unique within a tab. + **/ + var frameId : Float; + /** + ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. + **/ + var parentFrameId : Float; + /** + True for private browsing requests. + Optional. + **/ + @:optional + var incognito : Bool; + /** + The cookie store ID of the contextual identity. + Optional. + **/ + @:optional + var cookieStoreId : String; + /** + URL of the resource that triggered this request. + Optional. + **/ + @:optional + var originUrl : String; + /** + URL of the page into which the requested resource will be loaded. + Optional. + **/ + @:optional + var documentUrl : String; + /** + The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. + **/ + var tabId : Float; + /** + How the requested resource will be used. + **/ + var type : webextension_polyfill.declarativenetrequest.ResourceType; + /** + The time when this signal is triggered, in milliseconds since the epoch. + **/ + var timeStamp : Float; + /** + The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address. + Optional. + **/ + @:optional + var ip : String; + /** + Indicates if this response was fetched from disk cache. + **/ + var fromCache : Bool; + /** + Standard HTTP status code returned by the server. + **/ + var statusCode : Float; + /** + The HTTP response headers that were received along with this response. + Optional. + **/ + @:optional + var responseHeaders : HttpHeaders; + /** + HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., + responses that lack a status line) or an empty string if there are no headers. + **/ + var statusLine : String; + /** + Tracking classification if the request has been classified. + Optional. + **/ + @:optional + var urlClassification : UrlClassification; + /** + Indicates if this request and its content window hierarchy is third party. + **/ + var thirdParty : Bool; + /** + URL of the resource that triggered this request (on chrome). + Optional. + **/ + @:optional + var initiator : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnResponseStartedEvent.hx b/externs/webextension_polyfill/webrequest/OnResponseStartedEvent.hx new file mode 100644 index 0000000..ae089a2 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnResponseStartedEvent.hx @@ -0,0 +1,18 @@ +package webextension_polyfill.webrequest; + +/** + Fired when the first byte of the response body is received. For HTTP requests, this means that the status line and + response headers are available. +**/ +typedef OnResponseStartedEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnResponseStartedDetailsType) -> Void, filter:RequestFilter, ?extraInfoSpec:Array):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnResponseStartedDetailsType) -> Void):Void; + function hasListener(callback:(details:OnResponseStartedDetailsType) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnResponseStartedOptions.hx b/externs/webextension_polyfill/webrequest/OnResponseStartedOptions.hx new file mode 100644 index 0000000..6683a49 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnResponseStartedOptions.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.webrequest; + +typedef OnResponseStartedOptions = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnSendHeadersDetailsType.hx b/externs/webextension_polyfill/webrequest/OnSendHeadersDetailsType.hx new file mode 100644 index 0000000..23dc3ce --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnSendHeadersDetailsType.hx @@ -0,0 +1,83 @@ +package webextension_polyfill.webrequest; + +typedef OnSendHeadersDetailsType = { + /** + The ID of the request. Request IDs are unique within a browser session. As a result, + they could be used to relate different events of the same request. + **/ + var requestId : String; + var url : String; + /** + Standard HTTP method. + **/ + var method : String; + /** + The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in + which the request happens. If the document of a (sub-)frame is loaded (type is main_frame + or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. + Frame IDs are unique within a tab. + **/ + var frameId : Float; + /** + ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. + **/ + var parentFrameId : Float; + /** + True for private browsing requests. + Optional. + **/ + @:optional + var incognito : Bool; + /** + The cookie store ID of the contextual identity. + Optional. + **/ + @:optional + var cookieStoreId : String; + /** + URL of the resource that triggered this request. + Optional. + **/ + @:optional + var originUrl : String; + /** + URL of the page into which the requested resource will be loaded. + Optional. + **/ + @:optional + var documentUrl : String; + /** + The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. + **/ + var tabId : Float; + /** + How the requested resource will be used. + **/ + var type : webextension_polyfill.declarativenetrequest.ResourceType; + /** + The time when this signal is triggered, in milliseconds since the epoch. + **/ + var timeStamp : Float; + /** + The HTTP request headers that have been sent out with this request. + Optional. + **/ + @:optional + var requestHeaders : HttpHeaders; + /** + Tracking classification if the request has been classified. + Optional. + **/ + @:optional + var urlClassification : UrlClassification; + /** + Indicates if this request and its content window hierarchy is third party. + **/ + var thirdParty : Bool; + /** + URL of the resource that triggered this request (on chrome). + Optional. + **/ + @:optional + var initiator : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnSendHeadersEvent.hx b/externs/webextension_polyfill/webrequest/OnSendHeadersEvent.hx new file mode 100644 index 0000000..6eb607e --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnSendHeadersEvent.hx @@ -0,0 +1,18 @@ +package webextension_polyfill.webrequest; + +/** + Fired just before a request is going to be sent to the server (modifications of previous onBeforeSendHeaders callbacks + are visible by the time onSendHeaders is fired). +**/ +typedef OnSendHeadersEvent = { + /** + Registers an event listener callback to an event. + **/ + function addListener(callback:(details:OnSendHeadersDetailsType) -> Void, filter:RequestFilter, ?extraInfoSpec:Array):Void; + /** + Deregisters an event listener callback from an event. + **/ + function removeListener(callback:(details:OnSendHeadersDetailsType) -> Void):Void; + function hasListener(callback:(details:OnSendHeadersDetailsType) -> Void):Bool; + function hasListeners():Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/OnSendHeadersOptions.hx b/externs/webextension_polyfill/webrequest/OnSendHeadersOptions.hx new file mode 100644 index 0000000..5053e84 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/OnSendHeadersOptions.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.webrequest; + +typedef OnSendHeadersOptions = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/RequestFilter.hx b/externs/webextension_polyfill/webrequest/RequestFilter.hx new file mode 100644 index 0000000..5fb12ba --- /dev/null +++ b/externs/webextension_polyfill/webrequest/RequestFilter.hx @@ -0,0 +1,33 @@ +package webextension_polyfill.webrequest; + +/** + An object describing filters to apply to webRequest events. +**/ +typedef RequestFilter = { + /** + A list of URLs or URL patterns. Requests that cannot match any of the URLs will be filtered out. + **/ + var urls : Array; + /** + A list of request types. Requests that cannot match any of the types will be filtered out. + Optional. + **/ + @:optional + var types : Array; + /** + Optional. + **/ + @:optional + var tabId : Float; + /** + Optional. + **/ + @:optional + var windowId : Float; + /** + If provided, requests that do not match the incognito state will be filtered out. + Optional. + **/ + @:optional + var incognito : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/ResourceType.hx b/externs/webextension_polyfill/webrequest/ResourceType.hx new file mode 100644 index 0000000..a41abeb --- /dev/null +++ b/externs/webextension_polyfill/webrequest/ResourceType.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.webrequest; + +typedef ResourceType = webextension_polyfill.declarativenetrequest.ResourceType; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/SecurityInfo.hx b/externs/webextension_polyfill/webrequest/SecurityInfo.hx new file mode 100644 index 0000000..8c62c4f --- /dev/null +++ b/externs/webextension_polyfill/webrequest/SecurityInfo.hx @@ -0,0 +1,109 @@ +package webextension_polyfill.webrequest; + +/** + Contains the security properties of the request (ie. SSL/TLS information). +**/ +typedef SecurityInfo = { + var state : SecurityInfoStateEnum; + /** + Error message if state is "broken" + Optional. + **/ + @:optional + var errorMessage : String; + /** + Protocol version if state is "secure" + Optional. + **/ + @:optional + var protocolVersion : SecurityInfoProtocolVersionEnum; + /** + The cipher suite used in this request if state is "secure". + Optional. + **/ + @:optional + var cipherSuite : String; + /** + The key exchange algorithm used in this request if state is "secure". + Optional. + **/ + @:optional + var keaGroupName : String; + /** + The length (in bits) of the secret key. + Optional. + **/ + @:optional + var secretKeyLength : Float; + /** + The signature scheme used in this request if state is "secure". + Optional. + **/ + @:optional + var signatureSchemeName : String; + /** + Certificate data if state is "secure". Will only contain one entry unless certificateChain + is passed as an option. + **/ + var certificates : Array; + /** + The type of certificate error that was overridden for this connection, if any. + Optional. + **/ + @:optional + var overridableErrorCategory : SecurityInfoOverridableErrorCategoryEnum; + /** + Optional. + **/ + @:optional + var isExtendedValidation : Bool; + /** + Certificate transparency compliance per RFC 6962. See https://www.certificate-transparency.org/what-is-ct + for more information. + Optional. + **/ + @:optional + var certificateTransparencyStatus : CertificateTransparencyStatus; + /** + True if host uses Strict Transport Security and state is "secure". + Optional. + **/ + @:optional + var hsts : Bool; + /** + True if host uses Public Key Pinning and state is "secure". + Optional. + **/ + @:optional + var hpkp : String; + /** + list of reasons that cause the request to be considered weak, if state is "weak" + Optional. + **/ + @:optional + var weaknessReasons : Array; + /** + True if the TLS connection used Encrypted Client Hello. + Optional. + **/ + @:optional + var usedEch : Bool; + /** + True if the TLS connection used Delegated Credentials. + Optional. + **/ + @:optional + var usedDelegatedCredentials : Bool; + /** + True if the TLS connection made OCSP requests. + Optional. + **/ + @:optional + var usedOcsp : Bool; + /** + True if the TLS connection used a privacy-preserving DNS transport like DNS-over-HTTPS. + Optional. + **/ + @:optional + var usedPrivateDns : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/SecurityInfoOverridableErrorCategoryEnum.hx b/externs/webextension_polyfill/webrequest/SecurityInfoOverridableErrorCategoryEnum.hx new file mode 100644 index 0000000..5ddbb15 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/SecurityInfoOverridableErrorCategoryEnum.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.webrequest; + +/** + The type of certificate error that was overridden for this connection, if any. +**/ +typedef SecurityInfoOverridableErrorCategoryEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/SecurityInfoProtocolVersionEnum.hx b/externs/webextension_polyfill/webrequest/SecurityInfoProtocolVersionEnum.hx new file mode 100644 index 0000000..cde39c4 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/SecurityInfoProtocolVersionEnum.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.webrequest; + +/** + Protocol version if state is "secure" +**/ +typedef SecurityInfoProtocolVersionEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/SecurityInfoStateEnum.hx b/externs/webextension_polyfill/webrequest/SecurityInfoStateEnum.hx new file mode 100644 index 0000000..e9538cb --- /dev/null +++ b/externs/webextension_polyfill/webrequest/SecurityInfoStateEnum.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.webrequest; + +typedef SecurityInfoStateEnum = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/Static.hx b/externs/webextension_polyfill/webrequest/Static.hx new file mode 100644 index 0000000..adaff3c --- /dev/null +++ b/externs/webextension_polyfill/webrequest/Static.hx @@ -0,0 +1,63 @@ +package webextension_polyfill.webrequest; + +typedef Static = { + /** + 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. + **/ + function handlerBehaviorChanged():js.lib.Promise; + /** + ... + **/ + function filterResponseData(requestId:String):StreamFilter; + /** + Retrieves the security information for the request. Returns a promise that will resolve to a SecurityInfo object. + **/ + function getSecurityInfo(requestId:String, ?options:GetSecurityInfoOptionsType):js.lib.Promise; + /** + Fired when a request is about to occur. + **/ + var onBeforeRequest : OnBeforeRequestEvent; + /** + Fired before sending an HTTP request, once the request headers are available. This may occur after a TCP connection is + made to the server, but before any HTTP data is sent. + **/ + var onBeforeSendHeaders : OnBeforeSendHeadersEvent; + /** + Fired just before a request is going to be sent to the server (modifications of previous onBeforeSendHeaders callbacks + are visible by the time onSendHeaders is fired). + **/ + var onSendHeaders : OnSendHeadersEvent; + /** + Fired when HTTP response headers of a request have been received. + **/ + var onHeadersReceived : OnHeadersReceivedEvent; + /** + Fired when an authentication failure is received. The listener has three options: it can provide authentication + credentials, it can cancel the request and display the error page, or it can take no action on the challenge. + If bad user credentials are provided, this may be called multiple times for the same request. + **/ + var onAuthRequired : OnAuthRequiredEvent; + /** + Fired when the first byte of the response body is received. For HTTP requests, this means that the status line and + response headers are available. + **/ + var onResponseStarted : OnResponseStartedEvent; + /** + Fired when a server-initiated redirect is about to occur. + **/ + var onBeforeRedirect : OnBeforeRedirectEvent; + /** + Fired when a request is completed. + **/ + var onCompleted : OnCompletedEvent; + /** + Fired when an error occurs. + **/ + var onErrorOccurred : OnErrorOccurredEvent; + /** + 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. + **/ + var MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES : Int; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/StreamFilter.hx b/externs/webextension_polyfill/webrequest/StreamFilter.hx new file mode 100644 index 0000000..1d72564 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/StreamFilter.hx @@ -0,0 +1,64 @@ +package webextension_polyfill.webrequest; + +/** + An interface which allows an extension to intercept, and optionally modify, response data from an HTTP request. +**/ +typedef StreamFilter = { + /** + Returns the current status of the stream. + **/ + var status : StreamFilterStatus; + /** + After an "error" event has been dispatched, this contains a message describing the error. + **/ + var error : String; + /** + Creates a stream filter for the given add-on and the given extension ID. + **/ + function create(requestId:Float, addonId:String):Void; + /** + Suspends processing of the request. After this is called, no further data will be delivered until the request is resumed. + **/ + function suspend():Void; + /** + Resumes delivery of data for a suspended request. + **/ + function resume():Void; + /** + Closes the request. After this is called, no more data may be written to the stream, + and no further data will be delivered. This *must* be called after the consumer is finished writing data, + unless disconnect() has already been called. + **/ + function close():Void; + /** + Disconnects the stream filter from the request. After this is called, no further data will be delivered to the filter, + and any unprocessed data will be written directly to the output stream. + **/ + function disconnect():Void; + /** + Writes a chunk of data to the output stream. This may not be called before the "start" event has been received. + **/ + function write(data:ts.AnyOf2):Void; + /** + Dispatched with a StreamFilterDataEvent whenever incoming data is available on the stream. + This data will not be delivered to the output stream unless it is explicitly written via a write() call. + **/ + @:optional + dynamic function ondata(data:StreamFilterEventData):Void; + /** + Dispatched when the stream is opened, and is about to begin delivering data. + **/ + @:optional + dynamic function onstart(data:StreamFilterEventData):Void; + /** + Dispatched when the stream has closed, and has no more data to deliver. The output stream remains open and writable + until close() is called. + **/ + @:optional + dynamic function onstop(data:StreamFilterEventData):Void; + /** + Dispatched when an error has occurred. No further data may be read or written after this point. + **/ + @:optional + dynamic function onerror(data:StreamFilterEventData):Void; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/StreamFilterEventData.hx b/externs/webextension_polyfill/webrequest/StreamFilterEventData.hx new file mode 100644 index 0000000..2ff27a1 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/StreamFilterEventData.hx @@ -0,0 +1,8 @@ +package webextension_polyfill.webrequest; + +typedef StreamFilterEventData = { + /** + Contains a chunk of data read from the input stream. + **/ + var data : js.lib.ArrayBuffer; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/StreamFilterStatus.hx b/externs/webextension_polyfill/webrequest/StreamFilterStatus.hx new file mode 100644 index 0000000..1c07532 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/StreamFilterStatus.hx @@ -0,0 +1,18 @@ +package webextension_polyfill.webrequest; + +/** + "uninitialized": The StreamFilter is not fully initialized. No methods may be called until a "start" event has been + received. + "transferringdata": The underlying channel is currently transferring data, which will be dispatched via "data" events. + "finishedtransferringdata": The underlying channel has finished transferring data. Data may still be written via write() + calls at this point. + "suspended": Data transfer is currently suspended. It may be resumed by a call to resume(). + Data may still be written via write() calls in this state. + "closed": The channel has been closed by a call to close(). No further data wlil be delivered via "data" events, + and no further data may be written via write() calls. + "disconnected": The channel has been disconnected by a call to disconnect(). All further data will be delivered directly, + without passing through the filter. No further events will be dispatched, and no further data may be written by write() + calls. + "failed": An error has occurred and the channel is disconnected. The `error`, property contains the details of the error. +**/ +typedef StreamFilterStatus = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/TransportWeaknessReasons.hx b/externs/webextension_polyfill/webrequest/TransportWeaknessReasons.hx new file mode 100644 index 0000000..2993a74 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/TransportWeaknessReasons.hx @@ -0,0 +1,3 @@ +package webextension_polyfill.webrequest; + +typedef TransportWeaknessReasons = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/UploadData.hx b/externs/webextension_polyfill/webrequest/UploadData.hx new file mode 100644 index 0000000..0a400fc --- /dev/null +++ b/externs/webextension_polyfill/webrequest/UploadData.hx @@ -0,0 +1,19 @@ +package webextension_polyfill.webrequest; + +/** + Contains data uploaded in a URL request. +**/ +typedef UploadData = { + /** + An ArrayBuffer with a copy of the data. + Optional. + **/ + @:optional + var bytes : Dynamic; + /** + A string with the file's path and name. + Optional. + **/ + @:optional + var file : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/UrlClassification.hx b/externs/webextension_polyfill/webrequest/UrlClassification.hx new file mode 100644 index 0000000..52c1685 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/UrlClassification.hx @@ -0,0 +1,12 @@ +package webextension_polyfill.webrequest; + +typedef UrlClassification = { + /** + Classification flags if the request has been classified and it is first party. + **/ + var firstParty : UrlClassificationParty; + /** + Classification flags if the request has been classified and it or its window hierarchy is third party. + **/ + var thirdParty : UrlClassificationParty; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/UrlClassificationFlags.hx b/externs/webextension_polyfill/webrequest/UrlClassificationFlags.hx new file mode 100644 index 0000000..879cf78 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/UrlClassificationFlags.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.webrequest; + +/** + Tracking flags that match our internal tracking classification +**/ +typedef UrlClassificationFlags = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/webrequest/UrlClassificationParty.hx b/externs/webextension_polyfill/webrequest/UrlClassificationParty.hx new file mode 100644 index 0000000..6eedd82 --- /dev/null +++ b/externs/webextension_polyfill/webrequest/UrlClassificationParty.hx @@ -0,0 +1,6 @@ +package webextension_polyfill.webrequest; + +/** + If the request has been classified this is an array of $(ref:UrlClassificationFlags). +**/ +typedef UrlClassificationParty = Array; \ No newline at end of file diff --git a/externs/webextension_polyfill/windows/CreateCreateDataType.hx b/externs/webextension_polyfill/windows/CreateCreateDataType.hx new file mode 100644 index 0000000..9b9e4df --- /dev/null +++ b/externs/webextension_polyfill/windows/CreateCreateDataType.hx @@ -0,0 +1,89 @@ +package webextension_polyfill.windows; + +typedef CreateCreateDataType = { + /** + A URL or array of URLs to open as tabs in the window. Fully-qualified URLs must include a scheme (i.e. 'http://www. + google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. + Defaults to the New Tab Page. + Optional. + **/ + @:optional + var url : ts.AnyOf2>; + /** + The id of the tab for which you want to adopt to the new window. + Optional. + **/ + @:optional + var tabId : Float; + /** + The number of pixels to position the new window from the left edge of the screen. If not specified, + the new window is offset naturally from the last focused window. This value is ignored for panels. + Optional. + **/ + @:optional + var left : Float; + /** + The number of pixels to position the new window from the top edge of the screen. If not specified, + the new window is offset naturally from the last focused window. This value is ignored for panels. + Optional. + **/ + @:optional + var top : Float; + /** + The width in pixels of the new window, including the frame. If not specified defaults to a natural width. + Optional. + **/ + @:optional + var width : Float; + /** + The height in pixels of the new window, including the frame. If not specified defaults to a natural height. + Optional. + **/ + @:optional + var height : Float; + /** + If true, the new window will be focused. If false, the new window will be opened in the background and the currently + focused window will stay focused. Defaults to true. + Optional. + **/ + @:optional + var focused : Bool; + /** + Whether the new window should be an incognito window. + Optional. + **/ + @:optional + var incognito : Bool; + /** + Specifies what type of browser window to create. The 'panel' and 'detached_panel' types create a popup unless the + '--enable-panels' flag is set. + Optional. + **/ + @:optional + var type : CreateType; + /** + The initial state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', + 'top', 'width' or 'height'. + Optional. + **/ + @:optional + var state : WindowState; + /** + Allow scripts to close the window. + Optional. + **/ + @:optional + var allowScriptsToClose : Bool; + /** + The CookieStoreId to use for all tabs that were created when the window is opened. + Optional. + **/ + @:optional + var cookieStoreId : String; + /** + A string to add to the beginning of the window title. + Optional. + **/ + @:optional + var titlePreface : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/windows/CreateType.hx b/externs/webextension_polyfill/windows/CreateType.hx new file mode 100644 index 0000000..ada6dab --- /dev/null +++ b/externs/webextension_polyfill/windows/CreateType.hx @@ -0,0 +1,7 @@ +package webextension_polyfill.windows; + +/** + Specifies what type of browser window to create. The 'panel' and 'detached_panel' types create a popup unless the + '--enable-panels' flag is set. +**/ +typedef CreateType = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/windows/GetAllGetInfoType.hx b/externs/webextension_polyfill/windows/GetAllGetInfoType.hx new file mode 100644 index 0000000..27ab76b --- /dev/null +++ b/externs/webextension_polyfill/windows/GetAllGetInfoType.hx @@ -0,0 +1,24 @@ +package webextension_polyfill.windows; + +/** + Specifies properties used to filter the $(ref:windows.Window) returned and to determine whether they should contain a + list of the $(ref:tabs.Tab) objects. +**/ +typedef GetAllGetInfoType = { + /** + If set, the $(ref:windows.Window) returned will be filtered based on its type. If unset the default filter is set to + ['app', 'normal', 'panel', 'popup'], with 'app' and 'panel' + window types limited to the extension's own windows. + Optional. + **/ + @:optional + var windowTypes : Array; + /** + 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. + Optional. + **/ + @:optional + var populate : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/windows/GetInfo.hx b/externs/webextension_polyfill/windows/GetInfo.hx new file mode 100644 index 0000000..cb5448c --- /dev/null +++ b/externs/webextension_polyfill/windows/GetInfo.hx @@ -0,0 +1,15 @@ +package webextension_polyfill.windows; + +/** + Specifies whether the $(ref:windows.Window) returned should contain a list of the $(ref:tabs.Tab) objects. +**/ +typedef GetInfo = { + /** + 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. + Optional. + **/ + @:optional + var populate : Bool; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/windows/Static.hx b/externs/webextension_polyfill/windows/Static.hx new file mode 100644 index 0000000..41548f1 --- /dev/null +++ b/externs/webextension_polyfill/windows/Static.hx @@ -0,0 +1,55 @@ +package webextension_polyfill.windows; + +typedef Static = { + /** + Gets details about a window. + **/ + function get(windowId:Float, ?getInfo:GetInfo):js.lib.Promise; + /** + Gets the $(topic:current-window)[current window]. + **/ + function getCurrent(?getInfo:GetInfo):js.lib.Promise; + /** + Gets the window that was most recently focused — typically the window 'on top'. + **/ + function getLastFocused(?getInfo:GetInfo):js.lib.Promise; + /** + Gets all windows. + **/ + function getAll(?getInfo:GetAllGetInfoType):js.lib.Promise>; + /** + Creates (opens) a new browser with any optional sizing, position or default URL provided. + **/ + function create(?createData:CreateCreateDataType):js.lib.Promise; + /** + Updates the properties of a window. Specify only the properties that you want to change; unspecified properties will be + left unchanged. + **/ + function update(windowId:Float, updateInfo:UpdateUpdateInfoType):js.lib.Promise; + /** + Removes (closes) a window, and all the tabs inside it. + **/ + function remove(windowId:Float):js.lib.Promise; + /** + Fired when a window is created. + **/ + var onCreated : webextension_polyfill.events.Event<(window:Window) -> Void>; + /** + Fired when a window is removed (closed). + **/ + var onRemoved : webextension_polyfill.events.Event<(windowId:Float) -> Void>; + /** + Fired when the currently focused window changes. Will be $(ref:windows.WINDOW_ID_NONE) + if all browser windows have lost focus. Note: On some Linux window managers, WINDOW_ID_NONE will always be sent + immediately preceding a switch from one browser window to another. + **/ + var onFocusChanged : webextension_polyfill.events.Event<(windowId:Float) -> Void>; + /** + The windowId value that represents the absence of a browser window. + **/ + var WINDOW_ID_NONE : Int; + /** + The windowId value that represents the $(topic:current-window)[current window]. + **/ + var WINDOW_ID_CURRENT : Int; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/windows/UpdateUpdateInfoType.hx b/externs/webextension_polyfill/windows/UpdateUpdateInfoType.hx new file mode 100644 index 0000000..e857bce --- /dev/null +++ b/externs/webextension_polyfill/windows/UpdateUpdateInfoType.hx @@ -0,0 +1,55 @@ +package webextension_polyfill.windows; + +typedef UpdateUpdateInfoType = { + /** + The offset from the left edge of the screen to move the window to in pixels. This value is ignored for panels. + Optional. + **/ + @:optional + var left : Float; + /** + The offset from the top edge of the screen to move the window to in pixels. This value is ignored for panels. + Optional. + **/ + @:optional + var top : Float; + /** + The width to resize the window to in pixels. This value is ignored for panels. + Optional. + **/ + @:optional + var width : Float; + /** + The height to resize the window to in pixels. This value is ignored for panels. + Optional. + **/ + @:optional + var height : Float; + /** + If true, brings the window to the front. If false, brings the next window in the z-order to the front. + Optional. + **/ + @:optional + var focused : Bool; + /** + If true, causes the window to be displayed in a manner that draws the user's attention to the window, + without changing the focused window. The effect lasts until the user changes focus to the window. + This option has no effect if the window already has focus. Set to false to cancel a previous draw attention request. + Optional. + **/ + @:optional + var drawAttention : Bool; + /** + The new state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', + 'width' or 'height'. + Optional. + **/ + @:optional + var state : WindowState; + /** + A string to add to the beginning of the window title. + Optional. + **/ + @:optional + var titlePreface : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/windows/Window.hx b/externs/webextension_polyfill/windows/Window.hx new file mode 100644 index 0000000..0976b4a --- /dev/null +++ b/externs/webextension_polyfill/windows/Window.hx @@ -0,0 +1,82 @@ +package webextension_polyfill.windows; + +typedef Window = { + /** + 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. + Optional. + **/ + @:optional + var id : Float; + /** + Whether the window is currently the focused window. + **/ + var focused : Bool; + /** + 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. + Optional. + **/ + @:optional + var top : Float; + /** + 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. + Optional. + **/ + @:optional + var left : Float; + /** + 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. + Optional. + **/ + @:optional + var width : Float; + /** + 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. + Optional. + **/ + @:optional + var height : Float; + /** + Array of $(ref:tabs.Tab) objects representing the current tabs in the window. + Optional. + **/ + @:optional + var tabs : Array; + /** + Whether the window is incognito. + **/ + var incognito : Bool; + /** + The type of browser window this is. + Optional. + **/ + @:optional + var type : webextension_polyfill.tabs.WindowType; + /** + The state of this browser window. + Optional. + **/ + @:optional + var state : WindowState; + /** + Whether the window is set to be always on top. + **/ + var alwaysOnTop : Bool; + /** + The session ID used to uniquely identify a Window obtained from the $(ref:sessions) API. + Optional. + **/ + @:optional + var sessionId : String; + /** + The title of the window. Read-only. + Optional. + **/ + @:optional + var title : String; +}; \ No newline at end of file diff --git a/externs/webextension_polyfill/windows/WindowState.hx b/externs/webextension_polyfill/windows/WindowState.hx new file mode 100644 index 0000000..bb8d5fc --- /dev/null +++ b/externs/webextension_polyfill/windows/WindowState.hx @@ -0,0 +1,7 @@ +package webextension_polyfill.windows; + +/** + The state of this browser window. Under some circumstances a Window may not be assigned state property, + for example when querying closed windows from the $(ref:sessions) API. +**/ +typedef WindowState = String; \ No newline at end of file diff --git a/externs/webextension_polyfill/windows/WindowType.hx b/externs/webextension_polyfill/windows/WindowType.hx new file mode 100644 index 0000000..e37a435 --- /dev/null +++ b/externs/webextension_polyfill/windows/WindowType.hx @@ -0,0 +1,7 @@ +package webextension_polyfill.windows; + +/** + The type of browser window this is. Under some circumstances a Window may not be assigned type property, + for example when querying closed windows from the $(ref:sessions) API. +**/ +typedef WindowType = webextension_polyfill.tabs.WindowType; \ No newline at end of file diff --git a/haxe_libraries/haxe-strings.hxml b/haxe_libraries/haxe-strings.hxml new file mode 100644 index 0000000..59cd626 --- /dev/null +++ b/haxe_libraries/haxe-strings.hxml @@ -0,0 +1,5 @@ +# @install: lix --silent download "haxelib:/haxe-strings#7.0.3" into haxe-strings/7.0.3/haxelib +-cp ${HAXE_LIBCACHE}/haxe-strings/7.0.3/haxelib/src/ +-D haxe-strings=7.0.3 +--macro hx.strings.internal.Macros.addDefines() +--macro hx.strings.internal.Macros.configureNullSafety() diff --git a/haxe_libraries/hscript.hxml b/haxe_libraries/hscript.hxml new file mode 100644 index 0000000..106e1f8 --- /dev/null +++ b/haxe_libraries/hscript.hxml @@ -0,0 +1,5 @@ +# @install: lix --silent download "haxelib:/hscript#2.5.0" into hscript/2.5.0/haxelib +# @run: haxelib run-dir hscript "${HAXE_LIBCACHE}/hscript/2.5.0/haxelib" +-cp ${HAXE_LIBCACHE}/hscript/2.5.0/haxelib/ +-D hscript=2.5.0 +--macro keep('IntIterator') \ No newline at end of file diff --git a/haxe_libraries/kiss-firefox.hxml b/haxe_libraries/kiss-firefox.hxml new file mode 100644 index 0000000..6c276cf --- /dev/null +++ b/haxe_libraries/kiss-firefox.hxml @@ -0,0 +1,4 @@ +# @install: lix --silent download "gh://github.com/kiss-lang/kiss-firefox#0d2d1f75b04b1d400ae844c4adffdeab690cb2af" into kiss-firefox/0.0.0/github/0d2d1f75b04b1d400ae844c4adffdeab690cb2af +-lib kiss +-cp ${HAXE_LIBCACHE}/kiss-firefox/0.0.0/github/0d2d1f75b04b1d400ae844c4adffdeab690cb2af/src/ +-D kiss-firefox=0.0.0 \ No newline at end of file diff --git a/haxe_libraries/kiss.hxml b/haxe_libraries/kiss.hxml new file mode 100644 index 0000000..d856824 --- /dev/null +++ b/haxe_libraries/kiss.hxml @@ -0,0 +1,12 @@ +# @install: lix --silent download "gh://github.com/kiss-lang/kiss#fb34feb6103e45cc1f408db59e4f277bbfaa97f1" into kiss/0.0.1/github/fb34feb6103e45cc1f408db59e4f277bbfaa97f1 +# @run: haxelib run-dir kiss "${HAXE_LIBCACHE}/kiss/0.0.1/github/fb34feb6103e45cc1f408db59e4f277bbfaa97f1" +-lib haxe-strings +-lib hscript +-lib tink_json +-lib tink_macro +-lib tink_syntaxhub +-lib uuid +-cp ${HAXE_LIBCACHE}/kiss/0.0.1/github/fb34feb6103e45cc1f408db59e4f277bbfaa97f1/src +-D kiss=0.0.1 +-w -WUnusedPattern +--macro kiss.KissFrontend.use() \ No newline at end of file diff --git a/haxe_libraries/tink_core.hxml b/haxe_libraries/tink_core.hxml new file mode 100644 index 0000000..37a0d96 --- /dev/null +++ b/haxe_libraries/tink_core.hxml @@ -0,0 +1,3 @@ +# @install: lix --silent download "haxelib:/tink_core#2.1.0" into tink_core/2.1.0/haxelib +-cp ${HAXE_LIBCACHE}/tink_core/2.1.0/haxelib/src +-D tink_core=2.1.0 \ No newline at end of file diff --git a/haxe_libraries/tink_json.hxml b/haxe_libraries/tink_json.hxml new file mode 100644 index 0000000..b167de7 --- /dev/null +++ b/haxe_libraries/tink_json.hxml @@ -0,0 +1,4 @@ +# @install: lix --silent download "haxelib:/tink_json#0.11.0" into tink_json/0.11.0/haxelib +-lib tink_typecrawler +-cp ${HAXE_LIBCACHE}/tink_json/0.11.0/haxelib/src +-D tink_json=0.11.0 \ No newline at end of file diff --git a/haxe_libraries/tink_macro.hxml b/haxe_libraries/tink_macro.hxml new file mode 100644 index 0000000..1e712e7 --- /dev/null +++ b/haxe_libraries/tink_macro.hxml @@ -0,0 +1,4 @@ +# @install: lix --silent download "gh://github.com/kiss-lang/tink_macro#8b60a484b1141d1176b34ba3af9ac65b499079ff" into tink_macro/1.0.3/github/8b60a484b1141d1176b34ba3af9ac65b499079ff +-lib tink_core +-cp ${HAXE_LIBCACHE}/tink_macro/1.0.3/github/8b60a484b1141d1176b34ba3af9ac65b499079ff/src +-D tink_macro=1.0.3 \ No newline at end of file diff --git a/haxe_libraries/tink_priority.hxml b/haxe_libraries/tink_priority.hxml new file mode 100644 index 0000000..98cfa80 --- /dev/null +++ b/haxe_libraries/tink_priority.hxml @@ -0,0 +1,3 @@ +-D tink_priority=0.1.3 +# @install: lix --silent download "gh://github.com/haxetink/tink_priority#ea736d31dc788aae703a2aa415c25d5b80d0e7d1" into tink_priority/0.1.3/github/ea736d31dc788aae703a2aa415c25d5b80d0e7d1 +-cp ${HAXE_LIBCACHE}/tink_priority/0.1.3/github/ea736d31dc788aae703a2aa415c25d5b80d0e7d1/src diff --git a/haxe_libraries/tink_syntaxhub.hxml b/haxe_libraries/tink_syntaxhub.hxml new file mode 100644 index 0000000..e3c7d2b --- /dev/null +++ b/haxe_libraries/tink_syntaxhub.hxml @@ -0,0 +1,6 @@ +# @install: lix --silent download "gh://github.com/haxetink/tink_syntaxhub#b6ea4966bbdee4d176ac8dd5d2d8ae3b362b2f86" into tink_syntaxhub/0.6.0/github/b6ea4966bbdee4d176ac8dd5d2d8ae3b362b2f86 +-lib tink_macro +-lib tink_priority +-cp ${HAXE_LIBCACHE}/tink_syntaxhub/0.6.0/github/b6ea4966bbdee4d176ac8dd5d2d8ae3b362b2f86/src +-D tink_syntaxhub=0.6.0 +--macro tink.SyntaxHub.use() \ No newline at end of file diff --git a/haxe_libraries/tink_typecrawler.hxml b/haxe_libraries/tink_typecrawler.hxml new file mode 100644 index 0000000..373aee9 --- /dev/null +++ b/haxe_libraries/tink_typecrawler.hxml @@ -0,0 +1,4 @@ +# @install: lix --silent download "haxelib:/tink_typecrawler#0.7.0" into tink_typecrawler/0.7.0/haxelib +-lib tink_macro +-cp ${HAXE_LIBCACHE}/tink_typecrawler/0.7.0/haxelib/src +-D tink_typecrawler=0.7.0 \ No newline at end of file diff --git a/haxe_libraries/uuid.hxml b/haxe_libraries/uuid.hxml new file mode 100644 index 0000000..ff1269b --- /dev/null +++ b/haxe_libraries/uuid.hxml @@ -0,0 +1,3 @@ +# @install: lix --silent download "haxelib:/uuid#2.4.1" into uuid/2.4.1/haxelib +-cp ${HAXE_LIBCACHE}/uuid/2.4.1/haxelib/src +-D uuid=2.4.1 \ No newline at end of file diff --git a/icons/icon-48.png b/icons/icon-48.png new file mode 100644 index 0000000..90687de Binary files /dev/null and b/icons/icon-48.png differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..526f277 --- /dev/null +++ b/manifest.json @@ -0,0 +1,26 @@ +{ + "name": "shortcutter", + "description": "browser extension to inject keyboard shortcuts on any webpage", + "background": { + "scripts": [ + "bin/browser-polyfill.js", + "bin/background.js" + ] + }, + "icons": { + "48": "icons/icon-48.png" + }, + "content_scripts": [ + { + "js": [ + "bin/browser-polyfill.js", + "bin/main.js" + ], + "matches": [ + "" + ] + } + ], + "version": "0.0", + "manifest_version": 2 +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..0c84087 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,55 @@ +{ + "name": "shortcutter", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "shortcutter", + "version": "0.0.0", + "hasInstallScript": true, + "dependencies": { + "@types/webextension-polyfill": "^0.10.0", + "webextension-polyfill": "^0.10.0" + }, + "devDependencies": { + "dts2hx": "^0.19.0" + } + }, + "node_modules/@types/webextension-polyfill": { + "version": "0.10.7", + "resolved": "https://registry.npmjs.org/@types/webextension-polyfill/-/webextension-polyfill-0.10.7.tgz", + "integrity": "sha512-10ql7A0qzBmFB+F+qAke/nP1PIonS0TXZAOMVOxEUsm+lGSW6uwVcISFNa0I4Oyj0884TZVWGGMIWeXOVSNFHw==" + }, + "node_modules/dts2hx": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/dts2hx/-/dts2hx-0.19.2.tgz", + "integrity": "sha512-1+X3kOB941APt/O6b5jX9+XMefRPqvFk4fvGDHPLIbuYdIAjNwcX3XOuZJ9fYtUD7Odn4ACPfK2ql2HWaFrLrg==", + "dev": true, + "dependencies": { + "typescript": "3.7.4" + }, + "bin": { + "dts2hx": "cli.js" + } + }, + "node_modules/typescript": { + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.4.tgz", + "integrity": "sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/webextension-polyfill": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/webextension-polyfill/-/webextension-polyfill-0.10.0.tgz", + "integrity": "sha512-c5s35LgVa5tFaHhrZDnr3FpQpjj1BB+RXhLTYUxGqBVN460HkbM8TBtEqdXWbpTKfzwCcjAZVF7zXCYSKtcp9g==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..847b49c --- /dev/null +++ b/package.json @@ -0,0 +1,16 @@ +{ + "main": "index.js", + "name": "shortcutter", + "description": "browser extension to inject keyboard shortcuts on any webpage", + "dependencies": { + "webextension-polyfill": "^0.10.0", + "@types/webextension-polyfill": "^0.10.0" + }, + "devDependencies": { + "dts2hx": "^0.19.0" + }, + "version": "0.0.0", + "scripts": { + "postinstall": "dts2hx --all --noLibWrap" + } +} \ No newline at end of file diff --git a/src/shortcutter/Background.hx b/src/shortcutter/Background.hx new file mode 100644 index 0000000..ccf201d --- /dev/null +++ b/src/shortcutter/Background.hx @@ -0,0 +1,7 @@ +package shortcutter; + +class Background { + static function main() { + Background_.main(); + } +} \ No newline at end of file diff --git a/src/shortcutter/Background_.kiss b/src/shortcutter/Background_.kiss new file mode 100644 index 0000000..c4070da --- /dev/null +++ b/src/shortcutter/Background_.kiss @@ -0,0 +1,7 @@ +(defMacroVar mainKissFile kissFile) +(loadFrom "kiss-firefox" "src/kiss_firefox/Util.kiss") +(loadFrom "kiss-firefox" "src/kiss_firefox/BackgroundUtil.kiss") + +// REMEMBER THAT CONSOLE OUTPUT GOES TO A SEPARATE BACKGROUND CONSOLE. + +(onMessage "exampleMessage" [data1 data2] ~data1 ~data2) \ No newline at end of file diff --git a/src/shortcutter/Main.hx b/src/shortcutter/Main.hx new file mode 100644 index 0000000..08f4b3b --- /dev/null +++ b/src/shortcutter/Main.hx @@ -0,0 +1,7 @@ +package shortcutter; + +class Main { + static function main() { + Main_.main(); + } +} diff --git a/src/shortcutter/Main_.kiss b/src/shortcutter/Main_.kiss new file mode 100644 index 0000000..8dd2595 --- /dev/null +++ b/src/shortcutter/Main_.kiss @@ -0,0 +1,6 @@ +(defMacroVar mainKissFile kissFile) +(loadFrom "kiss-firefox" "src/kiss_firefox/Util.kiss") +(loadFrom "kiss-firefox" "src/kiss_firefox/ContentUtil.kiss") + +(set js.Lib.global.document.body.style.border "5px solid red") +(sendMessage "exampleMessage" [3 4]) \ No newline at end of file diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..d6444af --- /dev/null +++ b/test.sh @@ -0,0 +1,7 @@ +#! /bin/bash + +if [ ! -d node_modules ]; then + npm install +fi + +haxe -D test build.hxml \ No newline at end of file