Vuex and chrome.storage - vue.js

chrome extension have access to chrome storage
Is there a way to connect chrome.storage with VueX to persist state?
Problem is that chrome storage uses async methods.

You can use vuex-persistedstate for persist vuex state.

Related

How to access $axios in composition API without using useContext

I am trying to access $axios in Vue composition API without using useContext() because the current app is not a Nuxt app and is like a library that either can be used inside a Nuxt app or Vue app. So if I use $axios in the code then in Nuxt app it can be called serverside too. if anyone can help it would be very helpful, even if we can made this mechanism with inject/provide.
Nuxt 3 officially recommends using $fetch for making http request
Note that $fetch is the preferred way to make HTTP calls in Nuxt 3 instead of #nuxt/http and #nuxtjs/axios that are made for Nuxt 2.
https://nuxt.com/docs/api/utils/dollarfetch
However if you want to set it up for example to add headers, you can create a composable and work with it throughout the nuxt app
import axios from "axios";
export const $axios = axios.create({
  baseURL: BASE_URL,
  headers: {
    ...headers
  },
});

Preserving indexedDB after navigation in Selenium Webdriver

(Resolved, see below)
I am testing an app that uses an external IdP for user login with Webdriver IO to control Selenium.
I need to use IndexedDB to save state (login state, tokens).
Problem is, when testing with Selenium, indexedDB is cleared when navigating outside the domain to the IdP. And on return to the app, the necessary state is lost. localStore (which is not an option for my app) also fails to persist when tested.
1, start at www.example-app.com, save state to indexedDB or localStorage
2, go to www.example-idp.com
3, return to www.example-app.com indexedDB and localStorage are completely empty!!
Stack:
Webdriver IO with Jasmine
Selenium Standalone, Chrome Driver (configurations for both)
React SPA
UPDATE: Issue is resolved!
So embarrassed to admit but the redirect URL was to a different port (and a different hosted copy of the app) which explains why the all local storage mediums that are origin-locked were empty. I didn't even realize till now... 😏
If you have a similar problem, please double check to make sure your domain and ports match. 👍

Checking API calls in chrome network tab with nuxt

I am new to Nuxt and I want to see my API calls in my network tab. I understand Nuxt is SSR and it doesn't show APIs in its fetch() hook in network tab. I searched online quite a bit but couldn't find a way to examine my API calls in network tab. So I was wondering if there is a way to see your API calls on fetch() hook, in network tab to examine them with Nuxt?

Getting localStorage from Ionic application in my React Native app

We are rebuilding an Ionic 1.x application with React Native. The app is used by a lot of people and I don't want everyone to log in again after they update the app.
The current app uses localStorage to save the token that defines if a user is logged in (I know, it's not the safest method). Is there a possibility that we can get the current token from the localStorage in React Native and put in our secure storage?
So basically can we call the localStorage instance in React Native? We are using the same bundle identifier so many there is a possibility to access the localStorage from the old app.
You wont treat with a web enviroment like Ionic, then localStorage wont exist, but you can use AsyncStorage instead in react native or some DB like sqlite, realm, whatermelonDB (the last one I didnt use) to save your user data

Is there a way to manually edit AsyncStorage in React-native (like LocalStorage in DevTools)?

In web dev you can open up DevTools > Application and edit Local Storage manually.
Is there similar functionality in RN?
I've installed Reactotron, but doesn't have this functionality, it only displays what lives in AsyncStorage, no edits.