当前位置:网站首页>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
边栏推荐
- Where is the configuration file of tidb server?
- For the space occupation of the software, please refer to the installation directory
- Low code development platform sorting
- [difference between Oracle and MySQL]
- HCIP第五次实验
- Halo open source project learning (II): entity classes and data tables
- JS implementation private attribute
- Summary of common SQL statements
- 102. 二叉树的层序遍历
- How does matlab draw the curve of known formula and how does excel draw the function curve image?
猜你喜欢
[logical fallacy in life] Scarecrow fallacy and inability to refute are not proof
Leak detection and vacancy filling (6)
索引:手把手教你索引从零基础到精通使用
常用SQL语句总结
干货 | 快速抽取缩略图是怎么练成的?
【Appium】通过设计关键字驱动文件来编写脚本
Kubernetes service discovery monitoring endpoints
Kubernetes 服务发现 监控Endpoints
Compare the performance of query based on the number of paging data that meet the query conditions
Using quartz under. Net core - [1] quick start
随机推荐
2021长城杯WP
【Appium】通过设计关键字驱动文件来编写脚本
MySQL进阶之索引【分类,性能分析,使用,设计原则】
Solution of Navicat connecting Oracle library is not loaded
[batch change MySQL table and corresponding codes of fields in the table]
Dry goods | how to extract thumbnails quickly?
Future usage details
Seven cattle upload pictures (foreground JS + background C API get token)
2. Electron's HelloWorld
92. 反转链表 II-字节跳动高频题
练习:求偶数和、阈值分割和求差( list 对象的两个基础小题)
Qt error: /usr/bin/ld: cannot find -lGL: No such file or directory
node中,如何手动实现触发垃圾回收机制
開期貨,開戶雲安全還是相信期貨公司的軟件?
[ES6] promise related (event loop, macro / micro task, promise, await / await)
Sword finger offer 03 Duplicate number in array
Use of five routing guards
440. The k-th small number of dictionary order (difficult) - dictionary tree - number node - byte skipping high-frequency question
Abnormal resolution of Xiaomi camera
ros常用的函数——ros::ok(),ros::Rate,ros::spin()和ros::spinOnce()