VB icon

Google Chrome: List All Extensions In Profiles And Default Account

Email
Submitted on: 3/19/2019 10:50:35 AM
By: A_X_O 
Level: Beginner
User Rating: Unrated
Compatibility: VbScript (browser/client side)
Views: 759
 
     Google Chrome Extensions. This VBScript will now gather information on "All" installed Chrome Extensions Upto 20 User Created Profiles which can easily be increased and Now, the Default User Account will be scanned and all Extensions in that Account will be listed and Identified if possible. This is version 2:4 of the VBScript.

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: Google Chrome: List All Extensions In Profiles And Default Account
' Description:Google Chrome Extensions. 
This VBScript will now gather information on "All" installed Chrome Extensions 
Upto 20 User Created Profiles which can easily be increased and Now, the Default User Account will be scanned and all Extensions in that Account will be listed and Identified if possible. This is version 2:4 of the VBScript.
' By: A_X_O
'**************************************

'
'-------------------------------------------------------------------------------'
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'
'		Demonstration: Windows 10, Retrieving Google Chrome Extensions	'
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'
'										'
'	Purpose		: Demonstrates Searching SubFolder Collection		'
'	-----------------------------------------------------------------------	'
'	Creation Date	: 17/02/2019 [dd/mm/yyyy]				'
'	Version		: 2:6							'
'	Designer	: Fabian						'
'										'
'###############################################################################'
'			MODIFICATION HISTORY					'
'-------------------------------------------------------------------------------'
'										'
'	Version		: 1:0	17/02/2019	Create the Sample		'
'			: 1:1	18/02/2019	Error Fix [Dim] Name Redefined 	'
'			: 1:2	04/03/2019	Common Extension check		'
'			: 1:3	05/03/2019	Add Extension ID's 		'
'			: 1:3	05/03/2019	Tidy Script & Comments		'
'										'
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'
'										'
'	Version		: 2:0	09/03/2019	Re-Designed			'
'			: 2:1	09/03/2019	Scan Default Account		'
'			: 2:2	10/03/2019	Add Extension ID To Output	'
'			: 2:3 	11/03/2019	Fix Change process order 	'
'			: 2:4	14/03/2019	Clean-up Code and Comments	'
'			: 2:5 	18/03/2019	Fixed Error Detect AdBlockPlus '
'			: 2:6	18/03/2019	Fixed Extensions Size/Install	'
'										'
'-------------------------------------------------------------------------------'		
'
Public Const StrGC_FlashDownloader = "aiimdkdngfcipjohbjenkahhlhccpdbc"				'Currently identified extensions		
Public Const StrGC_VidDwnLderPlus = "baejfnndpekpkaaancgpakjaengfpopk"
Public Const StrGC_PopupBlocker = "bkkbcggnhapdmkeljlodobbkopceiche"
Public Const StrGC_AdBlockPlus = "cfhdojbkjhnklbpkdaibdccddilifddb"
Public Const StrGC_BlockSite = "eiimnmioipafcokbfikbljfdeojpcgbh"
Public Const StrGC_FLVdownloader = "ggehpnilnacjamdnhlfencbgnmalggje"	
Public Const StrGC_JvaScrptAlert = "ofjjanaennfbgpccfpbghnmblpdblbef"				
Public Const StrGC_YABlocker = "hflefjhkfeiaignkclmphmokmmbhbhik"
Public Const StrGC_ChromeTheme = "kneodmmmijlegjhehnmapbflegjnjegg"
Public Const StrGC_Slides = "aapocclcgogkmnckokdopfmhonfmgoek"
Public Const StrGC_Docs = "aohghmighlieiainnegkcijnfilokake"
Public Const StrGC_GoogleDrive = "apdfllckaahabafndbhieahigkjlhalf"
Public Const StrGC_SlinkyTheme = "bmanlajnpdncmhfkiccmbgeocgbncfln"
Public Const StrGC_GMailChecker = "mihcahmgecmbnbcchbopgniflfhgnkff"
Public Const StrGC_ChromeCast = "pkedcjkdefgpdelpbcmbmeomcjbeemfm"
Public Const StrGC_AdBlock = "gighmmpiobklfepjocnamgkkbiglidom"
Public Const StrGC_uBlock = "epcnnfbjfcgphgdmggkamkmgojdagdnn"
Public Const StrGC_uBlockOrigin = "cjpalhdlnbpafiamejdnhcphjbkeiagm"
Public Const StrGC_PrivacyBadger = "pkehgijcmpdhfbdbbnkijodmdjhbjlgp"
Public Const StrGC_GoogleMail = "pjkljhegncpnkpknbcohdijeoejaedia"
'
Public Const ExtID_Type = "Extension Type:"	
'
Public Const ExtID_FlshDwn = "Flash Video Downloader"						'Extensions description						
Public Const ExtID_VidDwnPlus = "Video Downloader Plus"
Public Const ExtID_PopBlocker = "Popup Blocker"
Public Const ExtID_AdBPlus = "Ad-Blocker Plus"
Public Const ExtID_BlockSite = "Block Site"
Public Const ExtID_FLVdownloader = "FLV. Video Downloader"					
Public Const ExtID_JavaSBlock = "Java Script Window Alert Control"				
Public Const ExtID_YTadBlocker = "YouTube and FaceBook Ad-Blocker"
Public Const ExtID_BlackChromeTheme = "Google Chrome Theme"
Public Const ExtID_Slides = "[Genuine] Google Slides"					
Public Const ExtID_Docs = "[Genuine] Google Docs"
Public Const ExtID_GoogleDrive = "[Genuine] Google Drive"					
Public Const ExtID_SlinkyTheme = "Google Chrome Theme (Slinky)"
Public Const ExtID_GMailChecker = "Gmail Email Checker"
Public Const ExtID_ChromeCast = "[Genuine] Google Chrome Cast"
Public Const ExtID_AdBlock = "AdBlock"
Public Const ExtID_uBlock = "uBlock"
Public Const ExtID_uBlockOrigin = "uBlockOrigin"
Public Const ExtID_PrivacyBadger = "Privacy Badger"
Public Const ExtID_GoogleMail = "Google Email"
'
Public Const ExtID_unKnown = "Unknown Extension"	
'
Public Const StrTargetDir = "\appdata\local\google\chrome\user data\<%PROFILE%>\extensions\"	'Google Chrome Profiles Directories
'											
Public Const StrDefaultDir = "\default\"
'
Public Const ObjReport = "\ChromeExtensions.txt"						'Google Chrome Default Profile Directory	
'
Public ExtensionCounter
Public ExtensionID	
'
Public Const ForWriting = 2									'Constants for I/O
Public Const ForAppending = 8
'
Dim FSO
'											
Dim WshShell											'Scripting Objects Used
'
Dim ProfileIndex	
'
Dim DefaultFolder										'Memory Space For The Variables
Dim TargetObject
Dim FoldersCollection
Dim GetInstallDate
Dim DriveLetter
Dim ExtensionsReport
Dim ChromeExtensions
Dim ExtInstall
Dim ExtensionInstallDate
Dim ExtensionSize
Dim ExtensionLModified
'
Set WshShell = Wscript.CreateObject("Wscript.Shell")						'Create an instance of the File System and Windows Scripting Host	
'
Set FSO = CreateObject("Scripting.FileSystemObject")	
'
	DriveLetter = WshShell.SpecialFolders("Desktop")					'Get the special folder "Desktop"
