草庐IT

Security-Active

全部标签

javascript - Angular ui router ui-sref-active on parent

我有一个父状态和许多子状态。如果我想让父级上的ui-sref-active在我在其中一个child身上时工作,我需要做这个“hack”:$scope.isActive=function(){return$state.includes('playLotteries.Index')||$state.includes('playLotteries.Group')||$state.includes('playLotteries.hunter');}这是非常丑陋的方式,而且我有很多child,所以这似乎不是一个好的解决方案。有人对此问题有其他解决方案吗? 最佳答案

javascript - phonegap + ionic 使用 Content-Security-Policy 加载 maps.googleapis.com,如何?

我尝试了很多加载谷歌地图和firebaseio的方法,但都没有成功:这就是我现在拥有的:我得到:Refusedtoloadthescript'https://maps.googleapis.com/maps/api/js?libraries=places'becauseitviolatesthefollowingContentSecurityPolicydirective:"script-src'self'https://maps.googleapis.com/*'unsafe-inline''unsafe-eval'".Refusedtoloadthescript'https://t

javascript - Cordova 错误 : Refused to execute inline script because it violates the following Content Security Policy directive

我正在学习将Cordova与jquerymobile结合使用,但出现以下错误:RefusedtoexecuteinlinescriptbecauseitviolatesthefollowingContentSecurityPolicydirective:"default-src'self'data:gap:https://ssl.gstatic.com'unsafe-eval'".Eitherthe'unsafe-inline'keyword,ahash('sha256-iacGaS9lJJpFDLww4DKQsrDPQ2lxppM2d2GGnzCeKkU='),oranonce('n

javascript - 如何通过 Content-Security-Policy 允许 `javascript:void(0)` 在 HTML 元素属性中使用?

我希望能够做到或确保即使处理程序未能阻止默认操作也不会发生任何事情。我应该如何声明允许使用Content-Security-PolicyHTTP响应header而不求助于unsafe-eval? 最佳答案 我最近将CSP策略应用于一个巨大的VUE项目,方法是将元header添加到index.html。GoogleChrome会打印关于javascript:的警告链接,但除此之外没有其他任何事情发生。我所做的只是删除href="javascript:属性,并添加了一个样式来保持游标样式:a:hover{cursor:pointer;}

javascript - Active Directory 集成问题 Nodejs

我是Nodejs的新手,我想使用AzureActiveDirectory进行身份验证。我按照提到的方式下载了Node并安装了NPMHerenpminstallexpressnpminstallejsnpminstallejs-localsnpminstallrestifynpminstallmongoosenpminstallbunyannpminstallassert-plusnpminstallpassportnpminstallpassport-azure-ad之后,根据文档,我遵循了第3步:设置您的应用以使用passport-node-js策略这是config.jsexport

javascript - CORS plugin/--disable-web-security 如何在浏览器上工作?

我确定我不是唯一使用过/使用过CORSplugins的人对于浏览器或--disable-web-security标志,同时对外部(甚至内部)API端点进行API调用。我使用这个插件来进行谷歌地图相关的API调用。但在同一个应用程序中,ParseSDKAPI调用不需要CORS或--disable-web-security标志。我的问题是:为什么这些端点的行为不同以及CORS插件如何解决问题(即使我们无法控制这些API)?提前致谢。 最佳答案 好吧,那个插件的所作所为是非常不负责任的;它实际上禁用了同源策略,该策略强制特定源上的网站只能

javascript - Shiny 的 active 颜色

是否可以使用选择小部件来显示用于响应式(Reactive)颜色选择的调色板?我想让用户为Shiny的应用程序创建的图选择颜色。 最佳答案 shinysky包有一个颜色选择器,您可以将其与shiny一起使用:require(shinysky)require(shiny)runApp(list(ui=bootstrapPage(jscolorInput("colorid"),uiOutput('myPanel'),plotOutput('plot')),server=function(input,output){output$myPan

javascript - 如何触发 :active pseudoclass on keyboard 'enter' press?(仅使用 CSS)

CSS:a:focus{opacity:.75}a:active{transform:translateY(4px)}意图:使用:focus样式作为视觉提示,使用键盘用户跳转到链接他们点击enter激活链接;:active样式提供视觉按键反馈问题::active样式可以正确触发鼠标点击,但不能触发按键。我可以只用CSS解决这个问题吗? 最佳答案 好问题!是的,你不能再这样做了。很久以前,MSIE将:active当作:focus来处理,所以有一种方法可以通过超链接来实现这一点(这是在千兆互联网速度之前和浏览器的时候除了愚蠢的挥动旗帜或

javascript - 未捕获( promise )DOMException : Subscription failed - no active Service Worker

我正在尝试订阅用户,但这是我第一次遇到的错误。第二次,它正在工作,因为用户已经处于事件状态这是我的代码:if('serviceWorker'innavigator){console.log('ServiceWorkerissupported');navigator.serviceWorker.register('sw.js').then(function(reg){console.log(':^)',reg);reg.pushManager.subscribe({userVisibleOnly:true}).then(function(sub){console.log('endpoin

javascript - 两个站点上的 SECURITY_ERR : DOM Exception 18 when applying document. 域。我该如何解决这个问题?

我在内部服务器server1.mydomain.com/page.jsp有一个页面,在不同的内部服务器有另一个页面,10.x.x.x:8081/page.aspx。在server1.mydomain.com上,我在page.jsp中设置document.domain如下://page.jsponserver1.mydomain.comdocument.domain=document.domain;当我在document.domain上发出警报时,它显示为server1.mydomain.com。在10.x.x.x服务器上,我在page.aspx中设置了document.domain,结