内容安全政策cordova问题(Content Security Policy cordova problems)
我在我的Windows PC上使用ionic创建了一个应用程序,现在当切换到mac时,我从控制台收到此错误
“拒绝加载https://lorem.firebaseio.com/.lp?start=t&ser=59502592&cb=11&v=5,因为它没有出现在Content Security的script-src指令中”。
我已经尝试在我的标题中修改我的CSP标签,我似乎无法让它工作。 此外,我尝试重新添加所有插件/平台/资源。
我现在使用的标签是
<meta http-equiv="Content-Security-Policy" content="default-src * data: cdvfile: gap:; style-src 'self' https://cdn.firebase.com https://*.firebaseio.com https://lorem.firebaseio.com/*; script-src 'self' 'unsafe-eval'">
我也想知道为什么我不能像过去那样将它添加到我的白名单插件中
<allow-navigation href="*"/> <allow-navigation href="http://192.168.178.13:8100"/> <allow-intent href="*.firebaseio.com"/> <allow-intent href="auth.firebase.com"/>
----------------------------- edit -------------------- ---------
为了解决我的所有问题,我使用了这3个标签
content="default-src * data: cdvfile: gap:; style-src 'self' 'unsafe-inline'; img-src 'self' 'unsafe-inline'; script-src 'self' https://lorem.firebaseio.com/* https://cdn.firebase.com https://*.firebaseio.com 'unsafe-eval'">
I made an app using ionic on my windows pc, now when switching to a mac i get this error from the console
"Refused to load https://lorem.firebaseio.com/.lp?start=t&ser=59502592&cb=11&v=5 because it does not appear in the script-src directive of the Content Security ".
Already i tried modifying my CSP tag in my header, i cant seem to get it to work tho. Also i tried re-adding all plugins/platforms/resouce.
The tag im using right now is
<meta http-equiv="Content-Security-Policy" content="default-src * data: cdvfile: gap:; style-src 'self' https://cdn.firebase.com https://*.firebaseio.com https://lorem.firebaseio.com/*; script-src 'self' 'unsafe-eval'">
Also im wondering why i cant add this to my whitelist plugin like i did in the past
<allow-navigation href="*"/> <allow-navigation href="http://192.168.178.13:8100"/> <allow-intent href="*.firebaseio.com"/> <allow-intent href="auth.firebase.com"/>
----------------------------- edit -----------------------------
To fix all of my issues i used this 3 tags
content="default-src * data: cdvfile: gap:; style-src 'self' 'unsafe-inline'; img-src 'self' 'unsafe-inline'; script-src 'self' https://lorem.firebaseio.com/* https://cdn.firebase.com https://*.firebaseio.com 'unsafe-eval'">
原文:https://stackoverflow.com/questions/40679720
最满意答案
What you are referring to are the "common dialogs", and you can get a file open dialog with GetOpenFileName
BOOL GetOpenFileName( LPOPENFILENAME lpofn );
相关问答
更多-
如果你真的想学习底层API,那么你应该从没有一个框架开始。 按照我们在Charles Petzold的“编程Windows”一书中几年前所做的那样学习它。 关于窗口和消息如何工作的知识基础非常好,可以很好地为您服务。 从长远来看,一个好的框架,例如WinForms,Qt,VCL等将会提高生产力。 但是如果你从其中一个开始,那么你就有可能不知道发送和排队消息之间的区别,不知道HWND , HDC和HANDLE之间的区别等等。 一个好的框架非常棒,但如果你了解它下面的内容,你就会从中获得更多。 If you a ...
-
在Windows 8中的文件IO(File IO in Windows 8)[2023-07-19]
WinRT或Windows运行时不应与.NET混淆,因为它不是.NET。 WinRT只能访问Win32 API的一个子集,但不能访问.NET等所有内容。 这里有一篇很好的文章,介绍WinRT中的规则和限制 。 WinRT通常无法访问文件系统。 它适用于功能 ,您可以允许文件访问功能,但这会限制您的应用只能访问某些区域。 以下是如何通过WinRT进行文件访问的一个很好的例子。 WinRT or Windows Runtime should not be confused with .NET as it is ... -
你所指的是“通用对话框” ,你可以用GetOpenFileName获得文件打开对话框 BOOL GetOpenFileName( LPOPENFILENAME lpofn ); 样本可在这里找到 What you are referring to are the "common dialogs", and you can get a file open dialog with GetOpenFileName BOOL GetOpenFileName( LPOPENF ...
-
R编程功能没有()(R programming function without ())[2021-08-06]
如果你给它一个自己的类和一个回应该信息的打印方法,你就可以实现你的目标。 print.click <- function(x, ...){ # # could do something here # thecould be a plot or calculation plot(1:10, 10:1, type="l") cat("Your click message here\n perhaps \n Downward line plott ... -
Microsoft有一个页面比较GDI与Direct2D硬件加速。 GDI总是一个加速的API:当然,它总是由实际的GDI驱动程序实现来决定GDI DDI的哪些位实际加速所以它通常是加速的bitblt / stretch blit操作,并且所有线条图和其他效果由CPU完成。 有些人认为这表明GDI与新的API相比不再“足够好”,但坦率地说, 所有的图形实际上都是围绕着移动的。 GdiPlus是用软件实现的,因此,system.graphics是CLR的实现。 Microsoft has a page com ...
-
基本的bash编程(Basic bash programming)[2021-11-23]
计算名为myDir的目录中.pdf文件的数量。 val=`find myDir -type f -name '*.pdf'|wc -l` 计数将保存在val文件中。 打印一个名为data.txt的文件的第n行,其中n是一个存储整数的变量。 awk -v line_no=$lineno 'NR==line_no' data.txt lineno是你的变量 运行脚本userinput.o,该脚本需要来自STDIN的数据。 但是,您必须从文件input.txt而不是从终端提供数据。 userinput.o < ... -
编程Windows Phone 7与正常的.NET编程不同吗?(Is programming Windows Phone 7 different from normal .NET programming?)[2024-01-28]
我不知道Silverlight,但很多.Net框架在WinMo中不可用(如果可用或不可用,它通常在MSDN页面上说明)。 您可能因其他原因需要更改您的应用,因为它的屏幕较小,您必须小心电池使用情况等。 以下链接包含差异列表: http://msdn.microsoft.com/en-us/library/ff426930%28VS.96%29.aspx I don't know Silverlight but a lot of the .Net framework is not available in W ... -
是否可以选择在Windows中启动进程时使用的清单?(Is it possible to choose a manifest to use when starting a process in windows?)[2022-07-16]
我将在此处采用不同的路由并使用HKEY_CURRENT_USER\Software\Classes重新创建原始COM DLL的注册表项以指向您的备用DLL。 此位置按用户行事,并优先于HKEY_CLASSES_ROOT 。 单独的启动器可以执行此操作,不需要管理员权限。 启动器应在退出时删除这些键。 I would take a different route here and use HKEY_CURRENT_USER\Software\Classes to recreate the registry k ... -
为什么使用嵌入式file.choose()命令? filename <- file.choose() data <- read.csv(filename, skip=1) name <- basename(filename) Why you use an embedded file.choose() command? filename <- file.choose() data <- read.csv(filename, skip=1) name <- basename(filename)
-
计算可执行文件并将它们与计数器关联,创建一种“数组”变量(过滤掉当前的批处理脚本) 同时构建选择列表 在循环之后,如果choice不超过9,则使用选择,否则使用经典交互set 检索用户选择并调用可执行文件/批处理文件 (你必须启用delayedexpansion才能在循环中使用%和! env.var分隔符和即时评估) 可以这样做: @echo off setlocal enabledelayedexpansion set /A counter=0 set choice= for /R %%i in ( ...