当前位置:网站首页>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
边栏推荐
- C listens for WMI events
- MySQL进阶学习之SQL优化【插入,主键,排序,分组,分页,计数】
- 索引:手把手教你索引从零基础到精通使用
- 1217_使用SCons生成目标文件
- Solution of Navicat connecting Oracle library is not loaded
- PC电脑使用无线网卡连接上手机热点,为什么不能上网
- MySQL advanced index [classification, performance analysis, use, design principles]
- 198. 打家劫舍-动态规划
- 01-初识sketch-sketch优势
- 209. Minimum length subarray - sliding window
猜你喜欢
If you start from zero according to the frame
Why do some people say SCM is simple and I have to learn it so hard?
Using quartz under. Net core - [1] quick start
Webapi + form form upload file
STM32 entry development board choose wildfire or punctual atom?
MySQL进阶之索引【分类,性能分析,使用,设计原则】
Halo open source project learning (II): entity classes and data tables
[ES6] promise related (event loop, macro / micro task, promise, await / await)
440. 字典序的第K小数字(困难)-字典树-数节点-字节跳动高频题
MySQL进阶学习之SQL优化【插入,主键,排序,分组,分页,计数】
随机推荐
Self use learning notes - connectingstring configuration
Using quartz under. Net core -- a simple trigger of [7] operation and trigger
Sword finger offer 03 Duplicate number in array
MySQL advanced index [classification, performance analysis, use, design principles]
958. 二叉树的完全性检验
STM32 entry development board choose wildfire or punctual atom?
Read software engineering at Google (15)
Abnormal resolution of Xiaomi camera
Using quartz under. Net core -- general properties and priority of triggers for [5] jobs and triggers
1217_使用SCons生成目标文件
How to use the input table one-way service to send (occupy less) picture files (body transmission)? FileReader built-in object involved
239. Maximum value of sliding window (difficult) - one-way queue, large top heap - byte skipping high frequency problem
958. Complete binary tree test
Change Oracle to MySQL
440. 字典序的第K小数字(困难)-字典树-数节点-字节跳动高频题
209. 长度最小的子数组-滑动窗口
For the space occupation of the software, please refer to the installation directory
[WPF binding 3] listview basic binding and data template binding
Use of five routing guards
Learning record of uni app dark horse yougou project (Part 2)