How to run Chrome Extension - Printable Version +- Antwise community forums (https://forums.antwise.com) +-- Forum: Antview (https://forums.antwise.com/forumdisplay.php?fid=11) +--- Forum: Antview for Windows (https://forums.antwise.com/forumdisplay.php?fid=12) +--- Thread: How to run Chrome Extension (/showthread.php?tid=157) |
How to run Chrome Extension - hys999 - 2023-07-12 hi wila. Nice to visit you again after a long time. I am always grateful for good components. But after a long time, I ask again. When I open a site Chrome Extension [Google Translate] I want to drive By default, extensions are installed in Antview. Please tell me how to drive it. Since I am Korean, I have a lot of access to overseas websites. Also, it is very inconvenient to do any work with the page source. For example Chinese, English, Japanese Source of these pages To reprocess the materials to suit me It will take a lot of time. That's why I started With [Google Translate] running I want to open a specific site and import its translated source. Is it possible? I'd really appreciate it if you could tell me how. RE: How to run Chrome Extension - wila - 2023-07-12 Hi, Thank you for your question. At this moment, WebView2 itself does not have extension support. See also: https://github.com/MicrosoftEdge/WebView2Feedback/issues/98 and https://github.com/MicrosoftEdge/WebView2Feedback/issues/191 From what I understand, Microsoft is working on adding support for extension support, but there does not appear to be a time line. As WebView2 itself does not yet have extension support, there's not much for AntView to expose in that regard. But you are looking for a feature that might be possible to get working without using an actual extension as google has a web only version by visiting their translate website. So I figured to go to the https://translate.google.com website. Entered the url https://antview.dev and suggested to the translate site to translate from English to Dutch. This then returns the following URL to use: https://antview-dev.translate.goog/?_x_tr_sl=en&_x_tr_tl=nl&_x_tr_hl=en-US&_x_tr_pto=wapp I then opened the URL from above in AntView and looked what the output is of the RequestCurrentText method in the Document interface. The output of that was translated to Dutch for about half the page. The rest showed up in English. So it looks like that google is translating on the spot, if it isn't rendered.. it isn't getting translated. Paging down through the page and calling the RequestCurrentText again did deliver better results. But as you can see.. it still isn't perfect as some html seeped through as well. This would have to be addressed either at javascript level or when post processing the content. FWIW, you could create your own version of RequestCurrentText by running the following javascript: Code: document.body.textContent; followed by passing the result of that tidbit of javascript through DecodeJsonObjectString Hope this helps, -- Wil RE: How to run Chrome Extension - hys999 - 2023-07-12 aha. It wasn't easy. But as always, thanks for the detailed help. For reference, I'll try. RE: How to run Chrome Extension - hys999 - 2023-07-14 I want to try some tricks. by any chance In the <body> area when html is loaded between others as defined by me Script source to innerhtml, etc Can I insert it? My own JavaScript source Is there a way to insert it Please let me know if there is a way. Reference source: https://www.w3schools.com/howto/howto_google_translate.asp RE: How to run Chrome Extension - wila - 2023-07-14 Hi, Yes, of course you can. Taking the example from w3schools that you attached I went to the VB6 browser demo form and added a new button to the form called "AutoTranslateButton" and put the following code in the OnClick event. Code: Private Sub AutoTranslateButton_Click() and that worked for me. Navigating to the antwise.com website, then clicking the "Translate" button nicely inserted the google translate feature into the page. Hope this helps, -- Wil RE: How to run Chrome Extension - hys999 - 2023-07-14 Thanks again for the really kind reply. But in https://world.taobao.com It's sad because it doesn't work. It seems that the page source is complicated. But good sincere thanks. RE: How to run Chrome Extension - wila - 2023-07-14 Hi, Strange as it works for me on that page? (see the screenshot below, note that you have to be logged in to see the screenshot) Probably something has gone wrong when copying the code. If you still have problems then I can attach the code if needed. Also note that you can test this type of thing in developer tools (Function key F12 when in the browser control), the screenshot here is from MS Edge, but you can do the exact same thing in AntView after pressing F12. You can diagnose things that way when writing custom scripts. See also: https://doc.antview.dev/hs191.htm -- Wil RE: How to run Chrome Extension - hys999 - 2023-07-17 Administrator, if you change Taobao to Korean instead of English, Can you send me the converted picture? I only partially translate. (pictured above) Normal full translation (picture below) RE: How to run Chrome Extension - wila - 2023-07-17 Hi, I see the same as you. This looks like it is an issue with the google translate button, or the translation service in general. There's also issues if I go to a normal browser and stick the https://world.taobao.com URL directly in https://translate.google.com and set the translation button to Korean. The page is missing a lot of details. eg. https://world-taobao-com.translate.goog/?_x_tr_sl=auto&_x_tr_tl=ko&_x_tr_hl=en-US&_x_tr_pto=wapp -- Wil |