Chrome提示:"請停用以開發者模式運行的擴展程序"的解決辦法
阿新 • • 發佈:2017-08-16
arp ups 系統 添加擴展 nop itl drag 復制 director
3.然後打開“本地組策略編輯器”,在左側的樹形菜單中,依次展開:計算機配置->管理模版,在“計算機配置”-“管理模板”中右鍵選擇“添加/刪除模板”安裝剛才的那個chrome.adm文件,安裝成功之後就可以在“管理模板”-“經典管理模板(ADM)”-“Google”下面看到“Google Chrome”了。這裏需要說明兩點,一是這個下面可能會有兩個Google Chrome,一個有推薦字樣,看看哪個下面有“擴展程序”,通常是不帶推薦的那個;另外一點是按照chrome.adm的過程中如果策略編輯器長時間停止響應的話可以強制將其關閉之後在打開就可以了,不影響後面的操作。 3. 接下來選擇“擴展程序”,然後雙擊右側的“配置擴展程序安裝白名單”,如下圖:
4. 打開之後首先選擇左邊的”已啟用“,然後選擇下面的 顯示 按鈕,將安裝之後的第三方插件的ID(打開Google Chrome的開發者模式之後會顯示)輸入到剛才的白名單對話框中確定保存即可。 5.關於chrome插件ID的獲取方法,可以在chrome地址欄中輸入:chrome://extensions/ 打開擴展程序的管理界面,點擊開發者模式,即可看到已經安裝的chrome插件的ID。
6.輸入完成後點擊確定保存,並關閉本地組策略編輯器,並在Chrome擴展管理界面關閉開發者模式,就可以正常地使用Chrome插件,並解決谷歌的停用開發者模式的警告了。 另外需要說明的是,這種情況下需要一直打開”開發者模式“,另外如果直接在開發者模式下通過加載插件開發目錄形式加載插件也無效的話可以將其打包之後再安裝就可以了,不過打包再安裝之後其ID會發生變化。
最近不知道安裝了什麽插件導致沒有chrome瀏覽器打開時都會提示“請停用以開發者模式運行的擴展程序”的提示,只有每次點擊取消之後才能正常使用擴展。如下圖所示
每次都要去手動把這個關掉,我都快要吐了。。。在http://www.cnplugins.com/tool/stop-developer-mode.html 找到了方法。我用的是第2中方法,留著萬一以後還要用呢。
一、通過組策略添加擴展程序白名單的方式屏蔽了這種提示。(註意:此方法僅適用windows系統)
1. 首先下載Chrome組策略管理模板 :下載地址:http://chromecj.com/utilities/2015-04/423/download.html 2. 開始 -> 運行 -> 輸入gpedit.msc -> 回車確定打開計算機本地組策略編輯器(通過Win + R快捷鍵可以快速打開運行),如圖所示:3.然後打開“本地組策略編輯器”,在左側的樹形菜單中,依次展開:計算機配置->管理模版,在“計算機配置”-“管理模板”中右鍵選擇“添加/刪除模板”安裝剛才的那個chrome.adm文件,安裝成功之後就可以在“管理模板”-“經典管理模板(ADM)”-“Google”下面看到“Google Chrome”了。這裏需要說明兩點,一是這個下面可能會有兩個Google Chrome,一個有推薦字樣,看看哪個下面有“擴展程序”,通常是不帶推薦的那個;另外一點是按照chrome.adm的過程中如果策略編輯器長時間停止響應的話可以強制將其關閉之後在打開就可以了,不影響後面的操作。 3. 接下來選擇“擴展程序”,然後雙擊右側的“配置擴展程序安裝白名單”,如下圖:
4. 打開之後首先選擇左邊的”已啟用“,然後選擇下面的 顯示 按鈕,將安裝之後的第三方插件的ID(打開Google Chrome的開發者模式之後會顯示)輸入到剛才的白名單對話框中確定保存即可。 5.關於chrome插件ID的獲取方法,可以在chrome地址欄中輸入:chrome://extensions/ 打開擴展程序的管理界面,點擊開發者模式,即可看到已經安裝的chrome插件的ID。
6.輸入完成後點擊確定保存,並關閉本地組策略編輯器,並在Chrome擴展管理界面關閉開發者模式,就可以正常地使用Chrome插件,並解決谷歌的停用開發者模式的警告了。 另外需要說明的是,這種情況下需要一直打開”開發者模式“,另外如果直接在開發者模式下通過加載插件開發目錄形式加載插件也無效的話可以將其打包之後再安裝就可以了,不過打包再安裝之後其ID會發生變化。
二、打包導出報警提示的chrome插件重新安裝
如果以上的方法還不行的話,那麽就嘗試找出是哪個插件導致提示“請停用以開發者模式運行的擴展程序”,然後將其打包導出擴展程序,方法參照:怎麽從Chrome瀏覽器中導出擴展程序為crx文件?“打包擴展程序”這樣在相應目錄生成了 .crx 文件,然後直接拖到 chrome://extensions/ chrome擴展程序頁面進行安裝就行!如果不知道怎麽安裝CRX文件,請參照:怎麽在谷歌瀏覽器中安裝.crx擴展名的離線chrome插件
三、高手程序代碼實現(說實話小編不懂,但是網友說給力)
復制以下代碼並且另存為DevWarningPatch.bat 到任意位置,退出chrome,右鍵管理員運行即可。
<# : @echo off copy/b "%~f0" "%temp%\%~n0.ps1" >nul powershell -Version 2 -ExecutionPolicy bypass -noprofile "%temp%\%~n0.ps1" "%cd% " "%~1" del "%temp%\%~n0.ps1" pause exit /b #> param([string]$cwd=‘.‘, [string]$dll) function main { "Chrome ‘developer mode extensions‘ warning disabler v1.0.10.20170114`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$_\Google\Update\Clients" 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) $rxChannel = ‘83-F8-(?:03-7D|02-7F)‘ # old code: cmp eax,3; jge ... # new code: cmp eax,2; jg ... $chanpos = 0 try { if ($is64) { $pos = 0 $rx = [regex]"$rxChannel-.{1,100}-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}($rxChannel)-.{30,60}84-C0" $m = $rx.matches($code) if ($m.count -ne 1) { throw } $chanpos = $m[0].groups[1].index/3 + 2 } } else { $flagOffs = [uint32]$stroffs + [uint32]$imagebase32 $flagOffsStr = $BC::ToString($BC::GetBytes($flagOffs)) $variants = "(?<channel>$rxChannel-.{1,100})-68-(?<flag>`$1-.{6}`$2)", "68-(?<flag>`$1-.{6}`$2).{300,500}E8.{12,32}(?<channel>$rxChannel)", "E8.{12,32}(?<channel>$rxChannel).{300,500}68-(?<flag>`$1-.{6}`$2)" forEach ($variant in $variants) { $pattern = $flagOffsStr -replace ‘^(..)-.{6}(..)‘, $variant "`tLooking for $($pattern -replace ‘\?<.+?>‘, ‘‘)..." $minDiff = 65536 foreach ($m in [regex]::matches($code, $pattern)) { $maybeFlagOffs = $BC::toUInt32($bytes, $m.groups[‘flag‘].index/3) $diff = [Math]::abs($maybeFlagOffs - $flagOffs) if ($diff % 256 -eq 0 -and $diff -lt $minDiff) { $minDiff = $diff $chanpos = $m.groups[‘channel‘].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
Chrome提示:"請停用以開發者模式運行的擴展程序"的解決辦法