前言

小编最近使用jsonView插件时,每次打开谷歌浏览器都会弹出下面的窗口,上网搜索,找到一个非常有效的方法。

解决方法

一、新建一个文本文档

二、复制代码

 <# :
@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.bat

四、出现问题

1.将Chrome.bat文件放到路径下:C:\Windows\System32\WindowsPowerShell\v1.0

2.双击运行即可。

【Chrome插件】去掉因使用jsonView插件的弹出窗口"请停用以开发者模式运行的扩展程序"的更多相关文章

  1. 【已解决】Chrome提示:"请停用以开发者模式运行的扩展程序"的解决办法

    chrome用户在安装了一些第三方的chrome插件后,每次打开浏览器的时候都会出现“请停用以开发者模式运行的扩展程序”的提示,只有每次点击取消之后才能正常使用扩展.如下图所示 那么有没有什么方法可以 ...

  2. 彻底禁用Chrome的“请停用以开发者模式运行的扩展程序”提示

    前言 作为一个前端程序员,难免会有一些专属自己的小扩展,没必要每一个都发到Chrome应用商店去,虽然可以勾选"开发者模式"来运行本地插件,但是每次启动都会有一个烦人的" ...

  3. 禁用Chrome的“请停用以开发者模式运行的扩展程序”提示

    1.前言 每次启动都会有一个烦人的“请停用以开发者模式运行的扩展程序”提示,这个提示有多烦人,接触过的人都知道,启动的时候它不立即提示,等过了几秒钟等你打开某个网页开始执行某些操作时它突然弹出来干扰你 ...

  4. 最新解决Chrome(版本76.0.3809.100) “请停用以开发者模式运行的扩展程序”的方法

    最新解决Chrome(版本76.0.3809.100) “请停用以开发者模式运行的扩展程序”的方法 最近在远景论坛上发现了最新的解决Chrome浏览器提示:请停用以开发者模式运行的扩展程序的问题.该方 ...

  5. Selenium启动Chrome浏览器提示“请停用以开发者模式运行的扩展程序”的解决办法

    安装了python selenium,运行下面代码: 1 from selenium import webdriver 2 3 browser = webdriver.Chrome() 4 brows ...

  6. Chrome提示:"请停用以开发者模式运行的扩展程序"的解决办法

    操作步骤 1.开始 -> 运行 -> 输入gpedit.msc -> 回车确定打开计算机本地组策略编辑器(通过Win + R快捷键可以快速打开运行),如图所示: 2.在打开的本地组策 ...

  7. [转]关闭 Chrome 浏览器的启动时提示 - 请停用以开发者模式运行的扩展程序

    最新版本 69.0.3497.92 (x64) 解决办法: https://www.cnblogs.com/liuxianan/p/disable-chrome-extension-warning.h ...

  8. 彻底禁用chrome请停用以开发者模式运行的扩展程序弹框

    首先上图 怎么解决呢? 进入安装目录-->下图目录(一串数字的目录) 2. 找到chrome.dll 3.下载patch.exe   下载网址 https://itdocs.pipipan.co ...

  9. 去除Chrome“请停用以开发者模式运行的扩展程序”提示

    将version.dll放在chrome同级目录,重启浏览器( 79.0.3945.79版本后已失效)                    

随机推荐

  1. LR测试

    LoadRunner种预测系统行性能负载测试工具通模拟千万用户实施并发负载及实性能监测式确认查找问题LoadRunner能够整企业架构进行测试通使用 LoadRunner企业能限度缩短测试间优化性能加 ...

  2. SSM-Spring-09:Spring中jdk动态代理

    ------------吾亦无他,唯手熟尔,谦卑若愚,好学若饥------------- JDK动态代理: 为何叫JDK动态代理呢? 所谓JDK,jdk是java开发工具包,它里面包含了一个动态代理的 ...

  3. PuTTY/终端使用复制、粘贴

    Putty鼠标按钮选项 通过鼠标按钮选项可以控制鼠标来进行复制.粘贴操作,选项包括: 1.Windows选项: 2.混合模式(系统默认选项): 3.Xterm模式. 以上是三种模式选项的简单介绍,下面 ...

  4. ajax跨域问题(php)

    ajax出现请求跨域错误问题,主要原因就是因为浏览器的"同源策略". 解决方法(我只用过下面这3种): 1. 架设服务器代理:即浏览器请求同源服务器,再由后者请求外部服务(之前博主 ...

  5. 33.APP后端处理视频的方案

    在当前的app应用中,到处都能看到视频的身影,例如,在社交类的app上,用户可以拍摄属于自己的小视频,并发布到相应得栏目,增加和好友们互动的机会. 后台常见的视频处理有以下几种: ·          ...

  6. Maven常识

    maven下面通常有四个文件夹: src/main/java -- 用来存放业务代码 src/test/java -- 用来存放测试代码 另有两个名为resource的文件夹,通常用来放置前两个文件夹 ...

  7. testng生成自定义html报告

    转自:https://blog.csdn.net/kdslkd/article/details/51198433 testng原生的或reportng的报告总有些不符合需要,尝试生成自定义测试报告,用 ...

  8. 转载:selenium webdriver定位不到元素的五种原因及解决办法

    1.动态id定位不到元素for example:        //WebElement xiexin_element = driver.findElement(By.id("_mail_c ...

  9. go语言nsq源码解读一-基本介绍

    简单介绍一下nsq. 参考 http://feilong.me/2013/05/nsq-realtime-message-processing-system 的介绍:NSQ是由知名短链接服务商bitl ...

  10. BZOJ_3143_[Hnoi2013]游走_期望DP+高斯消元

    BZOJ_3143_[Hnoi2013]游走_期望DP+高斯消元 题意: 一个无向连通图,顶点从1编号到N,边从1编号到M. 小Z在该图上进行随机游走,初始时小Z在1号顶点,每一步小Z以相等的概率随机 ...