Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Unified Diff: go-back-with-backspace/pages/common.js

Issue 2325963003: Add options and a browser-action popup. (Closed) Base URL: https://chromium.googlesource.com/chromium/extensions-by-google.git@master
Patch Set: Response to comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « go-back-with-backspace/manifest.json ('k') | go-back-with-backspace/pages/installed.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go-back-with-backspace/pages/common.js
diff --git a/go-back-with-backspace/pages/common.js b/go-back-with-backspace/pages/common.js
new file mode 100644
index 0000000000000000000000000000000000000000..9fb28c52b55789d3514c40c499cda60951205af7
--- /dev/null
+++ b/go-back-with-backspace/pages/common.js
@@ -0,0 +1,33 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Load strings from messages.json into the HTML page. Each element that needs
+// an internationalized string should have an 'i18n' property holding the
+// name of the message to be used.
+function LoadInternationalizedStrings() {
+ var all = document.querySelectorAll('[i18n]');
+ for (var i = 0; i < all.length; ++i) {
+ var i18n = all[i].getAttribute('i18n');
+ if (i18n)
+ all[i].textContent = chrome.i18n.getMessage(i18n);
+ }
+}
+
+// Open a pre-filled email to send feedback to the extension developers. The
+// initial content of the email depends on whether the URL of the current page
+// is provided.
+function reportPage(url) {
+ var subject = chrome.i18n.getMessage('reportSubject');
+ var body = '';
+ if (url)
+ body = chrome.i18n.getMessage('reportBodyWithURL', url);
+ else
+ body = chrome.i18n.getMessage('reportBody');
+ var msg = 'mailto:gobackwithbackspace@google.com' +
+ '?subject=' + encodeURIComponent(subject) +
+ '&body=' + encodeURIComponent(body);
+ chrome.tabs.create({
+ url: msg,
+ active: true});
+}
« no previous file with comments | « go-back-with-backspace/manifest.json ('k') | go-back-with-backspace/pages/installed.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698