This repository was archived by the owner on Sep 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontent.js
More file actions
19 lines (13 loc) · 1.4 KB
/
content.js
File metadata and controls
19 lines (13 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$(function () {
var DeepLButtonDiv = '<div class="MuiGrid-root MuiGrid-item"><button class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary" tabindex="0" type="button" id="DeepLButton"><span class="MuiButton-label"><span class="MuiButton-startIcon MuiButton-iconSizeMedium"><svg class="MuiSvgIcon-root" focusable="false" viewBox="0 0 24 24" aria-hidden="true"><path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path></svg></span>TRANSLATE WITH DEEPL TRANSLATOR</span><span class="MuiTouchRipple-root"></span></button></div>';
var DeepLButtonSelector = "#root > div > div.MuiBox-root.jss125 > div > div > div.MuiGrid-root.MuiGrid-container.MuiGrid-spacing-xs-2.MuiGrid-justify-xs-center";
var OutputTextSelector = "#root > div > div.MuiBox-root.jss125 > div > div > div.MuiBox-root.jss259 > div > div:nth-child(2) > div > div > textarea";
$(DeepLButtonSelector).append(DeepLButtonDiv);
$("#DeepLButton").click(function () {
var OutputText = $(OutputTextSelector).val();
console.log(OutputText);
window.open(
`https://www.deepl.com/translator#en/ja/${OutputText}`
);
})
});