Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/utils.js

Issue 29570614: Issue 5028 - Use browser namespace (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Use callback-based API for storage Created Oct. 9, 2017, 4:01 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/uninstall.js ('k') | lib/whitelisting.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/utils.js
===================================================================
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -16,17 +16,17 @@
*/
"use strict";
let Utils = exports.Utils = {
systemPrincipal: null,
getString(id)
{
- return chrome.i18n.getMessage("global_" + id);
+ return browser.i18n.getMessage("global_" + id);
},
runAsync(callback)
{
if (document.readyState == "loading")
{
// Make sure to not run asynchronous actions before all
// scripts loaded. This caused issues on Opera in the past.
let onDOMContentLoaded = () =>
@@ -38,23 +38,23 @@
}
else
{
setTimeout(callback, 0);
}
},
get appLocale()
{
- let locale = chrome.i18n.getUILanguage();
+ let locale = browser.i18n.getUILanguage();
Object.defineProperty(this, "appLocale", {value: locale, enumerable: true});
return this.appLocale;
},
get readingDirection()
{
- let direction = chrome.i18n.getMessage("@@bidi_dir");
+ let direction = browser.i18n.getMessage("@@bidi_dir");
// This fallback is only necessary for Microsoft Edge
if (!direction)
direction = /^(?:ar|fa|he|ug|ur)\b/.test(this.appLocale) ? "rtl" : "ltr";
Object.defineProperty(
this,
"readingDirection",
{value: direction, enumerable: true}
);
« no previous file with comments | « lib/uninstall.js ('k') | lib/whitelisting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld