内容安全政策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

相关问答

更多

如何在Windows中开始编程?(How to start programming in Windows? [closed])

如果你真的想学习底层API,那么你应该从没有一个框架开始。 按照我们在Charles Petzold的“编程Windows”一书中几年前所做的那样学习它。 关于窗口和消息如何工作的知识基础非常好,可以很好地为您服务。 从长远来看,一个好的框架,例如WinForms,Qt,VCL等将会提高生产力。 但是如果你从其中一个开始,那么你就有可能不知道发送和排队消息之间的区别,不知道HWND , HDC和HANDLE之间的区别等等。 一个好的框架非常棒,但如果你了解它下面的内容,你就会从中获得更多。 If ...

在Windows 8中的文件IO(File IO in Windows 8)

WinRT或Windows运行时不应与.NET混淆,因为它不是.NET。 WinRT只能访问Win32 API的一个子集,但不能访问.NET等所有内容。 这里有一篇很好的文章,介绍WinRT中的规则和限制 。 WinRT通常无法访问文件系统。 它适用于功能 ,您可以允许文件访问功能,但这会限制您的应用只能访问某些区域。 以下是如何通过WinRT进行文件访问的一个很好的例子。 WinRT or Windows Runtime should not be confused with .NET as i...

如何在windows编程中做“选择文件”功能?(how to make “choose file” function on windows programming?)

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

R编程功能没有()(R programming function without ())

如果你给它一个自己的类和一个回应该信息的打印方法,你就可以实现你的目标。 print.click <- function(x, ...){ # # could do something here # the <something> could be a plot or calculation plot(1:10, 10:1, type="l") cat("Your click message here\n perhaps \n Downward line ...

在Windows上用C进行直接GDI编程(Straight GDI Programming in C on Windows)

Microsoft有一个页面比较GDI与Direct2D硬件加速。 GDI总是一个加速的API:当然,它总是由实际的GDI驱动程序实现来决定GDI DDI的哪些位实际加速所以它通常是加速的bitblt / stretch blit操作,并且所有线条图和其他效果由CPU完成。 有些人认为这表明GDI与新的API相比不再“足够好”,但坦率地说, 所有的图形实际上都是围绕着移动的。 GdiPlus是用软件实现的,因此,system.graphics是CLR的实现。 Microsoft has a pag...

基本的bash编程(Basic bash programming)

计算名为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而不是从终端提供数据。 userinpu...

编程Windows Phone 7与正常的.NET编程不同吗?(Is programming Windows Phone 7 different from normal .NET programming?)

我不知道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...

是否可以选择在Windows中启动进程时使用的清单?(Is it possible to choose a manifest to use when starting a process in windows?)

我将在此处采用不同的路由并使用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 regis...

从read.csv(file.choose())获取文件名(Get filename from read.csv(file.choose( )))

为什么使用嵌入式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)

如何使用选项进行bat文件列表(How to make bat file listing with options to choose)

计算可执行文件并将它们与计数器关联,创建一种“数组”变量(过滤掉当前的批处理脚本) 同时构建选择列表 在循环之后,如果choice不超过9,则使用选择,否则使用经典交互set 检索用户选择并调用可执行文件/批处理文件 (你必须启用delayedexpansion才能在循环中使用%和! env.var分隔符和即时评估) 可以这样做: @echo off setlocal enabledelayedexpansion set /A counter=0 set choice= for /R %%i...

相关文章

更多

《Spring Security 3》 【第二章】 Spring Security起步(1)

在本章中,我们将要学习Spring Security背后的核心理念,包括重要的术语和产品架构。我们将会 ...

《Spring Security 3》 【第二章】 Spring Security起步(3)

Spring Security的架构在很大程度上依赖代理(delegates)和servlet过滤器, ...

《Spring Security 3》 【第二章】 Spring Security起步(2)

尽管Spring Security的配置可能会很难,但是它的作者是相当为我们着想的,因为他们为我们提供 ...

怎么用spring security?

我正在学习spring security,看了网上的文档后(下面的附件),动手试了下,结果报错了,不知 ...

《Spring Security 3》 【第三章】增强用户体验(5)

Spring Security框架提供的InMemoryDaoImpl内存凭证存储使用了一个简单的ma ...

《Spring Security 3》 【第一章】 一个不安全应用的剖析

本书的写作遵循了这样的一个开发模式,这个模式我们感觉提供了一个有用的前提来解决复杂的话题——即使用一个 ...

《Spring Security 3》 【第四章】 凭证安全存储(1)

在本章中,我们将会把到目前为止都在使用的内存存储转移到数据库作为后台的认证存储。我们将会介绍默认的Sp ...

《Spring Security 3》 【第三章】增强用户体验(3)

对于经常访问站点的用户有一个便利的功能就是remember me。这个功能允许一个再次访问的用户能够被 ...

《Spring Security 3》 【第五章】 精确的访问控制(1)

在本章中,我们将要学习规划应用安全的技术以及用户/组的划分。其次,我们学习两种实现精确访问控制的实现方 ...

《Spring Security 3》 【第四章】 凭证安全存储(5)

现在你可能会意识到我们remember me功能的实现,能够在应用重启前很好的使用,但在应用重启时用户 ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本