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

ACtl.TAB_ID


Constant that holds the ID of the tab the script is running in. ACtl.TAB_ID Returns Type: number A non-zero integer if the script is running in a tab.
Zero if the script is running in the background.

Example

Open a URL in the same tab the script is running in or in the #currentTab if the script is running in the background.

	if( ACtl.TAB_ID ){
		//If we are running in a tab
		ACtl.openURL('http://example.com', ACtl.TAB_ID) ;
	}else{
		//If we are running in the background
		ACtl.openURL('http://example.com', '#currentTab') ;
	}
	
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