【测试】谷歌浏览器跨域设置

谷歌新版本跨域错误深度剖析与解决:request client is not a secure context and the resource is in more-private address request client is not a secure context and the resource is in more-private address解决方案 preflight预检请求options请求解决方案 详细分析谷歌专用网络错误导致的跨域问题的原因以及给出相关解决方案 阅读详情

前言


浏览器跨域设置通常不建议直接操作,因为同源策略是重要的安全机制。但在开发环境中,如果需要测试跨域请求,可以临时禁用这一策略。

重要提示: 下列方法仅适用于开发环境,严禁在生产环境中禁用同源策略!


本文以谷歌浏览器为例:

设置方法

  1. 关闭所有的 Chrome 进程
    确保浏览器完全退出(从任务管理器检查)
  2. 创建空目录
    自定义创建临时用户目录,避免污染默认配置
  3. 根据系统执行命令

✅ Windows

chrome.exe --disable-web-security --user-data-dir="你自定义创建的目录"

参数说明:

  • --disable-web-security:禁用同源策略。

  • --user-data-dir:指定临时用户目录(避免污染默认配置)。

✅ macOS/Linux

open -n -a "Google Chrome" --args --disable-web-security --user-data-dir=/tmp/chrome-dev
  1. 启动效果
    浏览器会显示 “您使用的是不受支持的命令行标记” 的警告,表示跨域限制已解除。

正常工作流程为(通过命令行启动):

在这里插入图片描述

如何正确关闭跨域浏览器

在这里插入图片描述

WebDriver利用user-data-dir参数实现cookie保留 一次临时需求,需要收集一批fb用户的fb_id,但是需要登录才能采集到信息,但是又不想重复登录,一是容易封号,二是降低效率。但是这种用法需要确保操作环境只有webdriver操作的chrome进程存在。操作步骤如下。 1.首先自定义user-data-dir初始化webDriver //设置启动chrome为默认用户的配置信息(包括书签、扩展程序、代理设置等), 运行程序前需关闭win7系统中采用默认配置打开的浏览器chrome options.addArguments("user-data- 阅读详情

相关推荐

谷歌浏览器跨域代理的多种方法

谷歌浏览器跨域代理的多种方法。

Guoye的专栏 2001

谷歌浏览器跨域最全解决方案

之前,我写过一篇文章《前后端分离开发跨域问题总结》主要是通过修改前后端代码(写一些跨域配置)去解决跨域问题,本篇介绍另外一种方式,无需修改代码,也可以在开发中的进行前后端调试。

请你喝杯Java 2万+

【IIC通信】Chap.1(I2C)IIC通信原理、IIC读写时序详解

IIC通信以两根连线SDA、SCL实现了完善的全双工同步数据传送, 可以方便地构成多机系统和外围器件扩展系统。

Jie_MSD的博客 2万+

Chrome浏览器的跨域设置

Chrome浏览器的跨域设置

weixin_53841730的博客 4万+

【React Native】源码分析之Native UI的封装和管理

转载请注明出处:http://blog.youkuaiyun.com/u013531824/article/details/54020287,谢谢。  ReactNative作为使用React开发Native应用的新框架,随着时间的增加,无论是社区还是个人对她的兴趣与日递增。此文目的是希望和大家一起欣赏一下ReactNative的部分源码。阅读源码好处多多,让攻城狮更溜的开发ReactNative应用的同时,也

Tiny的专栏 9779

IGBT基础知识

IGBT

u010783226的专栏 1万+

浏览器报“已拦截跨源请求:同源策略禁止读取位于XXX的远程资源(CORS 请求不是 http)”

起因是pytest+allure谷歌浏览器打开测试报告后显示404 查看console可看到是因为跨域问题 –解决办法: 火狐浏览器设置步骤: 1.进入火狐配置页进行设置 ,地址栏输入"about:config" 2.点击”我了解此风险”后进入页面 3.搜索”security.fileuri.strict_origin_policy”,并设置该项为false 4.重启浏览器,可以跨域访问 谷歌浏览器: 不支持,别浪费力气了 ———————————————— 版权声明:解决办法为优快云博主「老裆益壮☭」

