1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +02:00

Safari: enable storage-used number formatting consistent with other browsers

This commit is contained in:
Chris 2015-03-16 22:50:39 -06:00
parent cf3816b494
commit 339ffe9698

View File

@ -130,6 +130,14 @@ vAPI.closePopup = function() {
/******************************************************************************/
Number.prototype._toLocaleString = Number.prototype.toLocaleString;
Number.prototype.toLocaleString = function() {
// some parts expect comma-formatting; Safari doesn't do it automatically
return this._toLocaleString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
};
/******************************************************************************/
// A localStorage-like object which should be accessible from the
// background page or auxiliary pages.
// This storage is optional, but it is nice to have, for a more polished user