Cómo agregar el complemento Google Translate al navegador Sogou
Logrado mediante código. Las operaciones específicas son las siguientes:
Agregue el siguiente código a sus favoritos
javascript:var t=((window.getSelection&&window.getSelection())||(document.getSelection&&document. getSelection() )||(document.selection&&document.selection.createRange&&document.selection.createRange().text));var e=(document.charset||document.characterSet);if(t!=''){ubicación. href=' /?text='+t+'&hl=zh-CN&langpair=auto|zh-CN&tbb=1&ie='+e;}else{location.href='.hk/translate?u='+escape(ubicación. href)+ '&hl=zh-CN&langpair=auto|zh-CN&tbb=1&ie='+e;};
Copia el código
Conoces el código anterior y simplemente abre el Página del Traductor de Google.
Pero el efecto es realmente insatisfactorio
Ahora podemos intentar
¿Obtener los siguientes favoritos como marcadores?
javascript: {d=document;b=d.body;o=d.createElement('scri'+'pt');o.setAttribute('src','.hk/translate_a/element.js?cb=googleTranslateElementInit' ); o.setAttribute('type','text/javascript');b.appendChild(o);v=b.insertBefore(d.createElement('div'),b.firstChild);v.id='google_translate_element '; v.style.display='none';p=d.createElement('scri'+'pt');p.text='function%20googleTranslateElementInit(){new%20google.translate.TranslateElement({pageLanguage:% 22% 22},%22google_translate_element%22);}';p.setAttribute('type','text/javascript');b.appendChild(p);}void%200
Copiar código
Lo anterior es la representación.