Skip to content

Commit

Permalink
Google translate css selector change
Browse files Browse the repository at this point in the history
  • Loading branch information
KoreanThinker committed Apr 22, 2022
1 parent 8a3e215 commit e807df3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-native-translator",
"title": "React Native Translator",
"version": "1.1.2",
"version": "1.1.3",
"description": "Free translate component & hook",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export const INJECTED_JAVASCRIPTS: Record<
document.querySelector("body > c-wiz > div > div > div > div:nth-child(2) > div:nth-child(1) > div:nth-child(5) > form > div > div > button").click()
}, 500)
setInterval(() => {
var selector = 'body > c-wiz > div > div:nth-child(2) > c-wiz > div:nth-child(2) > c-wiz > div > div:nth-child(2) > div:nth-child(3) > c-wiz:nth-child(2) > div:nth-child(7) > div > div > span > span > span'
var selector = 'span[data-language-for-alternatives] > span'
var doc = document.querySelector(selector)
window.ReactNativeWebView.postMessage(doc.innerText)
}, 200)
Expand All @@ -183,7 +183,7 @@ export const INJECTED_JAVASCRIPTS: Record<
document.querySelector("body > c-wiz > div > div > div > div:nth-child(2) > div:nth-child(1) > div:nth-child(5) > form > div > div > button").click()
}, 500)
setInterval(() => {
var selector = 'body > c-wiz > div > div:nth-child(2) > c-wiz > div:nth-child(2) > c-wiz > div > div:nth-child(2) > div:nth-child(3) > c-wiz:nth-child(2) > div:nth-child(7) > div > div > span > span > span'
var selector = 'span[data-language-for-alternatives] > span'
var doc = document.querySelector(selector)
if(doc) window.ReactNativeWebView.postMessage(doc.innerText)
else window.ReactNativeWebView.postMessage('${LOADING_MESSSAGE}')
Expand Down

0 comments on commit e807df3

Please sign in to comment.