OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 Google Inc. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Load strings from messages.json into the HTML page. Each element that needs |
| 6 // an internationalized string should have an 'i18n' property holding the |
| 7 // name of the message to be used. |
| 8 function LoadInternationalizedStrings() { |
| 9 var all = document.querySelectorAll('[i18n]'); |
| 10 for (var i = 0; i < all.length; ++i) { |
| 11 var i18n = all[i].getAttribute('i18n'); |
| 12 if (i18n) |
| 13 all[i].textContent = chrome.i18n.getMessage(i18n); |
| 14 } |
| 15 } |
| 16 |
| 17 // Open a pre-filled email to send feedback to the extension developers. The |
| 18 // initial content of the email depends on whether the URL of the current page |
| 19 // is provided. |
| 20 function reportPage(url) { |
| 21 var subject = chrome.i18n.getMessage('reportSubject'); |
| 22 var body = ''; |
| 23 if (url) |
| 24 body = chrome.i18n.getMessage('reportBodyWithURL', url); |
| 25 else |
| 26 body = chrome.i18n.getMessage('reportBody'); |
| 27 var msg = 'mailto:gobackwithbackspace@google.com' + |
| 28 '?subject=' + encodeURIComponent(subject) + |
| 29 '&body=' + encodeURIComponent(body); |
| 30 chrome.tabs.create({ |
| 31 url: msg, |
| 32 active: true}); |
| 33 } |
OLD | NEW |