Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
release nightly testgs
Browse files Browse the repository at this point in the history
  • Loading branch information
theowenyoung committed Nov 7, 2022
1 parent 6602dcb commit d381f01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/contentScript/enhance.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,30 +235,6 @@ function removeCopyiedNodes(){
function isBody(el) {
return document.body === el;
}
let isInitedTitle = false;
function getTitleContainer(root,hostname){
if(!isInitedTitle){

if(hostname==='news.yahoo.com'){
let ele = document.querySelector('h1[data-test-locator="headline"]');
if(ele){
isInitedTitle = true;
return ele;
}else{
return null;
}
}else{
let ele = document.querySelector('h1');
if(ele){
isInitedTitle = true;
return ele;
}else{
return null;
}
}

}
}
function isDuplicatedChild(array,child){
for(const item of array){
if(item.contains(child)){
Expand Down
2 changes: 2 additions & 0 deletions src/contentScript/pageTranslator.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ function removeExtraDelimiter(textContext) {


function backgroundTranslateHTML(translationService, targetLanguage, sourceArray2d, dontSortResults) {
console.log('sourceArray2d', sourceArray2d)
return new Promise((resolve, reject) => {
chrome.runtime.sendMessage({
action: "translateHTML",
Expand Down Expand Up @@ -823,6 +824,7 @@ Promise.all([twpConfig.onReady(), getTabUrl()])
piecesToTranslate = getNodesThatNeedToTranslate(document.body,ctx).reduce((acc, node) => {
return acc.concat(getPiecesToTranslate(node))
}, [])
console.log("test")
attributesToTranslate = getAttributesToTranslate()
// TODO
// attributesToTranslate = [];
Expand Down

0 comments on commit d381f01

Please sign in to comment.