1 <!-- 2 Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this 3 source code is governed by a BSD-style license that can be found in the 4 LICENSE file. 5 --> 6 7 <html> 8 <head> 9 <style> 10 body { 11 color: black; 12 width: 300px; 13 } 14 </style> 15 <script> 16 function setChildTextNode(elementId, text) { 17 document.getElementById(elementId).innerText = text; 18 } 19 20 function init() { 21 setChildTextNode('languageSpan', chrome.i18n.getMessage("click_here")); 22 } 23 24 function getAcceptLanguages() { 25 chrome.i18n.getAcceptLanguages(function(languageList) { 26 var languages = languageList.join(","); 27 setChildTextNode('languageSpan', 28 chrome.i18n.getMessage("chrome_accept_languages", languages)); 29 }) 30 } 31 </script> 32 </head> 33 <body onload="init()"> 34 <div onclick="getAcceptLanguages();"> 35 <span id="languageSpan"></span> 36 </div> 37 </body> 38 </html> 39