Firefox private window flaky localStorage? - reactjs

Some background - I'm currently working on a React/Typescript web-based project where we are relying on local storage to set up some fields that are later used by our authentication logic. These items should be set very early during the app start up via localStorage.setItem('item', value) and later accessed via localStorage.getItem('item')
We have observed a very strange issue specific to FireFox private mode where the items are never added to localStorage at the beginning of the app life cycle thus breaking some of our authentication logic. In addition, when we try to reproduce the breaking scenario but also observe localStorage via the storage tab in the Firefox debugger while going through the repro steps, the issue doesn't occur.
Is anyone aware of any issues with firefox localstorage that could cause this?
We have a workaround using cookies but would prefer not to have to add this fallback for every use of localStorage. In addition, this issue doesn't occur on Chrome or Edge
Firefox version - 75.0 (64-bit)

Related

Firefox - Session Storage not being duplicated when duplicating tabs due to session.length

I am working on a React 16 Web App where there is a requirement for users to use the "Duplicate Tab" function and carry the sessions over to the new tab
Edge and Chrome work just fine and copy the session over to the new tab automatically.
However, with Firefox, it's appeared there is a limit on how big the sessionStorage.length for it to be copied over. If we added a lengthy variable in the sessionStorage, it would not copy the whole lot.
I've been trying to find more info about this limit or any work around from this. Any help would be much appreciated.

How to isolate LocalStorage in CefSharp browser

Question
Is it possible to have one WPF application running CefSharp with multiple browser tabs with each tab having its own isolated LocalStorage?
EDIT: Answer
It's completely possible.
Problem
I have found the need to have multiple browser instances in a single WPF application which each act is their own isolated browsers. What this means is that they cannot share anything. Think of having a browser where each tab can have their own User, like how Chrome manages users, but in each tab instead of each individual browser.
I came across the Request Context thing pretty fast from here:
https://github.com/cefsharp/CefSharp/wiki/General-Usage#request-context-browser-isolation
However, this is not isolating the LocalStorage, which is turning into a pain because some websites store their session token in LocalStorage. What I have now is:
BrowserSettings = new RequestContextSettings
{
CachePath = cacheFileName,
PersistSessionCookies = false,
PersistUserPreferences = false
};
where cacheFileName is unique to each tab.
I have also tried disabling LocalStorage using the Command Line Argument disable-local-storage but then the website which use LocalStorage for session data don't run at all.
I have a crazy solution in mind where I create another WPF application which is just the browser, and embed that application into my own within each tab, but that brings its own set of problems and headaches, and I'm not completely sure that will even work. Any help would be appreciated!

serenity properties does not work for safari

In my setup, I am running my tests for CucumberWithSerenity.class
The issue is after execution of my tests with safari browser, safari does not clear the cookies and other related data. e.g. After login steps are completed, i have to search for a user and set the user so i get relevant sections. But safari retains the set user information from previous test execution. To address this issue, i have set the following in serenity.properties file : safari.options.useCleanSession=true
however, this does not seem to work.
On other browsers, i do not have such an issue. Am i implementing the property incorrectly?
Are there other options in ensuring that every time safari browser is launched, i have fresh new session?
Can you please provide an example?

2sxc Data from another app and zone

I'm using 2sxc 8.5.4 on DNN Evoq, i have an App which is in Portal 0 and i'm showing the content of this in child apps.
I created a template and created a query to fetch data from the App in Portal 0 by adding its App id and Zone id.
All works fine, when i update the App content in Portal 0, changes are shown instantly in Child portals.
Problem is that the changes only show instantly to the browser i'm currently editing the changes. Example: if i edit the changes in Chrome, changes reflect instantly on Chrome but in Firefox or another PC it takes awhile to show the changes.
I believe its a cache issues, but don't know what else i can do within the visual query to show changes instantly on all browsers.
Any help would be greatly appreciated
The following is the snapshot of the visual query:
I'm guessing it's something a bit different, since you're not using a cache-data-source as far as I can tell.
Could it be that you are providing the data as JSON to the browser using the API or similar? because then the browsers have a default behaviour to cache this, unless you are in F12 mode or something.
please try to provide more details if this is wrong.

AngularJS app is not loading on Safari (iOS 5.1.1) back button. Any suggestions?

I've ran into an issue with Safari on iOS 5.1.1 and Angular where I am doing paginated results. After I decide to leave the page that is hosting the app, and then come back to the page by using the browser's history back button.
The application is not initialized so as I scroll again, the pagination functionality is not triggered.
Since 5.1.1 doesn't provide a web inspector, I had to rely on console.log to print events that I want to see that it's executing. On initial load, I see everything ok, but when I am back through the back button nothing fires.
My usual ways of fixing this are not working. Here are the things I've tried:
Used manual bootstrapping of Angular app
Made the page not support caching and expire the page as soon as it's rendered.
Neither of these helped, which is why I am here asking for some suggestions. Unfortunately it's not a very easy thing to replicate through a Fiddle or a hosted HTML file so I am unable to provide one. Hoping that some of you may have experienced this before.
Thanks in advance for any help.
Answer is quite late and I hope you found a solution already but it might be useful for others.
Unfortunately I won't be able to answer why the app is not initialized (due to the lack of code) but I can give you some tools/tips to ease the debugging (assuming you have the iOS simulator).
Debuging on mobile safari can be done either :
with weinre and get the features of the web concole,
or by enabling remote debugging in Mobile Safari itself, see here
Yea, same problem here with iOS 7. It must send the DOM structure over before running any javascript. Kinda pointless...
Since the problem is with mobile safari and since it supports popstate event, you can use this event to detect when the user is back in combination with $location.path(), for example:
$(window).bind("popstate", function () {
alert(location.pathname + $location.path());
});

Resources