如何啟用被禁用的Chrome第三方插件?
目前,Chrome已經停用了第三方插件的使用,在原來的的自定義--工具--擴展程序--拖動crx文件到窗口的安裝辦法已經失效;請問有沒有什麼辦法啟用安裝第三方插件?
把crx改成rar,解壓,然後再開發模式下載入已解壓的程序
解決高版本Stable Beta擴展程序強制停用問題…_chrome吧百度 Chrome 吧之前的置頂帖,現在的精品帖。
使用chrome便攜版 比如chrome 41
解決辦法看這裡, 包括Windows和MAC版, 已解決自己mac的Chrome擴展停用問題 (macOS Sierra 10.12.3 + Chrome 55.0.2883.95)
Guide on Packaging and Import Baidu Exporter to Chrome
2018/01/06更新
對於最新版本的Chrome 63.0.3239.132(正式版本)已經不再有效,原作者也及時更新了原答案,新的方法怎麼說呢,比較麻煩了,觸及答主的知識盲區了,故不再搬運,有興趣的朋友請移步原答案圍觀。
鏈接請戳↓↓↓
How to get rid of amp;quot;disable developer mode extensionsamp;quot; pop-upstackoverflow.comHow to get rid of quot;disable developer mode extensionsquot; pop-upHow to get rid of amp;quot;disable developer mode extensionsamp;quot; pop-upstackoverflow.com2017/12/17 凌晨更新
原有答案代碼已失效,請直接到出處所在網站的第一個答案中複製最新的代碼,如果用之前的代碼會提示你更新。
為方便各位讀者,現粘貼代碼如下:
&<#
:
@echo off
"%temp%\%~n0.ps1"
&>nulpowershell -v 2
-ep bypass -noprofile "%temp%\%~n0.ps1"
""%cd% ""
""%~1""del "%temp%\%~n0.ps1"echo:
pauseexit /b#&>param([string]$cwd=".",
[string]$dll)
function main {
write-host -f white -b black `
"Chrome "developer mode extensions" warning disabler 2017.12.08" $pathsDone =
@{}
if
($dll -and (gi -literal $dll))
{ doPatch "DRAG"n"DROPPED"
((gi -literal $dll).directoryName +
"") exit } doPatch "CURRENT DIRECTORY"
((gi -literal $cwd).fullName +
"")
("HKLM",
"HKCU")
|
%{ $hive = $_ ("",
"Wow6432Node")
|
%{ $key =
"${hive}:SOFTWARE$_GoogleUpdateClients" gci -ea silentlycontinue $key -r | gp |
?{ $_.CommandLine
}
|
%{
$path = $_.CommandLine
-replace ""(.+?\d+.d+.d+.d+\).+",
"$1"
if
(!$pathsDone[$path.toLower()])
{ doPatch REGISTRY $path $pathsDone[$path.toLower()]
= $true }
}
}
}
}function doPatch([string]$pathLabel,
[string]$path)
{ $dll =
Join-Path $path chrome.dll if
(!(Test-Path
-literal $dll))
{
return
}
"" $localAppData =
[Environment]::GetFolderPath("LocalApplicationData")
"$pathLabel $((split-path $dll).Replace($localAppData, "%LocalAppData%"))"
"`tREADING Chrome.dll..." $bin =
[IO.BinaryReader][IO.File]::OpenRead($dll) $bytes = $bin.ReadBytes(1MB)
# process PE headers
$BC =
[BitConverter] $coff = $BC::ToUInt32($bytes,0x3C)
+
4 $is64 = $BC::ToUInt16($bytes,$coff)
-eq 0x8664 $opthdr = $coff+20 $codesize = $BC::ToUInt32($bytes,$opthdr+4) $imagebase32 = $BC::ToUInt32($bytes,$opthdr+28)
# patch the flag in data section $bin.BaseStream.Position
= $codesize $data = $BC::ToString($bin.ReadBytes($bin.BaseStream.Length
- $codesize)) $bin.Close() $flag =
"ExtensionDeveloperModeWarning"
$stroffs = $data.IndexOf($BC::ToString($flag[1..99]))
if
($stroffs -lt 0)
{ write-host -f red "`t$flag not found"
return
}
if
($data.substring($stroffs-3,
2)
-eq "00")
{ write-host -f darkgreen "`tALREADY PATCHED"
return
} $stroffs = $stroffs/3
-
1
+ $codesize $centbrowser = $data.indexOf($BC::ToString("CentBrowser"[0..99]))
-gt 0 $EA = $ErrorActionPreference $ErrorActionPreference =
"silentlyContinue" $exe = join-path (split-path $path) chrome.exe while
((get-process chrome -module |
?{ $_.FileName
-eq $exe }))
{ forEach ($timeout in
15..0)
{
write-host -n -b yellow -f black `
"`rChrome is running and will be terminated in $timeout sec. " write-host -n -b yellow -f darkyellow "Press ENTER to do it now. "
if
([console]::KeyAvailable)
{ $key = $Host.UI.RawUI.ReadKey("AllowCtrlC,IncludeKeyDown,NoEcho")
if
($key.virtualKeyCode -eq 13)
{
break
}
if
($key.virtualKeyCode -eq 27)
{ write-host; exit }
} sleep 1
} write-host get-process chrome |
?{ $_.MainWindowHandle.toInt64()
-and ($_ | gps -file).FileName
-eq $exe }
|
%{
"`tTrying to exit gracefully..."
if
($_.CloseMainWindow())
{ sleep 1
}
} $killLabelShown =
0
get-process chrome |
?{
($_ | gps -file |
select
-expand FileName)
-eq $exe }
|
%{
if
(!$killLabelShown++)
{
"`tTerminating background chrome processes..."
} stop-process $_ -force } sleep -milliseconds 200
} $ErrorActionPreference = $EA $bytes =
[IO.File]::ReadAllBytes($dll) $bytes[$stroffs]
=
0
"`tPATCHED $flag flag"
# patch the channel restriction code for stable/beta $rxChannel =
"(?!&<41-)83-F8-(?:03-7D|02-7F|02-0F-8F)"
# old code: cmp eax,3; jge ...
# new code: cmp eax,2; jg ... (jg can be 2-byte) function patch64 {
$patterns =
@(
"(?&$rxChannel)-.{1,100}-(?&48-8D-)"
# 48-8D-15-F3-78-87-00 first flag ref
# 48-8D-15-A4-78-87-00 second flag ref
"(?&4[8C]-8D-).{9}(.{6}).{100,600}4[8C]-8D-.{9}1.{600,2000}(?&$rxChannel)"
"84-C0.{18,48}(?&$rxChannel)-.{30,60}84-C0"
) forEach ($pattern in $patterns)
{ $pos =
0 $rx =
[regex]$pattern $patternDisplay = $pattern -replace "^(.{40}).+",
"$1" write-host -n -f darkgray "`tLooking for $patternDisplay"
do
{ $m = $rx.match($code, $pos) write-host -n -f darkgray .
if
(!$m.success)
{
break
} $chanpos = $searchBase + $m.groups["ch"].index/3
+
2 $pos = $m.groups["flag"].index + $m.groups["flag"].length $offs = $BC::ToUInt32($bytes, $searchBase + $pos/3+1) $diff = $searchBase + $pos/3+5+$offs - $stroffs #write-host ("`n{0,16:x}`t{1}" -f ($offs, $diff))
} until ($diff -ge 0
-and $diff -le 6000
-and $diff %
256
-eq 0) write-host #write-host ("{0,16:x}" -f ($searchBase + $pos/3))
if
($m.success)
{
break
} $chanpos =
0
} $chanpos } function patch86 { $flagOffs =
[uint32]$stroffs +
[uint32]$imagebase32 $flagOffsStr = $BC::ToString($BC::GetBytes($flagOffs))
#write-host $flagOffsStr $variants =
"(?&$rxChannel-.{1,300})-(68-(?&`$1-.{6}`$2.{100,200})){2}",
"68-(?&`$1-.{6}`$2).{300,500}E8.{12,32}(?&$rxChannel)",
"E8.{12,32}(?&$rxChannel).{300,500}68-(?&`$1-.{6}`$2)" forEach ($variant in $variants)
{ $pattern = $flagOffsStr -replace "^(..)-.{6}(..)", $variant $patternDisplay = $pattern -replace "^(.{40}).+",
"$1" write-host -f darkgray "`tLooking for $patternDisplay..." $minDiff =
65536
foreach
($m in
[regex]::matches($code, $pattern))
{ $maybeFlagOffs = $BC::toUInt32($bytes, $searchBase + $m.groups["flag"].index/3) $diff =
[Math]::abs($maybeFlagOffs - $flagOffs)
#write-host ("`n{0,16:x}`t{1}" -f ($maybeFlagOffs, $diff))
if
($diff %
256
-eq 0
-and $diff -lt $minDiff)
{ $minDiff = $diff $chanpos = $searchBase + $m.groups["ch"].index/3
+
2
}
}
} $chanpos } $passes =
3
foreach
($pass in $passes..1)
{
if
($centbrowser)
{
break
} $searchBase =
[int]($codesize/$passes *
($pass-1)) $code = $BC::ToString($bytes, $searchBase,
[int]($codesize/$passes)
+
2000) $chanpos =
if
($is64)
{ patch64 }
else
{ patch86 }
if
($chanpos)
{
break
} $searchBase =
0
}
if
($chanpos)
{
#write-host ("{0:x}" -f $chanpos) $bytes[$chanpos]
=
9
"`tPATCHED Chrome release channel restriction"
} elseif (!$centbrowser)
{ write-host -f red "`tUnable to find the channel code, try updating me" write-host -f red "`thttp://stackoverflow.com/a/30361260"
return
}
"`tWriting to a temporary dll..."
[IO.File]::WriteAllBytes("$dll.new",$bytes)
"`tBacking up the original dll..." move -literal $dll "$dll.bak"
-force "`tRenaming the temporary dll as the original dll..." move -literal "$dll.new" $dll -force write-host -f green "`tDONE.`n"
[GC]::Collect()
}main
使用方法與原答案一致。
之後如有提示更新本答案將不再更新。
分割線==================================================
親測有效,適用於windows,32/64位Chrome 44.0.2398.0及以上版本。複製以下代碼,粘貼到記事本,另存為bat文件,右鍵以管理員身份運行即可。chrome每次版本更新後需要重新運行一次。
出處:How to hack chrome.dll to get rid of the amp;quot;disable developer mode extensionsamp;quot; pop up
&<# :
@echo offcopy/b "%~f0" "%temp%\%~n0.ps1" &>nulpowershell -Version 2 -ExecutionPolicy bypass -noprofile "%temp%\%~n0.ps1" "%cd% " "%~1"del "%temp%\%~n0.ps1"pauseexit /b#&>param([string]$cwd=".", [string]$dll)function main {
"Chrome "developer mode extensions" warning disabler v1.0.8.20161207`n" $pathsDone = @{} if ($dll -and (gi -literal $dll)) { doPatch "DRAG"n"DROPPED" ((gi -literal $dll).directoryName + "") exit } doPatch CURRENT ((gi -literal $cwd).fullName + "") ("HKLM", "HKCU") | %{ $hive = $_ ("", "Wow6432Node") | %{ $key = "${hive}:SOFTWARE$_GoogleUpdateClients" gci -ea silentlycontinue $key -r | gp | ?{ $_.CommandLine } | %{ $path = $_.CommandLine -replace ""(.+?\d+.d+.d+.d+\).+", "$1" doPatch REGISTRY $path } } }}function doPatch([string]$pathLabel, [string]$path) {
if ($pathsDone[$path.toLower()]) { return }$dll = $path + "chrome.dll"
if (!(test-path -literal $dll)) { return } "=======================" "$pathLabel PATH $((gi -literal $dll).DirectoryName)""`tREADING Chrome.dll..."
$bytes = [IO.File]::ReadAllBytes($dll)# process PE headers
$BC = [BitConverter] $coff = $BC::ToUInt32($bytes,0x3C) + 4 $is64 = $BC::ToUInt16($bytes,$coff) -eq 0x8664 $opthdr = $coff+20 $codesize = $BC::ToUInt32($bytes,$opthdr+4) $imagebase32 = $BC::ToUInt32($bytes,$opthdr+28)# patch the flag in data section
$data = $BC::ToString($bytes,$codesize) $flag = "ExtensionDeveloperModeWarning" $stroffs = $data.IndexOf($BC::ToString($flag[1..99]))/3 - 1 if ($stroffs -lt 0) { write-host -f red "`t$flag not found" return } $stroffs += $codesize if ($bytes[$stroffs] -eq 0) { write-host -f darkgreen "`tALREADY PATCHED" return }$exe = join-path (split-path $path) chrome.exe
$EA = $ErrorActionPreference $ErrorActionPreference = "silentlyContinue" while ((get-process chrome -module | ?{ $_.FileName -eq $exe })) { forEach ($timeout in 15..0) { write-host -n -b yellow -f black ` "`rChrome is running and will be terminated in $timeout sec. " write-host -n -b yellow -f darkyellow "Press ENTER to do it now. " if ([console]::KeyAvailable) { $key = $Host.UI.RawUI.ReadKey("AllowCtrlC,IncludeKeyDown,NoEcho") if ($key.virtualKeyCode -eq 13) { break } if ($key.virtualKeyCode -eq 27) { write-host; exit } } sleep 1 } write-host get-process chrome | ?{ $_.MainWindowHandle.toInt64() -and ($_ | gps -file).FileName -eq $exe } | %{ "`tTrying to exit gracefully..." if ($_.CloseMainWindow()) { sleep 1 } } $killLabelShown = 0 get-process chrome | ?{ ($_ | gps -file | select -expand FileName) -eq $exe } | %{ if (!$killLabelShown++) { "`tTerminating background chrome processes..." } stop-process $_ -force } sleep -milliseconds 200 } $ErrorActionPreference = $EA$bytes[$stroffs] = 0
"`tPATCHED $flag flag"# patch the channel restriction code for stable/beta
$code = $BC::ToString($bytes,0,$codesize) $codepattern = "83-F8-03-7D-.{1,100}" $chanpos = 0 try { if ($is64) { $pos = 0 $rx = [regex] "$codepattern-48-8D" do { $m = $rx.match($code,$pos) if (!$m.success) { break } $chanpos = $m.index/3 + 2 $pos = $m.index + $m.length + 1 $offs = $BC::ToUInt32($bytes,$pos/3+1) $diff = $pos/3+5+$offs - $stroffs } until ($diff -ge 0 -and $diff -le 4096 -and $diff % 256 -eq 0) if (!$m.success) { $rx = [regex]"84-C0.{18,48}83-F8-(03)-7D-.{30,60}84-C0" $m = $rx.matches($code) if ($m.count -ne 1) { throw } $chanpos = $m[0].groups[1].index/3 } } else { $flagOffs = [uint32]$stroffs + [uint32]$imagebase32 $flagOffsStr = $BC::ToString($BC::GetBytes($flagOffs)) $variants = "($codepattern)-68-`$1-.{6}`$2", "68-$1-.{6}$2.{300,500}E8.{12,32}(83-F8-03-7D)", "E8.{12,32}(83-F8-03-7D).{300,500}68-$1-.{6}$2" forEach ($variant in $variants) { $pattern = $flagOffsStr -replace "^(..)-.{6}(..)", $variant "`tLooking for $pattern..." $minDiff = 65536 foreach ($m in [regex]::matches($code, $pattern)) { $diff = [Math]::abs($BC::toUInt32($bytes, $m.groups[0].index/3 + 1) - $flagOffs) if ($diff % 256 -eq 0 -and $diff -lt $minDiff) { $minDiff = $diff $chanpos = $m.groups[1].index/3 + 2 } } } if (!$chanpos) { throw } } } catch { write-host -f red "`tUnable to find the channel code, try updating me" write-host -f red "`thttp://stackoverflow.com/a/30361260" return } $bytes[$chanpos] = 9 "`tPATCHED Chrome release channel restriction""`tWriting to a temporary dll..."
[IO.File]::WriteAllBytes("$dll.new",$bytes)"`tBacking up the original dll..."
move -literal $dll "$dll.bak" -force"`tRenaming the temporary dll as the original dll..."
move -literal "$dll.new" $dll -force$pathsDone[$path.toLower()] = $true
write-host -f green "`tDONE.`n" [GC]::Collect()}main
如果你不介意偶爾出現一點莫名其妙的問題的話,開發者版或金絲雀版是個不錯的選擇
推薦閱讀:
※Google有可能回到中國嗎?
※如何在谷歌上使用通配符?
※Google 32 億美元收購 Nest 為什麼是以全現金的方式支付?
※用 Google 檢索古籍資料有什麼技巧?
※Google+ 目前(2015年3月底)的生存狀態如何?
TAG:GoogleChrome | 谷歌Google | Chrome擴展程序 |