用临时用户数据目录启动Chrome,关闭安全检查等(解决Cross origin requests are only supported for HTTP?)
Cross origin requests are only supported for HTTP?
参考:https://www.zhihu.com/question/20948649
批处理:
start_chrome_with_tmp_userdata.bat
@echo off
pushd %~dp0
set TMP_USERDATA="%CD%/tmp_userdata"
set TMP_URL="%~1"
if %TMP_URL%=="" goto :help
echo Starting chrome...
"%appdata%\..\Local\Google\Chrome\Application\chrome.exe" --allow-file-access-from-files --disable-web-security --user-data-dir=%TMP_USERDATA% %TMP_URL%
echo Cleannig tmp dir...
ping 127.1 -n 1 >nul
rd /s /q %TMP_USERDATA% >nul
goto :end
:help
set TMP_CMD=%~n0%~x0
echo Usage:
echo [1] %TMP_CMD% http://www.baidu.com
echo [2] call %TMP_CMD% http://www.baidu.com
echo.
echo Press any key to exit...
pause>nul
:end
popd
调用例子1:
@echo off
call start_chrome_with_tmp_userdata.bat "%CD%\video-js-6.6.2/examples/index.html"
调用例子2:
C:\> start_chrome_with_tmp_userdata.bat http://www.baidu.com
Python3 启动http
start_python_web.bat
@echo off
pushd %~dp0
set port=%~1
if "%port%"=="" goto :help
set process_title=%~n0,%port%
echo Kill last process...
taskkill /f /fi "WINDOWTITLE eq %process_title%" > nul
echo Starting python http.server %port%...
start "%process_title%" python -m http.server %port%
goto :end
:help
set TMP_CMD=%~n0%~x0
echo Usage:
echo set port=8081
echo call %TMP_CMD% %%port%%
echo start "" http://localhost:%%port%%
echo.
echo Press any key to exit...
pause>nul
:end
popd
例子:
@echo off
set port=8081
call start_python_web.bat %port%
ping 127.1 -n 1 >nul
echo Starting demo...
start "" http://localhost:%port%/video-js-6.6.2/examples/simple-embed/h265.html
start "" http://localhost:%port%/libde265.js/demo/libde265_DEMO.html
用临时用户数据目录启动Chrome,关闭安全检查等(解决Cross origin requests are only supported for HTTP?)的更多相关文章
- 【chrome错误】Cross origin requests are only supported for protocol schemes: http, data,chrome-extension, https, chrome-extension-reso
使用ajax请求本地文件,chrome会报跨域错误. XMLHttpRequest cannot loadfile:///C:/Users/Li/Desktop/images/alist.json.C ...
- jquery读取本地文件,Windows上报错。XMLHttpRequest cannot load xxx. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.k.cors.a.c
问题: 测试报告,使用本地的json.txt文件,结果文件读取失败,报错如下: XMLHttpRequest cannot load xxx. Cross origin requests are on ...
- nodejs报错 XMLHttpRequest cannot load localhost:3000/test_date/. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
z在请求本地的时候 如果ajax的URL 前面没有http的话 就会报错 jq.js:2 XMLHttpRequest cannot load localhost:3000/test_date/. ...
- Cross origin requests are only supported for protocol schemes: http, data, chrome,chrome-extension的问题
Cross origin requests are only supported for protocol schemes: http, data, chrome,chrome-extension的问 ...
- Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
转自:https://www.zhihu.com/question/20948649?sort=created 我最近也遇到这个问题了,用传统的快捷方式加参数并没有用,不知道是不是和chrome版本有 ...
- 【Google Chrome】 Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource问题解决
问题??打开Google Chrome浏览器报错如下: 结论 浏览器出于安全性考虑,默认对跨域访问禁止 解决方法 给浏览器添加启动参数 --allow-file-access-from-files ...
- 如何解决XMLHttpRequest cannot load file:~~~~~~~~~~~. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-res
原因:Chrome不支持本地Ajax请求. 解决: 右击Chrome浏览器快捷方式,选择“属性”,在“目标”中加上"--allow-file-access-from-files", ...
- XMLHttpRequest cannot load file:///E:/userdialog.html?_=1465888805734. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-reso
做前端写静态页面时,采用的是jq easyui框架 在ie与webkit总是加载的时候总是在loading... 而firefox却是正常加载的,总以为是代码写错了, 经过再三的检查以及百度查找,确认 ...
- <Oracle Database>数据库启动与关闭
启动和关闭Oracle数据库 要启动和关闭数据库,必须要以具有Oracle 管理员权限的用户登陆,通常也就是以具有SYSDBA权限的用户登陆.一般我们常用INTERNAL用户来启动和关闭数据库(INT ...
随机推荐
- 每隔10秒钟打印一个“Helloworld”
/** * 每隔10秒钟打印一个“Helloworld” */ public class Test03 { public static void main(String[] args) throws ...
- java 集合类复习(未完结)
JAVA常用数据结构及原理分析(面试总结) https://blog.csdn.net/qq_29631809/article/details/72599708 java 中几种常用数据结构 ht ...
- netstat命令——网络,进程,内存
netstat网络.进程.内存 转自:https://www.cnblogs.com/xieshengsen/p/6618993.html https://zhidao.baidu.com/quest ...
- python线程间数据共享(示例演示)
``` import threading data_list = [] def task(arg): data_list.append(arg) print(data_list) def run(): ...
- Andrew Ng机器学习编程作业:Neural Network Learning
作业文件: machine-learning-ex4 1. 神经网络 在之前的练习中,我们已经实现了神经网络的前反馈传播算法,并且使用这个算法通过作业给的参数值预测了手写体数字.这个练习中,我们将实现 ...
- Python:笔记(5)——错误、调试和测试
Python:笔记(5)——错误.调试和测试 错误处理 1.TRY语句 这个和Java中的语法是及其相似的,catach换成except. 说明:同样,不管有没有错误,fianlly都会执行的! 补充 ...
- php debug函数
$debug=$_GET['debug'];//是说获取url中debug变量$debug=empty($debug)?'':$debug;//如果变量不为空,赋值为$debug,为空的话赋值 ''$ ...
- URAL 2078 Bowling game
题目: Bowling game In all asocial teams members ignore each other uniformly, each tight-knit team buil ...
- UVALive 6906 A - Cluster Analysis
思路:排个序,依次选就好了. #include <bits/stdc++.h> #define PB push_back #define MP make_pair using namesp ...
- Libev和LibEvent
libev和libevent功能基本相同,名称相近,到底该用哪一个呢?zhouhh@zhh64:~$ sudo apt-cache search libeventlibevent-dev – Deve ...