From a858b841186adf9b9d8aac0331e7fb59e080d70a Mon Sep 17 00:00:00 2001 From: Yasin KALKAN <yasinburakkalkan@gmail.com> Date: Wed, 4 Sep 2024 07:05:59 +0300 Subject: [PATCH] [feat] Language development. --- _locales/en/messages.json | 8 ++++++++ _locales/tr/messages.json | 8 ++++++++ content.js | 6 +----- manifest.json | 7 ++++--- 4 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 _locales/en/messages.json create mode 100644 _locales/tr/messages.json diff --git a/_locales/en/messages.json b/_locales/en/messages.json new file mode 100644 index 0000000..63a2181 --- /dev/null +++ b/_locales/en/messages.json @@ -0,0 +1,8 @@ +{ + "name": { + "message": "Youtube Popularity Score" + }, + "description": { + "message": "A plugin that rates the popularity of YouTube videos." + } +} diff --git a/_locales/tr/messages.json b/_locales/tr/messages.json new file mode 100644 index 0000000..141a8dd --- /dev/null +++ b/_locales/tr/messages.json @@ -0,0 +1,8 @@ +{ + "name": { + "message": "Youtube Popularity Score" + }, + "description": { + "message": "YouTube videolarının popülerliğini derecelendiren bir eklenti." + } +} diff --git a/content.js b/content.js index a0f3453..6250d5e 100644 --- a/content.js +++ b/content.js @@ -227,7 +227,7 @@ const popularVideoDetect = { const videoElements = document.querySelectorAll("ytd-rich-item-renderer"); videoElements.forEach((videoElement) => { - if (videoElement.getAttribute("data-processed")) return; + if (videoElement.getAttribute("data-processed") || !videoElement) return; const hasElement = popularVideoDetect.tools.isNotEmptyElement(videoElement); @@ -235,10 +235,6 @@ const popularVideoDetect = { if (hasElement) { const info = popularVideoDetect.getVideoInfo(videoElement); - if (!info.uploadDate?.date) { - console.log("info: ", info); - } - const popularityScore = popularVideoDetect.tools.calculatePopularityScore( info.uploadDate.date, diff --git a/manifest.json b/manifest.json index 3d91423..b572aca 100644 --- a/manifest.json +++ b/manifest.json @@ -1,8 +1,9 @@ { "manifest_version": 3, - "name": "Youtube Popularity Score", - "description": "A plugin that rates the popularity of YouTube videos.", - "version": "0.0.2", + "name": "__MSG_name__", + "description": "__MSG_description__", + "version": "0.1.2", + "default_locale": "tr", "background": { "service_worker": "background.js" },