sfan0919的博客 8840

电源管理芯片PMIC

(Power Management Integrated Circuits,简称:将电源电压转换为电子设备各部分所需的适当电压水平,包括升压(Boost)、降压(Buck)和升降压(Buck-Boost)转换。:控制和限制流向电子设备各部分的电流,以保护组件免受过电流损害。:管理多个电源轨,为不同的部分提供稳定的电能控制。电源轨指电路板上传输电力的线路。电源监控:提供过电压、欠电压、过电流、过热和短路保护,以防止电子设备损坏。:通过高效的电源转换技术,减少能量损耗,提高能源利用效率。

qq_42786033的博客 1万+

芯片入门第一课怎么选?从数字逻辑、器件物理到系统架构的路线之争

芯片设计是一个涉及功能、物理与系统三层认知的复杂工程领域。初学者在入门时,往往面临从数字逻辑、Verilog、半导体器件物理还是计算机体系结构起步的抉择。理解芯片的完整链条——从底层晶体管行为到顶层系统架构——是建立知识框架的关键。不同职业方向(如数字前端、后端物理、模拟定制、制造工艺)对基础知识的需求优先级各不相同,但核心原则是先搭建“功能-物理-系统”三层认知模型。本文梳理了主流入门路线的优劣与适用场景,并给出一个兼顾深度与广度的混合学习路径,帮助你在有限时间内做出更合适的起步选择。

weixin_34080571的博客 299

在WinXP操作系统上安装Tornado2.2详细教程

使用VxWorks的人都想在自己的电脑中装VxWorks的编译器Tornado,然而Win10操作系统对于Tornado并不友好,根本装不成功。而对于Win7操作系统,之前在实验室一台Win7上装Tornado成功过,并且一直在上面进行vx开发,但是过一段时间在其他Win7上装Tornado时又不能成功,由此说明Tornado对于Win7操作系统对Tornado的兼容也不是很好,所以想要长久使用T...

weixin_43822311的博客 4481

智能气象站:ESP32驱动的心知天气数据可视化实践

本文详细介绍了基于ESP32微控制器和心知天气API构建智能气象站的完整实践。通过Arduino开发环境,实现天气数据的获取、JSON解析与OLED屏可视化展示,涵盖硬件连接、API配置、低功耗优化及部署问题排查,为物联网开发者提供实用指南。

jump7的博客 210

谷歌浏览器关闭跨域限制,允许跨域请求,设置允许访问本地文件

谷歌浏览器关闭跨域限制,允许跨域请求,设置允许访问本地文件

qq_41777791的博客 1万+

第14.11章 高翔博士最新开源框架Lightning-LM源码解读(十一):离线定位模块全解析,从激光匹配到位姿图优化的极致优化

本文介绍了Lightning-LM离线定位模块的技术架构与实现细节。该模块基于3D激光雷达与IMU融合,采用改进版NDT匹配算法实现高精度定位,具备动态图层更新、多源信息融合等特性。核心流程包括数据预处理、激光里程计处理、IMU预测与点云去畸变、位姿图优化等环节,通过轻量级miao库实现高效增量优化。文章详细解析了模块的代码结构、关键函数功能及数据流,为SLAM系统的开发与优化提供了实践参考。

行知SLAM 375

跨域问题

跨域的严格一点的定义是:只要 协议,域名,端口有任何一个的不同,就被当作是跨域。

前端 399

基于STM32设计的遥控灭火消防小车_296

随着城市化进程的加速和火灾发生频率的增加,传统的消防方式在应对初期火灾时存在反应慢、效率低等问题。为了提高火灾响应速度和灭火效率,本设计开发了一款基于STM32单片机的遥控灭火消防小车。该小车配备了烟雾检测、温湿度监测、火源定位、灭火操作等功能,能够通过蓝牙和WIFI实现远程控制与实时视频传输。设计采用了MQ2烟雾传感器、SHT30温湿度传感器、火光传感器和ESP32摄像头模块等硬件设备。系统不仅能够自动检测和定位火源,还可以手动调整灭火器对准位置,进行干粉灭火。此外,蜂鸣器用于火源报警,确保操作人员及时得

723

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

springboot完美解决跨域

被跨域折磨了两天,可算是整明白了,记录一下各种配置。 1.corsFilter 网上各种方法都不好使,只有这么一种可以,可能是哪里的配置问题。 @Configuration public class CorsConfig { @Bean public CorsFilter corsFilter2() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();

peony的博客 501

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

请问有谁知道怎么解决浏览器跨域问题,谷歌插件里的

请问有谁知道怎么解决浏览器跨域问题,谷歌插件里的 正常网页测试能过,但是谷歌浏览器插件里不能过

gfhj778的博客 149

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

前端设置浏览器跨域接口请求

前端设置浏览器解决跨域请求

weixin_56475385的博客 396

前端永久性解决跨域问题

前端永久性解决跨域问题

danny342354的博客 277

谷歌浏览器解决临时跨域问题

解决临时跨域问题

weixin_42371812的博客 747

浏览器跨域的方法

1.新建谷歌浏览器之后创建两个快捷方式; 2.选择一个快捷图标右击==》属性,在快捷方式==》目标这一栏,在最后追加 --disable-web-security --user–data-dir=你的新建文件夹,这里我的写法是:?–disable-web-security --user–data-dir=D:\ChromeTest; 3.点击确定,重新打开浏览器 4.在D盘新建文件夹ChromeTest。(这个文件夹就是空的) ...

LILEILEILOVE的博客 713

Failed to load file:///F:/demo01/styles.less: Cross origin requests are only supported for protocol

由于同源策略,访问不同源的资源,就会产生权限 ,比如我想引用less目录下的 less.js文件,谷歌浏览器出现了这样的错误: 这是产生了跨域,谷歌浏览器会出于安全考虑而阻止这种行为. 解决方法: 进入谷歌的安装目录,可以通过查看浏览器快捷键属性的方式看到安装目录,我的在c盘下 然后 进入到目录下: 执行命令: start chrome.exe --disable-...

LPLIFE的博客 4175

关于Jquery ajax发送请求,后端拿不到session

在ajax中添加 xhrFields:{ withCredentials:true }, 因为跨域请求默认不会携带cookie,后端存储不了数据到session,所以每次请求后端都拿不到session中的数据。(并且请使用除谷歌外浏览器测试发送请求,看后端是否能拿到session。谷歌浏览器可能会存在每次请求sessionid不同的情况,详细请自行百度) ...

Wiken4的博客 1194

谷歌浏览器报错:跨域问题处理( Access-Control-Allow-Origin)_ 用于本地测试的快捷解决方法

谷歌浏览器报错:跨域问题处理( Access-Control-Allow-Origin)_ 用于本地测试的快捷解决方法  有一个便捷的处理方式可以在谷歌中实现数据跨域,只需要 简单 为浏览器键入一个值   --disable-web-security  (这个值前有空格哦O(∩_∩)O~) 后点击确定。 首先重启浏览器,再打开需要测试的文档即可。 原文链接:http:

程序员陆通 6971

谷歌浏览器 不检测跨域

--disable-web-security 谷歌浏览器 不检测跨域 转载于:https://www.cnblogs.com/yiyi17/p/8780678.html

weixin_30488085的博客 299

React跨域

方案一: package.json配置: "proxy": "http://www.zhangxuwei.top/" // 注意,目前最新版本不支持对象 方案二: 使用中间件 http-proxy-middleware 安装: npm install http-proxy-middleware -d 新建 src/setupProxy.js const proxys = require('http-proxy-middleware') const proxy = pro.

小书包大梦想的博客 483
上一篇: 【软件评测师】下午题总结
下一篇: 【python+tkinter】图形界面简易计算器的实现
Lucifer__hell
博客等级 码龄8年 53粉丝 54原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值