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,17 @@
package webextension_polyfill.events;
/**
An object which allows the addition and removal of listeners for a Chrome event.
**/
typedef Event<T> = {
/**
Registers an event listener <em>callback</em> to an event.
**/
function addListener(callback:T, params:haxe.extern.Rest<Dynamic>):Void;
/**
Deregisters an event listener <em>callback</em> from an event.
**/
function removeListener(callback:T):Void;
function hasListener(callback:T):Bool;
function hasListeners():Bool;
};

View File

@@ -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<String>;
/**
List of conditions that can trigger the actions.
**/
var conditions : Array<Dynamic>;
/**
List of actions that are triggered if one of the condtions is fulfilled.
**/
var actions : Array<Dynamic>;
/**
Optional priority of this rule. Defaults to 100.
Optional.
**/
@:optional
var priority : Float;
};

View File

@@ -0,0 +1,3 @@
package webextension_polyfill.events;
typedef Static = { };

View File

@@ -0,0 +1,140 @@
package webextension_polyfill.events;
/**
Filters URLs for various criteria. See <a href='events#filtered'>event filtering</a>. 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 <a
href="https://github.com/google/re2/blob/master/doc/syntax.txt">RE2 syntax</a>.
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 <a
href="https://github.com/google/re2/blob/master/doc/syntax.txt">RE2 syntax</a>.
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<String>;
/**
Matches if the port of the URL is contained in any of the specified port lists. For example <code>[80, 443, [1000, 1200]]
</code> matches all requests on port 80, 443 and in the range 1000-1200.
Optional.
**/
@:optional
var ports : Array<ts.AnyOf2<Float, ts.Tuple2<Float, Float>>>;
};