AutoControl Control your browser your way Forum               Install now from theChrome Web Store

ACtl.off


Removes event listener functions from one or more event types.
ACtl.off([eventTypes,][listener]) eventTypes Type: string Default: undefined One or more event types (separated by a space character) from which to remove the listener function specified by listener. Refer to ACtl.on for the list of valid event types.
If this argument is omitted, the listener function will be removed from all event types.
listener Type: Function Default: undefined A listener function to remove (previously added with ACtl.on). If omitted, all listener functions will be removed from the event types specified by eventTypes. Returns Type: Promise Resolves to: Object Returns immediately. The Promise will resolve once the listener functions have been removed. Throws Type: string Error description if eventTypes contains an invalid event type or if listener is not a function.

Examples

Remove listeners by event type and by function.

	ACtl.on('tabOpen tabActivate', function listener1(event){ /* ... */ }) ;
	ACtl.on('tabLoadEnd', function(event){ /* ... */ }) ;
	//Remove `listener1` from all event types
	await ACtl.off(listener1) ;
	//Remove all listener functions from the 'tabLoadEnd' event type
	await ACtl.off('tabLoadEnd') ;
	

Remove all listener functions from all event types.

	//With no arguments, everything is removed
	await ACtl.off() ;
	
Scripting API Script Isolation Asynchronicity Backgrnd Scripts GUI vs API ACtl.include ACtl.import ACtl.getFile ACtl.saveFile ACtl.saveURL ACtl.openURL ACtl.closeTab ACtl.runInTab ACtl.runInFrames ACtl.runInPageCtx ACtl.getTabInfo ACtl.getTabIds ACtl.TAB_ID ACtl.setTabState ACtl.captureTab ACtl.execAction ACtl.runCommand ACtl.getClipboard ACtl.setClipboard ACtl.expand ACtl.switchState ACtl.var ACtl.pubVar ACtl.on ACtl.off ACtl.sleep ACtl.STOP_CHAIN ACtl.STOP_FULL_SEQ