title: Adding googleTranslateElementInit to an existing website (not my own site)
body: <p>I want to translate a page through a google chrome extension and I'm trying to add this function googleTranslateElementInit on another site using right-click mouse "translate this page" on a Chinese website but it doesn't work, i don't get what am I missing and how to fix the code in order for the site to change it language to english using this function.</p>
  
  <hr>
  
  <p>The code works when i try to run it with my own html page
  but when I try to add all the codes needed for the function to work
  it seems like it doesn't do anything...</p>
  
  <hr>
  
  <p>Do I need to add additional settings on manifest.json for MAC pcs?</p>
  
  <pre><code>const root = document.querySelector('body');
  root.setAttribute("id", "google_translate_element");
  
  $('&lt;script type="text/javascript"&gt;' +
              function googleTranslateElementInit() {
                  new google.translate.TranslateElement(
                      {
                          pageLanguage: 'zh-CN',
                          includedLanguages: 'en',
                          gaTrack: true,
                          gaId: 'UA-XXXXXXXX-X'
                      },
                      'google_translate_element'
                  );
              } + '&lt;/' + 'script&gt;').appendTo(document.body);
  
  $('&lt;script  type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"&gt;&lt;/' + 'script&gt;').appendTo(document.body)[0];
  </code></pre>
  
  <p>I expect to have the text translated as it worked with my own html file
  but all i get is the added function and scripts to the head and body sections and nothing happens.
  thanks for your help in advanced...</p>