Notification about authentication failure in Chrome - google-chrome

I need a notification for the client application about an authentication problem in Chrome browser (for IE we used IHttpSecurity:: OnSecurityProblem ).
I found an experimental API chrome.experimental.ssl.onCertificateVerify but it is not working. I get error “chrome.experimental.ssl is undefined”. I added the “experimental” permissions to the manifest and enabled the flags. So I assume that this interface is obsolete.
Is there a way to get the notification in Chrome?

Related

Blazor WASM PWA: Google Chrome does not show Push Notifications

I've just tested Blazor example Blazing Pizza that uses push notifications as a PWA feature on Blazor. I changed public/private keys with my own generated ones and ran the project with MS Edge browser and push notifications worked as desired. But when I open it with Google Chrome, it doesn't shows any notification! (I allowed to show notifications).
I traced service-worker.js and found that notification hits the breakpoint, it means notification receives by browser but not showing:
I checked my Chrome's settings but not found anything to change.
I've found my mistake: I had blocked Google Chrome notifications in my Windows 10 notification settings!

Chrome Beta Issue : Inspite of SameSite cookie set to "None" and secure, third party cookie not received

I am implementing samesite=None;Secure to a page for cross domain access on chrome beta Version 80.0.3987.78 (Official Build) beta (64-bit)..
While loading the page I see that the attributes are applied correctly, but i still get the console error saying the cookie will not be sent.
Developer Tools->Application->Cookies (My only one cookie, set with samesite="None"; Secure)
Cookies Set
The error message from console:
A cookie associated with a cross-site resource at https://mycw125.***.com/ was set without the SameSite attribute. It has been blocked, as Chrome now only delivers cookies with cross-site requests if they are set with SameSite=None and Secure. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.
Console Error
My functionality is broken as well since the cookie is not sent. Could someone help me understand what is going wrong?
I am using chrome Version 80.0.3987.78 (Official Build) beta (64-bit).
We have seen a discrepancy in chrome behavior. This functionality works intermittently as expected, and loads the page with same cookie. It then breaks after that.
Is there maybe another cookie that is being blocked? Does it show up on the Network panel when you click on the affected request? Here are some more ideas to try: https://www.chromium.org/updates/same-site/test-debug.
In more recent versions of Chrome, the Issues panel shows more information about which cookies and what URLs are involved in issues such as this.

Can I use GCM for a chrome EXTENSION?

I'm new to web development and currently I'm trying to create a chrome extension.
I followed this google tutorial and also this one and this one but for some reason the push notifications does not work when I define the extension as an extension and not as an application.
Can anyone give some guidance? my code is basically identical to the 2nd tutorial only I am defining the extensions as an extension and not as an application.
To my understanding it might be impossible due to safety reasons(?)..
Any help will be appreciated...
Can I use GCM for a chrome EXTENSION?
Yes you can. GCM docs states that:
For Chrome apps and extensions, GCM enables Chrome instances to send
and receive message data from servers. The
chrome.gcm API allows the
Chrome apps or extensions to access the GCM service. The service works
even if an app or extension isn't currently running. For example,
calendar updates could be pushed to users even when their calendar app
isn't open.
Receive downstream messages
chrome.gcm.onMessage.addListener(function(message) {
// A message is an object with a data property that
// consists of key-value pairs.
});
There's also a dev blog guide that you might want to see. It includes sample codes and instructions like:
How push messaging works
1) Chrome extension gets a Channel ID from Chrome Run-time
2) After receiving Channel ID, your extension sends the channel ID to your web server.
3) Using GCM API, you can send a message to chrome browser which will queued in GCM Server.
4) GCM server sends your message to Chrome Run-time.
5) Chrome Run-time forwards the message to your extension.

Is there a way to display desktop notifications even when Chrome or Firefox is closed?

We're developing a website which sends push notifications to end users using GCM. We've gone through Service Worker and all. We have developed a prototype using this codelab tutorial. It is working so far, but the only issue is the notifications are displayed only when Chrome is opened. When Chrome is closed, the notifications don't reach the users.
I want to know is there any way we can overcome this and display the notifications even when the browser is closed, similar to Safari Push Notification. Thanks in advance!
If you have a "background" permission in manifest.json, your background page will be able to show notifications even when Chrome window is closed.
"permissions": [
"background"
],
As stated in the documentation:
When any installed hosted app, packaged app, or extension has "background" permission, Chrome runs (invisibly) as soon as the user logs into their computer—before the user launches Chrome. The "background" permission also makes Chrome continue running (even after its last window is closed) until the user explicitly quits Chrome.
You need to use the "background" permission with a background page, event page or a background window for hosted apps.
For web, use Push API for Chrome and other browsers. The advantage of using push messages is that even if your page is closed, your service worker will be woken up and be able to show a notification. Web Sockets and EventSource have their connection closed when the page or browser is closed so it's not recommended. Here is the documentation and example.
In Chrome. Only those users that happen to have an extension installed that requires background mode, like hangouts, will be able to receive push notifications when chrome is not "running". It does not seem like a good idea to rely on it.
The chrome team seems to be considering it for web push too but so far there is no ETA.
https://code.google.com/p/chromium/issues/detail?id=402456
Showing notification when the browser or tab is closed requires the service worker and a third party service (like google firebase)to trigger the service worker.
https://github.com/web-push-libs/ - Check these list of libraries to implement this in different platforms.
https://github.com/rijoshrc/php-service-worker-push-notification - Clone this git repository to see the simple implementation in PHP.

Can't register Chrome app for GCM

I'm trying to register a chrome app to get a registration id so I test but the chrome javascript console is showing:
Uncaught TypeError: Cannot read property 'register' of undefined
I don't know what's wrong. I got the example from: https://github.com/GoogleChrome/chrome-app-samples#push-messaging
Seems your Chrome APIs are not loaded.
You need to make sure your Chrome APIs are loaded in order to use the push messaging methods.
In order to load the Chrome APIs correctly, follow the step 5 in Chrome developer page to launch your app or extension. For some newer Chrome browser, you can go to Settings -> Extensions -> Load unpacked extension
Had the same problem,
Eventually the problem was that content scripts cannot use a lot of chrome.* APIs.
GCM is one of them.
Source