From 3985ade64337ee2901f4f608ebe6cdc3d5f0c0bb Mon Sep 17 00:00:00 2001 From: starknt <1431880400@qq.com> Date: Fri, 12 Jan 2024 23:57:27 +0800 Subject: [PATCH 01/23] fix: `global Speed` conflict --- src/contentScripts/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/contentScripts/index.ts b/src/contentScripts/index.ts index 0c2f9440..ca65c46f 100644 --- a/src/contentScripts/index.ts +++ b/src/contentScripts/index.ts @@ -138,7 +138,9 @@ function injectApp() { container.id = 'bewly' const root = document.createElement('div') const styleEl = document.createElement('link') - const shadowDOM = container.attachShadow?.({ mode: __DEV__ ? 'open' : 'closed' }) || container + // Fix #69 https://github.com/hakadao/BewlyBewly/issues/69 + // https://medium.com/@emilio_martinez/shadow-dom-open-vs-closed-1a8cf286088a - open shadow dom + const shadowDOM = container.attachShadow?.({ mode: 'open' }) || container styleEl.setAttribute('rel', 'stylesheet') styleEl.setAttribute('href', browser.runtime.getURL('dist/contentScripts/style.css')) shadowDOM.appendChild(styleEl) From c77b8223c8a3ea3da7ebc24cbd1d6ecb43d2f0f8 Mon Sep 17 00:00:00 2001 From: starknt <1431880400@qq.com> Date: Fri, 12 Jan 2024 23:57:34 +0800 Subject: [PATCH 02/23] refactor: improve search bar component --- src/_locales/cmn-CN.yml | 1 + src/_locales/cmn-TW.yml | 1 + src/_locales/en.yml | 1 + src/_locales/jyut.yml | 1 + src/components/SearchBar/SearchBar.vue | 92 +++++++++++++------------- 5 files changed, 50 insertions(+), 46 deletions(-) diff --git a/src/_locales/cmn-CN.yml b/src/_locales/cmn-CN.yml index 21fc6fef..cb33c692 100644 --- a/src/_locales/cmn-CN.yml +++ b/src/_locales/cmn-CN.yml @@ -293,3 +293,4 @@ watch_later: search_bar: history_title: 搜索历史 clear_history: 清空搜索历史 + placeholder: 输入关键字搜索 diff --git a/src/_locales/cmn-TW.yml b/src/_locales/cmn-TW.yml index e77cc172..90588c47 100644 --- a/src/_locales/cmn-TW.yml +++ b/src/_locales/cmn-TW.yml @@ -296,3 +296,4 @@ watch_later: search_bar: history_title: 搜尋記錄 clear_history: 清除所有搜尋記錄 + placeholder: 輸入關鍵字搜尋 diff --git a/src/_locales/en.yml b/src/_locales/en.yml index be456657..f04452a5 100644 --- a/src/_locales/en.yml +++ b/src/_locales/en.yml @@ -292,3 +292,4 @@ watch_later: search_bar: history_title: Search History clear_history: Clear search history + placeholder: Enter keywords to search diff --git a/src/_locales/jyut.yml b/src/_locales/jyut.yml index f1d91580..10287ae9 100644 --- a/src/_locales/jyut.yml +++ b/src/_locales/jyut.yml @@ -296,3 +296,4 @@ watch_later: search_bar: history_title: 搜尋記錄 clear_history: 剷晒你啲搜尋記錄 + placeholder: 键入关键字搜尋 diff --git a/src/components/SearchBar/SearchBar.vue b/src/components/SearchBar/SearchBar.vue index cc7e63c5..182fa7de 100644 --- a/src/components/SearchBar/SearchBar.vue +++ b/src/components/SearchBar/SearchBar.vue @@ -1,5 +1,6 @@