diff --git a/src/js/settings.js b/src/js/settings.js index 26aa954e3..6315eaf18 100644 --- a/src/js/settings.js +++ b/src/js/settings.js @@ -109,7 +109,11 @@ var exportToFile = function() { var onLocalDataReceived = function(details) { uDom('#localData > ul > li:nth-of-type(1)').text( - vAPI.i18n('settingsStorageUsed').replace('{{value}}', details.storageUsed.toLocaleString()) + vAPI.i18n('settingsStorageUsed') + .replace( + '{{value}}', + typeof details.storageUsed === 'number' ? details.storageUsed.toLocaleString() : '?' + ) ); var elem, dt; diff --git a/src/js/storage.js b/src/js/storage.js index edb238976..7a42cd708 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -1,7 +1,7 @@ /******************************************************************************* - uBlock - a browser extension to block requests. - Copyright (C) 2014-2015 Raymond Hill + uBlock Origin - a browser extension to block requests. + Copyright (C) 2014-2016 Raymond Hill This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ Home: https://github.com/gorhill/uBlock */ -/* global YaMD5, µBlock, vAPI, punycode, publicSuffixList */ +/* global YaMD5, punycode, publicSuffixList */ 'use strict'; @@ -33,7 +33,12 @@ µBlock.storageUsed = bytesInUse; callback(bytesInUse); }; - vAPI.storage.getBytesInUse(null, getBytesInUseHandler); + // Not all platforms implement this method. + if ( vAPI.storage.getBytesInUse instanceof Function ) { + vAPI.storage.getBytesInUse(null, getBytesInUseHandler); + } else { + callback(); + } }; /******************************************************************************/