在Raspberry Pi Raspbian Chromium Kiosk-Mode上,我正在保存一个cookie:
document.cookie = "currentImage=" + currentImage + ";expires=2038-01-19, 03:14:08 UTC; path=/"
Run Code Online (Sandbox Code Playgroud)
然后过了一会儿,Pi的力量被削减了.系统恢复后,无法读取cookie.有没有办法在JS中保留cookie?
我正在通过$web
Azure 存储帐户的 BLOB 存储中的容器托管一个静态网站。该容器中的缩小 JS 包含敏感数据,例如 azure-tables 键。
根据文档:
您可以修改 $web 容器的公共访问级别,但这对主要静态网站端点没有影响,因为这些文件是通过匿名访问请求提供的。这意味着对所有文件的公共(只读)访问。
有什么方法可以限制对网站内容的访问(尤其是$web
容器中的缩小版 JS )?
azure azure-storage azure-storage-blobs azure-active-directory
Azure Web App具有出色的全局身份验证选项.
我目前正在使用Azure AD作为"身份验证提供程序"和"使用...登录":
这很好但我无法弄清楚如何获取当前登录用户的用户名(电子邮件).我的应用程序的许多功能都有此要求.
有任何想法吗?
azure azure-web-sites azure-active-directory azure-web-app-service
<?xml version="1.0"?>
<template
format="5"
revision="3"
name="Notification"
description="Creates a new helper class that can show or cancel a status bar notification."
minApi="4">
<category value="UI Component" />
<dependency name="android-support-v4" revision="10" />
<parameter
id="className"
name="Class Name"
type="string"
constraints="class|unique|nonempty"
default="NewMessageNotification"
help="The name of the notification helper class to create, e.g. 'NewMessageNotification'." />
<parameter
id="expandedStyle"
name="Style when Expanded"
type="enum"
default="text"
help="The expanded notification style to use for devices running Android 4.1 or later." >
<option id="none">None</option>
<option id="text">More text</option>
<option id="picture">Picture</option>
<option id="list">List</option>
</parameter>
<parameter …
Run Code Online (Sandbox Code Playgroud) 有一些基于 Web 的 QR 扫描仪的工作示例,特别是Instascan ( repo ) 和JsQRScanner ( repo )。这两个功能在 Android 上都能完美运行。然而,在 iPhone 上运行 iOS 12 的 Safari 浏览器上,示例和我的代码都严重失败,产生了一个黑匣子,其中应该有视频源,或者什么也没有。如果没有 Mac,我无法调试它,因为如果我无法访问 Promise 对象,我就无法捕获 JavaScript Promise。
我尝试了这两个库,甚至与其中一位开发人员进行了沟通,但日志会简化该过程。如果没有适当的工具,我无法在 Safari 上生成这些日志。
有什么办法可以让 Safari 上正常工作吗?
这是我的 JsQRScanner 代码的一部分。我还保留了旧的 InstaScan 代码,以防有人需要。
/**
* Sets up the QR scanner.
* this function will be called when JsQRScanner is ready to use
* @see https://github.com/jbialobr/JsQRScanner
*/
function JsQRScannerReady() {
try {
//create a new scanner passing to it a callback function that …
Run Code Online (Sandbox Code Playgroud) 我想将PWA功能添加到我的App Service中。它是用C#ASP.NET编写的。但是,Chrome无法访问清单,而Edge甚至都没有获得图标(这可能是一个单独的问题)。其他桌面浏览器显然还没有PWA功能。
Chrome是唯一请求清单的浏览器。这是控制台中的错误消息:
Failed to load https://login.windows.net/b79fd714-9c54-449d-b377-3b59deb2d3b6/oauth2/authorize?response_type=code+id_token&redirect_uri=https%3A%%{myappname}.azurewebsites.net%.auth%2Flogin%2Faad%2Fcallback&client_id=67bedd5c-5478-44ec-ba13-85061c71114b&scope=openid+profile+email&response_mode=form_post&nonce=df52b6dc64dd4c3393957675f365ae93_20180903064438&state=redir%3D%252Fwebmanifest.json: Redirect from 'https://login.windows.net/b79fd714-9c54-449d-b377-3b59deb2d3b6/oauth2/authorize?response_type=code+id_token&redirect_uri=https%3A%%{myappname}.azurewebsites.net%.auth%2Flogin%2Faad%2Fcallback&client_id=67bedd5c-5478-44ec-ba13-85061c71114b&scope=openid+profile+email&response_mode=form_post&nonce=df52b6dc64dd4c3393957675f365ae93_20180903064438&state=redir%3D%252Fwebmanifest.json' to 'https://login.microsoftonline.com/b79fd714-9c54-449d-b377-3b59deb2d3b6/oauth2/authorize?response_type=code+id_token&redirect_uri=https%3A%%{myappname}.azurewebsites.net%.auth%2Flogin%2Faad%2Fcallback&client_id=67bedd5c-5478-44ec-ba13-85061c71114b&scope=openid+profile+email&response_mode=form_post&nonce=df52b6dc64dd4c3393957675f365ae93_20180903064438&state=redir%3D%252Fwebmanifest.json' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://{myappname}.azurewebsites.net' is therefore not allowed access.
Run Code Online (Sandbox Code Playgroud)
我在App Service中启用的AAD身份验证似乎正在干扰浏览器的清单请求。
我知道要快速解决此问题,Microsoft必须将此应用程序添加到他们的CORS中。这当然不是我期望发生的事情。但是,我需要让浏览器访问清单的其他方法。
我已将必要的mimeMaps添加到了web.config
。
<staticContent>
<remove fileExtension=".json" />
<mimeMap fileExtension=".json" mimeType="application/json" />
<remove fileExtension=".webmanifest" />
<mimeMap fileExtension=".webmanifest" mimeType="application/json" />
</staticContent>
Run Code Online (Sandbox Code Playgroud)
这是我的顶部Head
:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf />
<meta name="viewport" content="width=device-width, initial-scale=>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" …
Run Code Online (Sandbox Code Playgroud)