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

View File

@@ -0,0 +1,6 @@
package webextension_polyfill.activitylog;
/**
The result of the call.
**/
typedef OnExtensionActivityDetailsTypeDataResultType = { };

View File

@@ -0,0 +1,28 @@
package webextension_polyfill.activitylog;
typedef OnExtensionActivityDetailsTypeDataType = {
/**
A list of arguments passed to the call.
Optional.
**/
@:optional
var args : Array<Dynamic>;
/**
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;
};

View File

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

View File

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

View File

@@ -0,0 +1,17 @@
package webextension_polyfill.activitylog;
/**
Receives an activityItem for each logging event.
**/
typedef OnExtensionActivityEvent = {
/**
Registers an event listener <em>callback</em> to an event.
**/
function addListener(callback:(details:OnExtensionActivityDetailsType) -> Void, id:String):Void;
/**
Deregisters an event listener <em>callback</em> from an event.
**/
function removeListener(callback:(details:OnExtensionActivityDetailsType) -> Void):Void;
function hasListener(callback:(details:OnExtensionActivityDetailsType) -> Void):Bool;
function hasListeners():Bool;
};

View File

@@ -0,0 +1,8 @@
package webextension_polyfill.activitylog;
typedef Static = {
/**
Receives an activityItem for each logging event.
**/
var onExtensionActivity : OnExtensionActivityEvent;
};