当前位置:网站首页>Chrome浏览器的跨域设置----包含新老版本两种设置
Chrome浏览器的跨域设置----包含新老版本两种设置
2022-04-23 17:41:00 【前端菜菜DayDayUp】
这是一篇姗姗来迟的文章,一直在使用,但是一直没时间做一下总结,今天抽空就分享给大家,操作很简单,耐心跟着操作一下。
做前后端分离的开发的时候,出于一些原因往往需要将浏览器设置成支持跨域的模式,而且chrome浏览器支持可跨域的设置,但是新版本的chrome浏览器提高了跨域设置的门槛,原来的方法不再适用了。其实网上也有很多大神总结的chrome跨域设置教程,都是差不多。
个人开发中的使用习惯
下载好谷歌浏览器以后,快捷方式我会复制两份放在桌面上,这时候两个是一模一样的,我会将其中一个重命名(我是跨域的命名为 dev),另外一个正常命名,然后在对命名为“dev”的浏览器打开方式进行寡跨域设置,这样我们就会拥有一个正常的浏览器,一个跨域的浏览器啦~
老版本Chrome浏览器(版本号49之前的跨域设置)
1、右键点击谷歌浏览器,选择属性
2、 在目标输入框尾部加上 --disable-web-security
注意:这里 --disable-web-security 前面有一个空格
3.点击应用和确定后关闭属性页面,并打开chrome浏览器。如果浏览器出现提示“你使用的是不受支持的命令标记 --disable-web-security”,那么说明配置成功。
新版浏览器跨域设置(版本号49之后的跨域设置)
1、在电脑上新建一个目录(任意位置) 例如 C:\MyChromeDevUserData
2、右键点击谷歌浏览器,选择属性;
3、在目标输入框尾部加上 --disable-web-security --user-data-dir=C:\MyChromeDevUserData
注意:两个 -- 前面都是有空格的哦~
4、点击应用和确定后关闭属性页面,并打开chrome浏览器。
再次打开chrome,发现有“--disable-web-security”相关的提示,说明chrome就能正常跨域工作了。
版权声明
本文为[前端菜菜DayDayUp]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_48594833/article/details/124345191
边栏推荐
- RPC核心概念理解
- JS implementation private attribute
- 394. 字符串解码-辅助栈
- Using quartz under. Net core -- operation transfer parameters of [3] operation and trigger
- 239. 滑动窗口最大值(困难)-单向队列、大顶堆-字节跳动高频题
- Kubernetes service discovery monitoring endpoints
- 练习:求偶数和、阈值分割和求差( list 对象的两个基础小题)
- stm32入门开发板选野火还是正点原子呢?
- How to sort the numbers with text in Excel from small to large instead of the first number
- Read software engineering at Google (15)
猜你喜欢
[ES6] promise related (event loop, macro / micro task, promise, await / await)
Kubernetes 服务发现 监控Endpoints
Compare the performance of query based on the number of paging data that meet the query conditions
470. 用 Rand7() 实现 Rand10()
[difference between Oracle and MySQL]
1217_ Generating target files using scons
2021长城杯WP
Using quartz under. Net core - [1] quick start
Index: teach you index from zero basis to proficient use
Comparison between xtask and kotlin coroutine
随机推荐
JS implementation private attribute
Seven cattle upload pictures (foreground JS + background C API get token)
Where is the configuration file of tidb server?
[二叉数] 二叉树的最大深度+N叉树的最大深度
Webapi + form form upload file
440. The k-th small number of dictionary order (difficult) - dictionary tree - number node - byte skipping high-frequency question
How does matlab draw the curve of known formula and how does excel draw the function curve image?
matlab如何绘制已知公式的曲线图,Excel怎么绘制函数曲线图像?
01-初识sketch-sketch优势
2021 Great Wall Cup WP
Using quartz under. Net core -- a simple trigger of [7] operation and trigger
Solution of Navicat connecting Oracle library is not loaded
开期货,开户云安全还是相信期货公司的软件?
209. 长度最小的子数组-滑动窗口
JS interview question: FN call. call. call. Call (FN2) parsing
stm32入门开发板选野火还是正点原子呢?
QT modification UI does not take effect
Commonly used functions -- spineros:: and spineros::)
470. Rand10() is implemented with rand7()
JVM class loading mechanism