Detecting the language of a frame or a string using Chrome extension?
I am writing a Google Chrome Extension. Now I need to detec开发者_开发百科t the language of a frame in a tab. I read the post Detecting the current tab language using Chrome extension? but the answers involve examining the whole tab, apparently. Here I am in a chat and I have to examine a response in a table in a frame to see if the respondent has changed languages so that I can respond appropriately.
So what I have is either a frame or a string from the table.
Any suggestions? I am writing in javascript and I am not familiar with jquery.
Not directly in the Chrome Extensions API's, but you can create a content_script that attaches a element.addEventListener("DOMNodeInserted", function() { something })
listener to the area you want to examine and then fire off a request to the translate api to detect the language.
精彩评论