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. CentOS7保留默认Python版本并安装更新Python2和Python3共存

    CentOS 7 默认的python版本是python2.7.5.因为yum依赖于默认的python版本的缘由,所以要先保留默认版本,并修改yum文件头部后,才能开始安装更新python2和pytho ...

  2. Pandas 删除指定列中为NaN的行

    定位要删除的行 需求:删除指定列中NaN所在行. 如下图,’open‘ 列中有一行为NaN,定位到它,然后删除. 定位: df[np.isnan(df['open'])].index # 这样即可定位 ...

  3. 【我的Android进阶之旅】解决Android Studio启动时报错:Java 1.8 or later is required.

    错误描述 在公司电脑上运行Android Studio 2.2已经有一段时间了,但是自己的笔记本上还是用的Android Studio 1.5,今天晚上下了一个Android Studio 2.2压缩 ...

  4. Android 屏幕切换动画

    public void overridePendingTransition (int enterAnim, int exitAnim) Call immediately after one of th ...

  5. 查看Oracle的表中有哪些索引

    用user_indexes和user_ind_columns系统表查看已经存在的索引 对于系统中已经存在的索引我们可以通过以下的两个系统视图(user_indexes和user_ind_columns ...

  6. Java排序算法总结(转载)

    排序算法 平均时间复杂度 冒泡排序 O(n2) 选择排序 O(n2) 插入排序 O(n2) 希尔排序 O(n1.5) 快速排序 O(N*logN) 归并排序 O(N*logN) 堆排序 O(N*log ...

  7. Spark学习笔记--安装SCALA和IDEA开发环境

    一:安装Scala

  8. python中的pass语句是什么

    当用python写代码时,有时可能还没想好函数怎么写,只写了函数声明,但为了保证语法正确,必须输入一些东西,这种情况下,我们会使用pass语句 def func(*args): pass break语 ...

  9. 名称空间(Namespaces)(转)

    大致来说,命名空间只是将名称映射到对象的容器.正如你可能已经听到的,Python中的所有内容 - 字符串,列表,词典,函数,类等都是一个对象.这样的“名称与对象”的映射使我们能够通过分配给它的名称访问 ...

  10. 第六课 GDB调试 (上)

    1序言: 1.初学者经过学习前面的Makefile知识,信心满满,内心觉得应该要好好学习不单掌握语言的编写,也要学会相对应的工具调高开发效率.有时我们写出来的代码经过执行结果却跟我们预期不一样那怎么办 ...