Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-BrowserData.ps1 Problem Depth - Recursive Workaround for Bookmarks - Latest Chrome #10

Open
ghost opened this issue May 8, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented May 8, 2020

Hi sir,

I've determined the script is not fully functional anymore with the latest version of Chrome regarding fetching the bookmarks. Google Chrome has set the bookmarks based on folders, subfolders, subfolders .children so you cannot fetch them all with your current method. To work around this I've created the following adjustment.
You off course are free to integrate it into your scripts, as it is of much help to me! Thanks in advance.

Adjusted code:
function Get-ChromeBookmarks { $Path = "$Env:systemdrive\Users\$UserName\AppData\Local\Google\Chrome\User Data\Default\Bookmarks" if (-not (Test-Path -Path $Path)) { Write-Verbose "[-] Could not find Chrome Bookmarks for username: $UserName" } else { $Json = Get-Content $Path $Output = $Json | ConvertFrom-Json $Jsonobject1 = $Output.roots.bookmark_bar.children $Jsonobject2 = $Output.roots.bookmark_bar.children.children $Jsonobject3 = $Output.roots.bookmark_bar.children.children.children $Jsonobject4 = $Output.roots.bookmark_bar.children.children.children.children $Jsonobject5 = $Output.roots.bookmark_bar.children.children.children.children.children $Jsonobject6 = $Output.roots.bookmark_bar.children.children.children.children.children.children $JsonObject = $Jsonobject1, $Jsonobject2, $Jsonobject3, $Jsonobject4, $Jsonobject5, $Jsonobject6 $JsonObject | ForEach-Object { New-Object -TypeName PSObject -Property @{ User = $UserName Browser = 'Chrome' DataType = 'Bookmark' Data = $_.item('url') Name = $_.item('name') } } $JsonObject } }

Happy to help out!
Kind regards,
Martijn

@rvrsh3ll
Copy link
Owner

rvrsh3ll commented Jun 9, 2020

Great! Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant