Преглед на файлове

taking the chrome manifest's version

It seems to work on firefox 95 but stable compatibility is not yet confirmed. Furthermore FF is not the only browser to use the 'browser' namespace, there's also safari. A cross-compatible version is to be preferred.
AndrewUnderscore преди 3 години
родител
ревизия
559a2e8305
променени са 1 файла, в които са добавени 10 реда и са изтрити 0 реда
  1. 10 0
      Extensions/combined/popup.js

+ 10 - 0
Extensions/combined/popup.js

@@ -4,7 +4,17 @@ const config = {
   showAdvancedMessage: "Show Settings",
   hideAdvancedMessage: "Hide Settings",
   disableVoteSubmission: false,
+}
+
+ function initConfig() {
+  initializeVersionNumber();
+  }
 
+ function initializeVersionNumber() {
+  const version = chrome.runtime.getManifest().version;
+  document.getElementById('ext-version').innerHTML = 'v' + version;
+}
+  
   links: {
     website: "https://returnyoutubedislike.com",
     github: "https://github.com/Anarios/return-youtube-dislike",