'
Set ExtensionsReport = FSO.CreateTextFile((DriveLetter) & (ObjReport), True)			'Get the Drive we are on	
'
If InStr(1, (StrTargetDir), "<%PROFILE%>", 1 ) Then	
'
	StrTarget = Replace((StrTargetDir), "\<%PROFILE%>\", StrDefaultDir, 1)			'Manipulate <%PROFILE%> in StrTargetDir we want the default profile
'												'\appdata\local\google\chrome\user data\<%PROFILE%>\extensions\"
'												'Is manipulated to: "\appdata\local\google\chrome\user data\default\extensions\"
End If
'
If Right((DriveLetter), 7) = "Desktop" Then
'
	DriveLetter = Mid((DriveLetter), 1, Len(DriveLetter) -8) 				'Trim the long Desktop path to remove the Desktop part	
'
End if
'
	ChromeExtensions = DriveLetter & StrTarget						'Build a clean path from the Drive to the Extensions folder
'
	ExtensionCounter = 1									'Set the Extension Counter
'
Set DefaultFolder = FSO.GetFolder(ChromeExtensions)	
'
Set FoldersCollection = DefaultFolder.SubFolders						'Get the Containing folder of the profiles	
'
For Each TargetObject in FoldersCollection							'Get all the folders in the containing folder
'
	ExtensionID = TargetObject.Name
'
	GetInstallDate = ChromeExtensions & TargetObject.Name	
'
Set ExtInstall = FSO.GetFolder(GetInstallDate)							'Get some basic FSO info on the Extension
'
	ExtensionInstallDate = ExtInstall.DateCreated
'
	ExtensionSize = Round((ExtInstall.Size)/1024, 0) 
'
	ExtensionLModified = ExtInstall.DateLastModified 
'
Call IdentifyExtension("Default_Account", TargetObject.Name)					'Send each folders name to the SubRoutine named IdentifyExtension()
'
	ExtensionCounter = ExtensionCounter + 1							'Count the extensions as they are found
'
Next
'
Public Sub IdentifyExtension(ByRef ProfileID, ByRef TargetID)					'The main Identification Sub
'
On Error Resume Next										'Jump-Over all Errors at this point
'
If StrGC_Slides = TargetID Then
'
	ObjExtensionType = ExtID_Slides								'Match Extension to Extension description							
'
ElseIf StrGC_Docs = TargetID Then: ObjExtensionType = ExtID_Docs
'
ElseIf StrGC_GoogleDrive = TargetID Then: ObjExtensionType = ExtID_GoogleDrive
'
ElseIf StrGC_SlinkyTheme = TargetID Then: ObjExtensionType = ExtID_SlinkyTheme
'
ElseIf StrGC_GMailChecker = TargetID Then: ObjExtensionType = ExtID_GMailChecker	
'
ElseIf StrGC_ChromeCast = TargetID Then: ObjExtensionType = ExtID_ChromeCast
'
ElseIf StrGC_AdBlock = TargetID Then: ObjExtensionType = ExtID_AdBlock
'
ElseIf StrGC_AdBlockPlus = TargetID Then: ObjExtensionType = ExtID_AdBPlus
'
ElseIf StrGC_uBlock = TargetID Then: ObjExtensionType = ExtID_uBlock
'
ElseIf StrGC_uBlockOrigin = TargetID Then: ObjExtensionType = ExtID_uBlockOrigin
'
ElseIf StrGC_PrivacyBadger = TargetID Then: ObjExtensionType = ExtID_PrivacyBadger	
'
ElseIf StrGC_GMailChecker = TargetID Then: ObjExtensionType = ExtID_GoogleMail
'
ElseIf StrGC_JvaScrptAlert = TargetID Then: ObjExtensionType = ExtID_JavaSBlock
'
ElseIf StrGC_YABlocker = TargetID Then: ObjExtensionType = ExtID_YTadBlocker
'
ElseIf StrGC_ChromeTheme = TargetID Then: ObjExtensionType = ExtID_BlackChromeTheme
'
ElseIf StrGC_FlashDownloader = TargetID Then: ObjExtensionType = ExtID_FlshDwn
'
ElseIf StrGC_VidDwnLderPlus = TargetID Then: ObjExtensionType = ExtID_VidDwnPlus
'
ElseIf StrGC_PopupBlocker = TargetID Then: ObjExtensionType = ExtID_PopBlocker		
'
ElseIf StrGC_AdBlockPlus = TargetID Then: ObjExtensionType = ExtID_AdBPlus
'
ElseIf StrGC_BlockSite = TargetID Then: ObjExtensionType = ExtID_BlockSite
'
ElseIf StrGC_FLVdownloader = TargetID Then: ObjExtensionType = ExtID_FLVdownloader	
'
Else:	ObjExtensionType = ExtID_unKnown			
'
End If												'If the Extension has been identified, write it's data to the log											
'												'Put together the Log of found Extensions. Identified or Not
	ExtensionList = "Profile Index:" & VbTab & VbTab & ProfileID & VbCrLf & _
					"Extension Index:" & VbTab & ExtensionCounter & VbCrLf & _
					"Extension Type ID:" & VbTab & ObjExtensionType & VbCrLf & _
					"Extension Install Date:" & VbTab & ExtensionInstallDate & VbCrlf & _
					"Extension Size:" & VbTab & VbTab & ExtensionSize & Space(1) & "Kbs" & VbCrLf & _
					"Date Modified:" & VbTab & VbTab & ExtensionLModified & VbCrLf & _
					"Extension ID:" & VbTab & VbTab & ExtensionID & VbCrLf & String(50,"-") & VbCrLf 
'
	ExtensionsReport.Write ExtensionList
'
End Sub
'
Call ScanIndexedProfiles()
'
Public Sub ScanIndexedProfiles()								'Now Scan all the remaining chrome user created profiles
'
On Error Resume Next										'Again, Jump-Over any Errors that get thrown at us
'
	ExtensionCounter = 1
'
For ProfileIndex = 1 to 20									'In this app, the first 20 profiles are scanned. Change the 20 Limit to a higher int if necessary			
'
If InStr(1, (StrTargetDir), "<%PROFILE%>", 1) Then						'Again, manipulate the main StrTargetDir string to include the profile integers					
'
	ChromeProfiles = Replace((StrTargetDir), "<%PROFILE%>", "Profile " & ProfileIndex)
'
	ExtensionCounter = 1
'
	ChromeExtensions = DriveLetter & ChromeProfiles						'Build a clean path to the extensions
'
End If
'
If FSO.FolderExists(ChromeExtensions) = False Then
'	
	WScript.Quit										'Exit the app after we scanned the last profile	
'
Set FSO = Nothing										'Clean Up
Set WshShell = Nothing
'
End If
'
Set TargetFolder = FSO.GetFolder(ChromeExtensions)						'Get the profile main directory	
'
Set TargetSubFolder = TargetFolder.SubFolders							'Get the folders contained within the main directory
'
For Each TargetDir in TargetSubFolder	
'
	ExtensionCounter = ExtensionCounter + 1
'
	ExtensionID = TargetDir.Name
'
	GetInstallDate = ChromeExtensions & TargetDir.Name					'Get the Extension directory and pass it to FSO	
'
Set ExtInstall = FSO.GetFolder(GetInstallDate)							'Get some basic FSO info on the Extension in each Profile Found.
'
	ExtensionInstallDate = ExtInstall.DateCreated						'Extension install date: [date directory was created.]
'
	ExtensionSize = Round((ExtInstall.Size)/1024, 0) 					'Killo Byte Size of Extension directory
'
	ExtensionLModified = ExtInstall.DateLastModified 					'Last date the Extension's directory was modified
'
	PrfIndex = "Profile #:" & Space(1) & ProfileIndex
'
Call IdentifyExtension(PrfIndex, TargetDir.Name)						'Send each folder's name to the Identification Sub to see if we can ID it.		
'
Next
'
Next
'
End Sub												'Exit the script
'
'


Other 17 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.