fix error and add new search engine

pull/375/head
jingjingxyk 2 years ago
parent 03e75b905c
commit 347137f597

@ -6,8 +6,9 @@ let goToSearchPronounce = (word) => {
let search_engine_name = "gotToGoogleSearch";
// search_engine_name='gotToYouDaoSearch'
// search_engine_name = "goToBingDictSearch";
//search_engine_name = "goToBingSearch";
// search_engine_name = "goToBingSearch";
search_engine_name = "gotToYouDaoSearch";
// search_engine_name = "goToBaiduFanYiSearch";
let tab = "current_tab";
let opener = components.getSearchEngineOpener();

@ -43,6 +43,8 @@ let getIframe = () => {
"id",
"chinese-programmer-wrong-pronunciation-custom-iframe"
);
iframe.setAttribute("security", "restricted");
//iframe.setAttribute('sandbox',"")
aside.appendChild(iframe);
custom_box.appendChild(aside);
document.body.appendChild(custom_box);

@ -15,7 +15,11 @@ let goToBingSearch = (word) => {
return `https://cn.bing.com/search?q=how%20to%20pronounce%20${word}`;
};
let goToBaiduDictSearch = (word) => {
return ` https://dict.baidu.com/s?wd=${word}`;
return `https://dict.baidu.com/s?wd=${word}`;
};
let goToBaiduFanYiSearch = (word) => {
return `https://fanyi.baidu.com/#en/zh/${word}`;
};
let goToBaiDuHanYu = () => {
@ -36,4 +40,5 @@ export {
goToBingDictSearch,
goToBingSearch,
goToBaiduDictSearch,
goToBaiduFanYiSearch,
};

@ -100,5 +100,5 @@ export {
getParameterValue,
sleep,
getMediaDevices,
createJsonFile,
createJSONFile,
};

@ -24,7 +24,8 @@
"*://www.bing.com/*",
"*://dict.baidu.com/*",
"*://www.youdao.com/*",
"*://dict.youdao.com/*"
"*://dict.youdao.com/*",
"*://fanyi.baidu.com/*"
],
"web_accessible_resources": [
{

@ -43,7 +43,12 @@
"githubusercontent.com",
"www.google.com",
"cn.bing.com",
"www.bing.com"
"www.bing.com",
"fanyi.baidu.com",
"dict.baidu.com",
"www.youdao.com",
"dict.youdao.com",
"fanyi.baidu.com"
],
"resourceTypes": [
"main_frame",

Loading…
Cancel
Save