D
D
Dmitry2019-03-29 16:50:21
JavaScript
Dmitry, 2019-03-29 16:50:21

Is chrome.storage.local.get function very slow?

Hello. While writing an extension for the Google Chrome browser, I ran into a problem. I get my previously saved settings using the chrome.storage.local.get async function like this:

let date = new Date();
chrome.storage.local.get(null, result => {
    console.log('Settings stored in: '+new Date() - date+'ms');
});

The function call is made in popup.js every time the user opens the popup window of the extension. When you first start the browser , the time to receive the settings can reach indecent several seconds .
5c9e1fff364dc080082787.png
Subsequent calls get results in ~100-200ms.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dollar, 2019-03-29
@dollar

Use localStorage instead of chrome.storage.local

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question