首页 \ 问答 \ 内容安全政策cordova问题(Content Security Policy cordova problems)

内容安全政策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
更新时间:2023-09-17 10:09

最满意答案

你所指的是“通用对话框” ,你可以用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(      
    LPOPENFILENAME lpofn
);

A sample is available here

相关问答

更多
  • 如果你真的想学习底层API,那么你应该从没有一个框架开始。 按照我们在Charles Petzold的“编程Windows”一书中几年前所做的那样学习它。 关于窗口和消息如何工作的知识基础非常好,可以很好地为您服务。 从长远来看,一个好的框架,例如WinForms,Qt,VCL等将会提高生产力。 但是如果你从其中一个开始,那么你就有可能不知道发送和排队消息之间的区别,不知道HWND , HDC和HANDLE之间的区别等等。 一个好的框架非常棒,但如果你了解它下面的内容,你就会从中获得更多。 If you a ...
  • 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 ...
  • 如果你给它一个自己的类和一个回应该信息的打印方法,你就可以实现你的目标。 print.click <- function(x, ...){ # # could do something here # the could 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 ...
  • 计算名为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 < ...
  • 我不知道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 ...
  • 我将在此处采用不同的路由并使用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 ( ...

相关文章

更多

最新问答

更多
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • linux的常用命令干什么用的
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • Java中的不可变类(Immutable class in Java)
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • 绑定属性设置器未被调用(Bound Property Setter not getting Called)
  • linux ubuntu14.04版没有那个文件或目录
  • 如何使用JSF EL表达式在param中迭代变量(How to iterate over variable in param using JSF EL expression)
  • 是否有可能在WPF中的一个单独的进程中隔离一些控件?(Is it possible to isolate some controls in a separate process in WPF?)
  • 使用Python 2.7的MSI安装的默认安装目录是什么?(What is the default installation directory with an MSI install of Python 2.7?)
  • 寻求多次出现的表达式(Seeking for more than one occurrence of an expression)
  • ckeditor config.protectedSource不适用于editor.insertHtml上的html元素属性(ckeditor config.protectedSource dont work for html element attributes on editor.insertHtml)
  • linux只知道文件名,不知道在哪个目录,怎么找到文件所在目录
  • Actionscript:检查字符串是否包含域或子域(Actionscript: check if string contains domain or subdomain)
  • 将CouchDB与AJAX一起使用是否安全?(Is it safe to use CouchDB with AJAX?)
  • 懒惰地初始化AutoMapper(Lazily initializing AutoMapper)
  • 使用hasclass为多个div与一个按钮问题(using hasclass for multiple divs with one button Problems)
  • Windows Phone 7:检查资源是否存在(Windows Phone 7: Check If Resource Exists)
  • 无法在新线程中从FREContext调用getActivity()?(Can't call getActivity() from FREContext in a new thread?)
  • 在Alpine上升级到postgres96(/ usr / bin / pg_dump:没有这样的文件或目录)(Upgrade to postgres96 on Alpine (/usr/bin/pg_dump: No such file or directory))
  • 如何按部门显示报告(How to display a report by Department wise)
  • Facebook墙贴在需要访问令牌密钥后无法正常工作(Facebook wall post not working after access token key required)
  • Javascript - 如何在不擦除输入的情况下更改标签的innerText(Javascript - how to change innerText of label while not wiping out the input)
  • WooCommerce / WordPress - 不显示具有特定标题的产品(WooCommerce/WordPress - Products with specific titles are not displayed)