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?)的更多相关文章

  1. 【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 ...

  2. 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 ...

  3. 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/. ...

  4. 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的问 ...

  5. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

    转自:https://www.zhihu.com/question/20948649?sort=created 我最近也遇到这个问题了,用传统的快捷方式加参数并没有用,不知道是不是和chrome版本有 ...

  6. 【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 ...

  7. 如何解决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", ...

  8. 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却是正常加载的,总以为是代码写错了, 经过再三的检查以及百度查找,确认 ...

  9. <Oracle Database>数据库启动与关闭

    启动和关闭Oracle数据库 要启动和关闭数据库,必须要以具有Oracle 管理员权限的用户登陆,通常也就是以具有SYSDBA权限的用户登陆.一般我们常用INTERNAL用户来启动和关闭数据库(INT ...

随机推荐

  1. pycharm的MySQLdb模块导不进去时解决办法

    一.Windows下python2.7安装MySQLdb模块 根据Python多少位下载对应版本: 32位:https://pypi.python.org/pypi/MySQL-python/1.2. ...

  2. 携程greenlet模块使用

    import greenlet def f1(): print(11) gr2.switch() print(22) gr2.switch() def f2(): print(33) gr1.swit ...

  3. 我的Java开发学习之旅------>Java利用Comparator接口对多个排序条件进行处理

    一需求 二实现Comparator接口 三验证排序结果 验证第一条件首先按级别排序级别最高的排在前面 验证第二条如果级别相等那么按工资排序工资高的排在前面 验证第三条如果工资相当则按入职年数排序入职时 ...

  4. Django的模型层(2)- 多表操作(上)

    一.创建模型 例:我们来假定下面这些概念,字段和关系 作者模型:一个作者有姓名和年龄. 作者详细模型:把作者的详情放到详情表,包含生日,手机号,家庭住址等信息.作者详情模型和作者模型之间是一对一(on ...

  5. atitit.client连接oracle数据库的方式总结

    client连接oracle数据库的方式总结 文件夹 Java程序连接一般使用jar驱动连接.. ... 桌面GUI一般採取c语言驱动oci.dll 直接连接... 间接连接(须要配置tns及其env ...

  6. android studio本地gradle

    1.从网站上下载http://services.gradle.org/distributions/ 2.打开工程里的gradle-wrapper.properties, distributionUrl ...

  7. python中得到shell命令输出的方法

    python中得到shell命令输出的方法: 1.  import subprocess output = subprocess.Popen(['ls','-l'],stdout=subprocess ...

  8. iptables练习题(四)

    设有一台Linux服务器,利用iptables作为防火墙,要求新建一条名为MYCHAIN的新链,来实现只允许开放本机的http服务,其余协议和端口均拒绝. 脚本: [root@miyan ~]# ca ...

  9. windows如何安装mysql

    参考一下网址,已测试可用 https://www.cnblogs.com/reyinever/p/8551977.html

  10. Java泛型一:基本介绍和使用

    原文地址http://blog.csdn.net/lonelyroamer/article/details/7864531 现在开始深入学习java的泛型了,以前一直只是在集合中简单的使用泛型,根本就 ...