add firefox extension template

This commit is contained in:
2025-08-07 16:03:16 -05:00
parent 6cbb29fed1
commit 5df289ffcb
586 changed files with 13636 additions and 0 deletions

View File

@@ -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;
};

View File

@@ -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<js.html.Window>;
/**
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<Bool>;
/**
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<Bool>;
/**
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;
};

View File

@@ -0,0 +1,6 @@
package webextension_polyfill.extension;
/**
The type of extension view.
**/
typedef ViewType = String;