How to sign in second user in incognito window to test actioncable - angularjs

I'm trying to sign in a 2nd user to see if ActionCable is working. I have my app open in a regular Chrome window on localhost:3000 and I also have it open in an incognito window also localhost:3000
From https://github.com/rails/actioncable-examples:
Open two browsers with separate cookie spaces (like a regular session and an incognito session).
Login as different people in each browser.
3 Go to the same message.
Add comments in either browser and see them appear real-time on the counterpart screen.
However, when I sign in the 2nd user in the incognito window, the 1st user gets logged out.
I'm using ng-token-auth and devise_token_auth for authentication.
Also, I have an ng-click that toggles the navbar to collapse
<button type="button" class="navbar-toggle" ng-click="isNavCollapsed = !isNavCollapsed">
<i class="fa fa-bars" aria-hidden="true"></i>
</button>
When I click the hamburger button in either the regular window or the incognito window, the navbar collapses in both windows.
I thought an incognito window would give me a completely separate cookie jar and therefore separate $scopes but I guess not.
I hope someone can tell me what is going one.

When using Incognito mode, your Sesssion stays active on every tab/window as long as you do not close each and every one of them as stated on the Incognito start page:
Pages you view in incognito tabs won't stick around in your browser's history, cookie store, or search history after you've closed all of your incognito tabs. Any files you download or bookmarks you create will be kept.
Having stated this, your session is completely different from the one in a normal tab/window, so the action cable test should work.
This may fail if by any means your logic overrides the logged in user when a new user gets logged in.

Related

Manually trigger/open Piwik consent manager?

Piwik provides js snippets for a consent manager popup and an embedded version for a privacy page.
I want to give the website users the posbiliy to change their consent, e.g. to watch a YouTube video without navigating to the privacy page, right away. Therefore a placeholder is displayed instead of the video.
The easiest way would be to trigger the consent popup manually from that placeholder image by click.
Piwik do not have documented such a functionality.
Does someone know a clever workaround to display the popup again after initially setting consents. By default the popup will only occur again when deleting cookies and local storage in the browser.
I reduced the html from privacy page to show only the button.
<div id="ppms_cm_privacy_settings" data-editor-centralize="true"
data-main-container="true" data-root="true">
<div data-disable-select='true'>
<button class="btn btn-default" id="ppms_cm_privacy_settings_button">Privacy settings
</button>
</div>
</div>
This will raise the privacy policy dialog right at the placeholder.

How to open PWA from a button within the web-app?

I want to add a button to my React Web App that opens our PWA.
I was able to get the "Install" dialog to open by caching the "beforeinstallprompt" event and triggering it with a button but now I'm looking for a way to open the "Open with" dialog in chrome that allows the user to launch the (already installed) PWA, or open the PWA itself on the click of the button within the app but I'm unable to find any resources.
There is a way to do this, you could do the following:
<a href='https://myappurl.com' target='_blank'>Open PWA</a>
The target='_blank' is important, also the url specified in the href attribute needs to be the same as the one specified in the scope, if the scope is "." then any url within your app will open the PWA, this will work in Android with Chrome browser, I haven't tested this on iPhone.

HTML input type=“file” in iframe breaks the file select dialog in Chrome and Edge

I'm working on a React web app that has an iframe component to embed another web app. The parent app has functions to open or close (unmount) the iframe component. And the parent app uses real-time data subscription and it has the behavior to automatically close the iframe when it got a specific event. So it means that the iframe can be closed anytime.
Now onto the problem, both of the apps have input type="file" to upload file. If the iframe got unmounted while I have a "file select dialog" opened from within the iframe, the dialog would still be displayed unless I click the "cancel" button. But the thing is, after closing the file dialog and click Choose File in another input type="file", the file dialog will never show up again unless I refresh the page.
For more info:
the bug won't happen if I run any of the parent or iframe app in localhost, it only happen on the deployed site
Both of the apps is from same domain but with different pathname (ex. https://hello.com/parent and https://hello.com/iframe)
I'm not sure if this is a Chromium bug because it happens in Google Chrome and MS Edge, but not in Safari and Firefox.

Disable popup blocker in firefox

From one of our application, we are calling window.open() method to open a pop up. When we are using this, the browsers are blocking the popup and user has to disable popup blocker for the specified web site.
Is there any way to disable the popup blockers for specified URL patterns(With out user intervention),like using browser API etc...
No. There is no way to alter the browser's popup blocker behaviour from within a webpage. The best you can do is include a message on your website asking people to turn off their popup blockers while using your site so that the site can function properly.

To view the silverlight app in fullscreen mode(F11)

Is there any way to load my silverlight app in F11 mode directly?
I have used
window.open(url, '_self',
'toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=no,fullscreen=yes',
'true');
HtmlPage.window.invoke("launchPage",url);
But the problem is that two instances of my app are opened. One in normal screen and the other in fullscreen.
I have tried
App.Current.Host.Content.IsFullScreen = true;
in the constructor of the App.xaml
Still its not working. :(
Where am I going wrong??
running a Silverlight application automatically in full-screen is not possible because of security restriction. It is like the following...
You have opened your banks login page in a Firefox tab. This is your current tab.
You are opening a malicious silverlight application on another tab.
The malicious silverlight application loads and creates a full-screen that exactly matches your bank's login page.
You are talking to someone while the silverlight application loads. (Your eye is not on screen) So you missed the fullscreen message that pops up.
Now when you look at the computer screen you see your bank login page that is actually a fullscreen page of the silverlight application that matches your bank's login page.
You enter your user name and password...and
When you click login the malicious application has got everything it wanted.
This is not only for Silverlight. It is a restriction that SHOULD BE THERE WITH EVERY ACTIVEX CONTROL UNTIL THIS PROBLEM IS SOLVED.
What you are doing with javascript is you are opening a new pop up window without menubar, addressbar etc. It is not a replacement of F11. And to my experience most of the users hate automatic poping up. And most modern browsers will block them anyway.
The best way is to tell the user she needs to view your application on fullscreen and LET HER DECIDE INSTEAD OF FORCING IT.

Resources