EthanBrown.ChromeCanaryDevExtensions 0.0.1
Includes Batarang Clear Cache DevTools AutoSave PageSpeed Insights Simple REST Client Speed Tracer CoffeeConsole YSlow Does Not Include CoffeeScript IDE - Requires login PostMan - Requires login LiveReload - Not necessary with grunt Grunt DevTools - Evaluating Tincr - Might be superceded by Chrome workspaces
This commit is contained in:
@@ -0,0 +1,90 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||||
|
<metadata>
|
||||||
|
<id>EthanBrown.ChromeCanaryDevExtensions</id>
|
||||||
|
<title>Chrome Canary - Web Development Extensions</title>
|
||||||
|
<version>0.0.1</version>
|
||||||
|
<authors>Various</authors>
|
||||||
|
<owners>Ethan Brown</owners>
|
||||||
|
<summary>Chrome Canary extensions for web development.</summary>
|
||||||
|
<description>Includes a number of very useful extensions for web application
|
||||||
|
development within Chrome.
|
||||||
|
|
||||||
|
WARNING: This is not a "silent" installer.
|
||||||
|
|
||||||
|
Chrome no longer provides any ability to automatically install extensions
|
||||||
|
due to abuse, so the existing preferences file is examined, to determine
|
||||||
|
what is currently installed.
|
||||||
|
|
||||||
|
For plugins that are not installed, Chrome is launched with each extension
|
||||||
|
in a new browser tab, where the user must press the 'Add To Chrome' button.
|
||||||
|
|
||||||
|
Included
|
||||||
|
===========================================================================
|
||||||
|
|
||||||
|
- Batarang for AngularJS development
|
||||||
|
https://chrome.google.com/webstore/detail/ighdmehidhipcmcojjgiloacoafjmpfk
|
||||||
|
|
||||||
|
- Clear Cache
|
||||||
|
https://chrome.google.com/webstore/detail/cppjkneekbjaeellbfkmgnhonkkjfpdn
|
||||||
|
|
||||||
|
- DevTools AutoSave
|
||||||
|
https://chrome.google.com/webstore/detail/mlejngncgiocofkcbnnpaieapabmanfl
|
||||||
|
|
||||||
|
- PageSpeed Insights
|
||||||
|
https://developers.google.com/speed/docs/insights/using_chrome
|
||||||
|
|
||||||
|
- YSlow
|
||||||
|
https://chrome.google.com/webstore/detail/yslow/ninejjcohidippngpapiilnmkgllmakh
|
||||||
|
|
||||||
|
- Simple REST Client
|
||||||
|
https://chrome.google.com/webstore/detail/simple-rest-client/fhjcajmcbmldlhcimfajhfbgofnpcjmb
|
||||||
|
|
||||||
|
Postman is the preferred client, but requires login, which is
|
||||||
|
often undesireable with a test browser
|
||||||
|
https://chrome.google.com/webstore/detail/fdmmgilgnpjigdojojpjoooidkmcomcm
|
||||||
|
|
||||||
|
- Speed Tracer
|
||||||
|
https://chrome.google.com/webstore/detail/ognampngfcbddbfemdapefohjiobgbdl
|
||||||
|
|
||||||
|
- CoffeeConsole
|
||||||
|
https://chrome.google.com/webstore/detail/coffeeconsole/ladbkfdlnaibelfidknofapbbdlhadfp
|
||||||
|
|
||||||
|
CoffeeScript IDE is preferred, but requires login
|
||||||
|
https://chrome.google.com/webstore/detail/coffeescript-ide/hikjpmfebkagiijbdinakadphhjffaik
|
||||||
|
|
||||||
|
|
||||||
|
Previously Included
|
||||||
|
===========================================================================
|
||||||
|
|
||||||
|
- LiveReload
|
||||||
|
https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei
|
||||||
|
Grunt-contrib-livereload plugin now handles this
|
||||||
|
|
||||||
|
- Tincr
|
||||||
|
https://chrome.google.com/webstore/detail/tincr/lfjbhpnjiajjgnjganiaggebdhhpnbih
|
||||||
|
Hasn't been updated recently, and Chrome workspaces might supercede this
|
||||||
|
|
||||||
|
Under evaluation
|
||||||
|
===========================================================================
|
||||||
|
|
||||||
|
- Grunt DevTools
|
||||||
|
https://chrome.google.com/webstore/detail/grunt-devtools/fbiodiodggnlakggeeckkjccjhhjndnb
|
||||||
|
</description>
|
||||||
|
<projectUrl>http://github.com/Iristyle/ChocolateyPackages/</projectUrl>
|
||||||
|
<tags>Google Chrome Canary Extension Development Web</tags>
|
||||||
|
<!-- Eula is in installer
|
||||||
|
<licenseUrl></licenseUrl>
|
||||||
|
-->
|
||||||
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
|
<iconUrl>https://github.com/Iristyle/ChocolateyPackages/raw/master/GoogleChrome.Canary/GoogleChrome.Canary.png</iconUrl>
|
||||||
|
<releaseNotes></releaseNotes>
|
||||||
|
<dependencies>
|
||||||
|
<dependency id="GoogleChrome.Canary" />
|
||||||
|
</dependencies>
|
||||||
|
</metadata>
|
||||||
|
<files>
|
||||||
|
<file src="..\core\ChromeHelpers.ps1" target="tools" />
|
||||||
|
<file src="tools\**" target="tools" />
|
||||||
|
</files>
|
||||||
|
</package>
|
@@ -0,0 +1,38 @@
|
|||||||
|
$package = 'EthanBrown.ChromeCanaryDevExtensions'
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
function Get-CurrentDirectory
|
||||||
|
{
|
||||||
|
$thisName = $MyInvocation.MyCommand.Name
|
||||||
|
[IO.Path]::GetDirectoryName((Get-Content function:$thisName).File)
|
||||||
|
}
|
||||||
|
|
||||||
|
. (Join-Path (Get-CurrentDirectory) 'ChromeHelpers.ps1')
|
||||||
|
|
||||||
|
$toInstall = @{
|
||||||
|
"ighdmehidhipcmcojjgiloacoafjmpfk" = "Batarang";
|
||||||
|
"cppjkneekbjaeellbfkmgnhonkkjfpdn" = "Clear Cache";
|
||||||
|
"mlejngncgiocofkcbnnpaieapabmanfl" = "DevTools AutoSave";
|
||||||
|
"gplegfbjlmmehdoakndmohflojccocli" = "PageSpeed Insights";
|
||||||
|
"fhjcajmcbmldlhcimfajhfbgofnpcjmb" = "Simple REST Client";
|
||||||
|
"ognampngfcbddbfemdapefohjiobgbdl" = "Speed Tracer";
|
||||||
|
"ladbkfdlnaibelfidknofapbbdlhadfp" = "CoffeeConsole";
|
||||||
|
"ninejjcohidippngpapiilnmkgllmakh" = "YSlow";
|
||||||
|
# has messed up install requirements
|
||||||
|
# "hikjpmfebkagiijbdinakadphhjffaik" = "CoffeeScript IDE";
|
||||||
|
# "fdmmgilgnpjigdojojpjoooidkmcomcm" = "PostMan";
|
||||||
|
# handled by Grunt
|
||||||
|
# "jnihajbhpnppcggbcgedagnkighmdlei" = "LiveReload";
|
||||||
|
# deprecated for now
|
||||||
|
# "fbiodiodggnlakggeeckkjccjhhjndnb" = "Grunt DevTools";
|
||||||
|
# "lfjbhpnjiajjgnjganiaggebdhhpnbih" = "Tincr"
|
||||||
|
}
|
||||||
|
|
||||||
|
Install-ChromeExtensions $toInstall -Canary
|
||||||
|
|
||||||
|
Write-ChocolateySuccess $package
|
||||||
|
} catch {
|
||||||
|
Write-ChocolateyFailure $package "$($_.Exception.Message)"
|
||||||
|
throw
|
||||||
|
}
|
@@ -0,0 +1,24 @@
|
|||||||
|
$package = 'EthanBrown.ChromeCanaryDevExtensions'
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
function Get-CurrentDirectory
|
||||||
|
{
|
||||||
|
$thisName = $MyInvocation.MyCommand.Name
|
||||||
|
[IO.Path]::GetDirectoryName((Get-Content function:$thisName).File)
|
||||||
|
}
|
||||||
|
|
||||||
|
. (Join-Path (Get-CurrentDirectory) 'ChromeHelpers.ps1')
|
||||||
|
|
||||||
|
Write-Host "Launching Chrome Canary extensions page to remove extensions"
|
||||||
|
|
||||||
|
$chromePath = Get-ChromePath -Canary
|
||||||
|
$chromeExe = Join-Path $chromePath 'Application\chrome.exe'
|
||||||
|
$chromeParams = @('--new-window', 'chrome://extensions/')
|
||||||
|
&$chromeExe @chromeParams
|
||||||
|
|
||||||
|
Write-ChocolateySuccess $package
|
||||||
|
} catch {
|
||||||
|
Write-ChocolateyFailure $package "$($_.Exception.Message)"
|
||||||
|
throw
|
||||||
|
}
|
102
core/ChromeHelpers.ps1
Normal file
102
core/ChromeHelpers.ps1
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
function Get-ChromePath
|
||||||
|
{
|
||||||
|
[CmdletBinding()]
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
[Switch]
|
||||||
|
$Canary = $false
|
||||||
|
)
|
||||||
|
|
||||||
|
$path = if ($Canary) { 'Google\Chrome SxS' } else { 'Google\Chrome' }
|
||||||
|
|
||||||
|
Join-Path $Env:LOCALAPPDATA $path
|
||||||
|
}
|
||||||
|
|
||||||
|
function Get-ChromeExtensions
|
||||||
|
{
|
||||||
|
[CmdletBinding()]
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
[Switch]
|
||||||
|
$Canary = $false,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
[bool]
|
||||||
|
$ExcludeBlacklist = $true
|
||||||
|
)
|
||||||
|
|
||||||
|
$installed = @{}
|
||||||
|
|
||||||
|
$root = Get-ChromePath -Canary:$Canary
|
||||||
|
$prefsPath = Join-Path $root 'User Data\Default\Preferences'
|
||||||
|
|
||||||
|
if (Test-Path $prefsPath)
|
||||||
|
{
|
||||||
|
Write-Verbose "Examining $prefsPath for installed extensions...`n`n"
|
||||||
|
$prefs = ConvertFrom-Json ([IO.File]::ReadAllText($prefsPath))
|
||||||
|
|
||||||
|
$prefs.extensions.settings.PsObject.Properties |
|
||||||
|
? { if ($ExcludeBlacklist) { -not $_.Value.blacklist } else { $true } } |
|
||||||
|
% {
|
||||||
|
$installed[$_.Name] = $_.Value
|
||||||
|
$msg = "Found Extension $($_.Value.manifest.name) [$($_.Name)]"
|
||||||
|
if (!$ExcludeBlacklist -and $_.Value.blacklist)
|
||||||
|
{
|
||||||
|
$msg += " - Blacklist [$($_.Value.blacklist)]"
|
||||||
|
}
|
||||||
|
Write-Verbose $msg
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $installed
|
||||||
|
}
|
||||||
|
|
||||||
|
# this is a bit of a misnomer, it just finds and launches Chrome with
|
||||||
|
# new tabs for each extension since the end user still has to click a button
|
||||||
|
function Install-ChromeExtensions
|
||||||
|
{
|
||||||
|
[CmdletBinding()]
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
[Switch]
|
||||||
|
$Canary = $false,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[Hashtable]
|
||||||
|
$Extensions
|
||||||
|
# Expected a hash of Id / Name
|
||||||
|
)
|
||||||
|
|
||||||
|
$name = 'Chrome'
|
||||||
|
if ($Canary) { $name += ' Canary'}
|
||||||
|
|
||||||
|
$installed = Get-ChromeExtensions -Canary:$Canary
|
||||||
|
$rootPath = Get-ChromePath -Canary:$Canary
|
||||||
|
$chromeExe = Join-Path $rootPath 'Application\chrome.exe'
|
||||||
|
|
||||||
|
$Extensions.GetEnumerator() |
|
||||||
|
? { $installed.Keys -contains $_.Key } |
|
||||||
|
% {
|
||||||
|
Write-Verbose "$name Extension $($_.Value) [$($_.Key)] is already installed!"
|
||||||
|
}
|
||||||
|
|
||||||
|
$storeUrl = 'https://chrome.google.com/webstore/detail'
|
||||||
|
$chromeParams = @()
|
||||||
|
$neededPackages = $Extensions.GetEnumerator() |
|
||||||
|
? { $installed.Keys -notcontains $_.Key } |
|
||||||
|
% {
|
||||||
|
Write-Host "Launching $name to install extension $($_.Value) [$($_.Key)]!"
|
||||||
|
# http://peter.sh/experiments/chromium-command-line-switches/
|
||||||
|
$chromeParams += "--new-window", "$storeUrl/$($_.Key)"
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($chromeParams.Count -gt 0)
|
||||||
|
{
|
||||||
|
Write-Host "`n`nExecuting $chromeExe $chromeParams"
|
||||||
|
&$chromeExe @chromeParams
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Write-Host "`n`nAll extensions already installed!"
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user