FB - Clean my feeds

Hide Sponsored and Suggested posts in FB's News Feed, Groups Feed, Watch Videos Feed and Marketplace Feed

当前为 2024-03-07 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name FB - Clean my feeds
  3. // @description Hide Sponsored and Suggested posts in FB's News Feed, Groups Feed, Watch Videos Feed and Marketplace Feed
  4. // @namespace https://greasyfork.org/users/812551
  5. // @supportURL https://github.com/zbluebugz/facebook-clean-my-feeds/issues
  6. // @version 4.30
  7. // @author zbluebugz (https://github.com/zbluebugz/)
  8. // @match https://www.facebook.com/*
  9. // @match https://web.facebook.com/*
  10. // @match https://facebook.com/*
  11. // @noframes
  12. // @grant GM.registerMenuCommand
  13. // @grant GM.info
  14. // @license MIT; https://opensource.org/licenses/MIT
  15. // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAB2AAAAdgB+lymcgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAanSURBVHic5ZtpjBVFEMd/u8vthsCi3OcGxQWBKJdEDEbuDypqNoGgxGgkWY8YDaIYFQ9MRCOJJ0Y80JhgVESiRpCVIAYIIAQPCEoQZCOIyuIB667IPj/8qzPzhveANzPvvX3LP5nMVHdPT1V3VVd1zQwUNroDK4A/gB3A1Pyyk1sUA18DCeBPoBH4FxiRT6ZyiXFI+C+AFsAdRj+TSSfF8fOVM0y281LgP+BwHnnJC75FM15u9BtGV+aNoxyiG7L5H3xlNUgTyjLpqFBNYDJQBKw0ejDQE9gC1GbSUaEOwCQ7r0pDN2sUA78CDUCpla1G9j86X0zlEqOQsJ8b3RaoQ6pfkmlnhWgCQXW/Ag1CNXAi086awwCcVfbfATgOHEReAGAXMone+WIql7geCbvE6F5G7wjbYaGZQFDdpwToZo99aKHrbPQypAGT0t3QnFCBhN1idAlyff8A7cJ2WkgmEFT/S4GOwDoUB4RCIQ3ARDt/ZudL7LwyRdtmhzbAMZT5aWll5wGzgfb5YiqXmIDsf3ncHReKCQTtfwDwGtA1P+zkHi7708/o142ekvaOZoQeKPvzva8sVPYnFQrBBCahuN+pf+jsTyoUygDAWbr7KwF+J4vZnxZxdJICFYQLTxvQzi5h9HCgE7AGOGp9jgGOAJujs5kd3IAECHvc7+vrYSubY/QUo9+Ni9lsrAG97LwN+NiuDwPvAVuN/s7oA0avBjbatdvpQYHa/1w0S1Xo7W0CT7hZRj9o9IdGX4yX7FhodTnJ/jRlLzAerVGrkNC9UAS4A9gf10Oa8gDkJPvTlAdgIooAXf4/K/YflxssBc5HA9rdynoDQ+z6HGAYnu12N7qD0RUo5AXoAlxtbb9Cb4FaAFeidFid3XschccNMckQGpXIR0dxfemO+faMy9LUH0RvikIjqga0QdvS1sBHQH3E/hzGo3RX0P1twlsAy9BXIq8AQ2N6bsa4CM1EnHaZKvuzyZ4zMNB2P1onWhISURdBp0Fx2uHlKORdg+y8E7L5GmBnoG09ihFCyxHVBH6280jgRsKbwGbgJ7sOrvbj0aaohuTPXzoCfYHfyPNC+CrRF7tdvv7SZX/SHfdEYb7o9E3OqI9K9JHidBTnf5JhH+vsXAE8DexGUV8Rmvmu6PO3BNK07sCzaK9RHY39+DAUMZip8AB3kzyrK5Dwg43e4Gu7By18baIwmw2UIWa/yfC+3iiOqAfeRsGO20AttutHrG2RtTsUnd3s4ChnlqfrjFT5MWA9EvIJqxuFIkC/Royzui5Gb6WJwm1XS9PUlyFbriNZwEa8V18gt1aF8ggJ5G3KUYYogbbRTRLViMGKFHW98AboLxTBzQJewhuEJWiWHc7Fyxk8ihbaBPBCVriPAe5z1QmB8g7Aj1a3DAnm0Bt98Oy04QhwJ/L9RXgmMsPKE8B9WZMgIh5HDN4cKH8e792e+5StL/IY6fz7duApu95m9y3AG4xYEHdWuMbOPX1lA4Bb0QJ5O1rlxyIfXorc2jIkJGjnNw251aHoDdBtdp/LN7rnNDm4rO1io8fiqb6L2AaiPzwSSGNap+hnttXvRKGww5dWXp7inryhGH28vAjvD46jaKFz6vwmnrY5tZ+Xoq9StBdwqv9+oH4vWixTDVpeMA5vZQ8etSjEnYYXco+wut0km18nZN/HAn34w9xi9EvML9kRJXPMRbORANYCM4E+QKs07VuhAUkAN/nKL0T7eqc5y/G8yQe+dt2sbAtNAC52/5tT/6FRhgSsxEtqbMWb/XKU80ugMNjFADM42d+PxPMkecUwpIp1nJyPKwKuRTPnojj/sZHkNz/uReeLJO9MX7bymb6y66zsuZjkCI2VxkhVoHwQml0nbB3a269GMzmVZCHddz970dfeDm1RMOQixlo73Ppwb6zSZIh+xsQekhexCXgMrgeu4tQr9RiU0U1YWz/m4Q1gre9osPLpUYWIgipj4klf2RDEbCPwAMn5ueHI17+FNKEaeQCnJQtJxnD05Wc9cEGg7lO7Z0wMcoSGy8q4ha8EL4U1x9duLMoLpHKPjSheCIazg9A+P4EW2SC2W13f6GKEh0tQuK2rW63X4tn3Ajz3uAFtYEYD/dGq77d3kMbcgvdyZVGaZx9C4XDoFHgcuAsxudQYcWrpdn/zjT4MXHOavvqj312dBp1AW95UecqWVn8gRV0kZJoUbY9Uuw+KAdohM9hHcia3FsX7qdAK+fvgTNaTXsBipPqbifgqLA70AN5B+fhTpavjPhqBh+IW5n827DI9G+eQwwAAAABJRU5ErkJggg==
  16. // @icon64 data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAB2AAAAdgB+lymcgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAanSURBVHic5ZtpjBVFEMd/u8vthsCi3OcGxQWBKJdEDEbuDypqNoGgxGgkWY8YDaIYFQ9MRCOJJ0Y80JhgVESiRpCVIAYIIAQPCEoQZCOIyuIB667IPj/8qzPzhveANzPvvX3LP5nMVHdPT1V3VVd1zQwUNroDK4A/gB3A1Pyyk1sUA18DCeBPoBH4FxiRT6ZyiXFI+C+AFsAdRj+TSSfF8fOVM0y281LgP+BwHnnJC75FM15u9BtGV+aNoxyiG7L5H3xlNUgTyjLpqFBNYDJQBKw0ejDQE9gC1GbSUaEOwCQ7r0pDN2sUA78CDUCpla1G9j86X0zlEqOQsJ8b3RaoQ6pfkmlnhWgCQXW/Ag1CNXAi086awwCcVfbfATgOHEReAGAXMone+WIql7geCbvE6F5G7wjbYaGZQFDdpwToZo99aKHrbPQypAGT0t3QnFCBhN1idAlyff8A7cJ2WkgmEFT/S4GOwDoUB4RCIQ3ARDt/ZudL7LwyRdtmhzbAMZT5aWll5wGzgfb5YiqXmIDsf3ncHReKCQTtfwDwGtA1P+zkHi7708/o142ekvaOZoQeKPvzva8sVPYnFQrBBCahuN+pf+jsTyoUygDAWbr7KwF+J4vZnxZxdJICFYQLTxvQzi5h9HCgE7AGOGp9jgGOAJujs5kd3IAECHvc7+vrYSubY/QUo9+Ni9lsrAG97LwN+NiuDwPvAVuN/s7oA0avBjbatdvpQYHa/1w0S1Xo7W0CT7hZRj9o9IdGX4yX7FhodTnJ/jRlLzAerVGrkNC9UAS4A9gf10Oa8gDkJPvTlAdgIooAXf4/K/YflxssBc5HA9rdynoDQ+z6HGAYnu12N7qD0RUo5AXoAlxtbb9Cb4FaAFeidFid3XschccNMckQGpXIR0dxfemO+faMy9LUH0RvikIjqga0QdvS1sBHQH3E/hzGo3RX0P1twlsAy9BXIq8AQ2N6bsa4CM1EnHaZKvuzyZ4zMNB2P1onWhISURdBp0Fx2uHlKORdg+y8E7L5GmBnoG09ihFCyxHVBH6280jgRsKbwGbgJ7sOrvbj0aaohuTPXzoCfYHfyPNC+CrRF7tdvv7SZX/SHfdEYb7o9E3OqI9K9JHidBTnf5JhH+vsXAE8DexGUV8Rmvmu6PO3BNK07sCzaK9RHY39+DAUMZip8AB3kzyrK5Dwg43e4Gu7By18baIwmw2UIWa/yfC+3iiOqAfeRsGO20AttutHrG2RtTsUnd3s4ChnlqfrjFT5MWA9EvIJqxuFIkC/Royzui5Gb6WJwm1XS9PUlyFbriNZwEa8V18gt1aF8ggJ5G3KUYYogbbRTRLViMGKFHW98AboLxTBzQJewhuEJWiWHc7Fyxk8ihbaBPBCVriPAe5z1QmB8g7Aj1a3DAnm0Bt98Oy04QhwJ/L9RXgmMsPKE8B9WZMgIh5HDN4cKH8e792e+5StL/IY6fz7duApu95m9y3AG4xYEHdWuMbOPX1lA4Bb0QJ5O1rlxyIfXorc2jIkJGjnNw251aHoDdBtdp/LN7rnNDm4rO1io8fiqb6L2AaiPzwSSGNap+hnttXvRKGww5dWXp7inryhGH28vAjvD46jaKFz6vwmnrY5tZ+Xoq9StBdwqv9+oH4vWixTDVpeMA5vZQ8etSjEnYYXco+wut0km18nZN/HAn34w9xi9EvML9kRJXPMRbORANYCM4E+QKs07VuhAUkAN/nKL0T7eqc5y/G8yQe+dt2sbAtNAC52/5tT/6FRhgSsxEtqbMWb/XKU80ugMNjFADM42d+PxPMkecUwpIp1nJyPKwKuRTPnojj/sZHkNz/uReeLJO9MX7bymb6y66zsuZjkCI2VxkhVoHwQml0nbB3a269GMzmVZCHddz970dfeDm1RMOQixlo73Ppwb6zSZIh+xsQekhexCXgMrgeu4tQr9RiU0U1YWz/m4Q1gre9osPLpUYWIgipj4klf2RDEbCPwAMn5ueHI17+FNKEaeQCnJQtJxnD05Wc9cEGg7lO7Z0wMcoSGy8q4ha8EL4U1x9duLMoLpHKPjSheCIazg9A+P4EW2SC2W13f6GKEh0tQuK2rW63X4tn3Ajz3uAFtYEYD/dGq77d3kMbcgvdyZVGaZx9C4XDoFHgcuAsxudQYcWrpdn/zjT4MXHOavvqj312dBp1AW95UecqWVn8gRV0kZJoUbY9Uuw+KAdohM9hHcia3FsX7qdAK+fvgTNaTXsBipPqbifgqLA70AN5B+fhTpavjPhqBh+IW5n827DI9G+eQwwAAAABJRU5ErkJggg==
  17. // @run-at document-start
  18. // ==/UserScript==
  19. /*
  20.  
  21. :: Tip ::
  22. This userscript does not block video ads (begin-roll, mid-roll, end-roll), however there's a work-around:
  23. 1) Install uBlock Origin (uBO) in your browser(s)
  24. 2) In uBO, goto "My filters" tab and paste in the following rule: facebook.com##+js(set, Object.prototype.scrubber, undefined)
  25. Note: I have not tested this in other content/ad-blockers.
  26.  
  27. v4.30 :: March 2024
  28. Hot fix
  29. Updated Marketplace feed detection component
  30.  
  31. v4.29 :: February 2024
  32. !!! Hot fix !!!
  33. Issues with FB, Adblockers and FB-CMF - all clashing
  34. Adjusted News Feed's query rules
  35. Temporarily disabled News Feed's message/notification tab (will be restored in next version)
  36.  
  37. v4.28 :: January 2024
  38. Enabled option to toggle Sponsored post detection rule (for uBO compatibility)
  39. Added Video's "Live" detection rule
  40. Enabled Reels' video controls
  41. Added Ukrainian (Україна)
  42. Added Bulgarian (български)
  43. Dialog box - reworded "Miscellaneous items" to "Supplementary / information section"
  44. Dialog box - added "Reset" button to reset the options
  45. Fixed bug with Survey detection component
  46. Fixed bug with Importing settings from a file
  47. Revised message/notification tab for News feed
  48. Revised Create Stories detection rule
  49. Add option to filter posts by number of Likes
  50. Fixed bug with function scanTreeForText() - failing to detect "Anonymous participant"
  51. Updated Groups Feed filter rules - new HTML structure via (Feeds > Groups)
  52. Added display of script's version number to dialog box
  53.  
  54. v4.27 :: December 2023
  55. Added Russian (Русский) - supplied by github user Kenya-West
  56. v4.26 :: November 2023
  57. Added web.facebook.com to @match conditions
  58. Added Survey detection component (Home / News feed)
  59. Added Follow detection component (Home / News feed)
  60. Added Participate detection component (Home / News feed)
  61. Updated Marketplace detection rules
  62. v4.25 :: November 2023
  63. Added extra filter rule for nf_isSuggested() (for "Suggested for you" posts) - fix supplied by opello (via github)
  64. Added News Feed's Stories post detection rule.
  65. Revised function scanTreeForText() to include other elements for scanning
  66. Fixed bug with Marketplace prices' filter
  67. Reduce possible conflicts with uBlock Origin / other adblockers
  68. Code tweaks
  69. v4.24 :: September 2023
  70. Fixed issues with v4.23 (selection/detection rules)
  71. Code tweaks
  72. v4.23 :: August 2023
  73. Fixed bug with showing Marketplace's hidden items
  74. Updated Marketplace detection rules
  75. Split Marketplace's text filter into two - prices and description
  76. Merged "Stories" with "Stories | Reels | Rooms" detection rules.
  77. Fixed bug with CMF's hidden dialog box's text being included in CTRL+F search (now excluded)
  78. Dropped "Create room" detection component (no longer listed in FB)
  79. v4.22 :: July 2023
  80. Updated News Feed posts selection rule (FB changed structure)
  81. Updated Events you may like detection rule
  82. v4.21 :: June 2023
  83. Updated news feed detection rules - for older HTML structures
  84. Updated watch videos feed detection rules
  85. Added Greek (Ελληνικά)
  86. Updated various functions
  87. v4.20 :: May 2023
  88. Added "Feeds (most recent)" to the clean up rules (FB recently introduced the "Feeds (most recent)" feature)
  89. Updated Search Feed sponsored posts rule
  90. v4.19 :: May 2023
  91. Updated News Feed posts selection rule (FB changed structure)
  92. v4.18 :: May 2023
  93. Updated News Feed sponsored posts rule
  94. Added News Feed sponsored video posts rule
  95. Updated News Feed suggested posts rule
  96. v4.17 :: March 2023
  97. Fixed issue with GreaseMonkey & FireMonkey not able to run userscript
  98. Updated News Feed sponsored posts rule
  99. Updated Videos Feed sponsored posts rule
  100. Added option to hide "# shares" on posts (news + groups)
  101. v4.16 :: February 2023
  102. Fixed issue with <no message> setting breaking FB
  103. Code tweaks
  104. v4.15 :: February 2023
  105. Updated News Feed sponsored posts rule (FB changed structure)
  106. Updated Marketplace Feed > Item page posts rules
  107. Code tweaks
  108. v4.14 :: January 2023
  109. Updated News Feed Suggestion/Recommendation posts rule (FB changed structure)
  110. Updated News Feed verbosity behaviour. FB limits 40 posts in News Feed. Show either no notification or 1 post hidden. 2+ posts hidden notification disabled.
  111. Groups Feed posts - added icon to open post in new window (fix annoying FB bug with not showing comments properly)
  112.  
  113. Attribution: Mop & Bucket icon:
  114. - made by Freepik (https://www.freepik.com) @ flaticon (https://www.flaticon.com/)
  115. - page: https://www.flaticon.com/premium-icon/mop_2383747
  116.  
  117.  
  118. Instructions on how to use:
  119. - In FB, top right corner or bottom left corner, click on the "Clean my feeds" icon (mop + bucket)
  120. - Alternatively, click on the script manager icon in the menu bar and select "Settings" under FB - Clean my feeds
  121. - Toggle the various options
  122. - Click Save then Close.
  123. - It is recommended that you Export your settings every now and then.
  124. (When your browser flushes the cache, your settings are deleted).
  125.  
  126. Known issue(s):
  127. - Settings are not saved in Private/Incognito mode when using Firefox.
  128. - For Chrome/Edge, in Private/Incognito mode, settings are retained until browser is closed.
  129.  
  130. \\\ --- No need to amend any of the code below --- ///
  131. */
  132.  
  133. (async function () {
  134.  
  135. 'use strict';
  136.  
  137. const SCRIPT_VERSION = 'v4.29'; // TM doesn't like spaces in version number ...
  138.  
  139. // Due to a GreaseMonkey bug with @require, we've copied an external script into here.
  140. // @require https://unpkg.com/idb-keyval@6.0.3/dist/umd.js
  141. function _typeof(n) { return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (n) { return typeof n } : function (n) { return n && "function" == typeof Symbol && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n })(n) } !function (n, t) { "object" === ("undefined" == typeof exports ? "undefined" : _typeof(exports)) && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define(["exports"], t) : t((n = "undefined" != typeof globalThis ? globalThis : n || self).idbKeyval = {}) }(this, (function (n) { "use strict"; function t(n) { return new Promise((function (t, e) { n.oncomplete = n.onsuccess = function () { return t(n.result) }, n.onabort = n.onerror = function () { return e(n.error) } })) } function e(n, e) { var r, o = (!navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise((function (n) { var t = function () { return indexedDB.databases().finally(n) }; r = setInterval(t, 100), t() })).finally((function () { return clearInterval(r) })) : Promise.resolve()).then((function () { var r = indexedDB.open(n); return r.onupgradeneeded = function () { return r.result.createObjectStore(e) }, t(r) })); return function (n, t) { return o.then((function (r) { return t(r.transaction(e, n).objectStore(e)) })) } } var r; function o() { return r || (r = e("keyval-store", "keyval")), r } function u(n, e) { return n("readonly", (function (n) { return n.openCursor().onsuccess = function () { this.result && (e(this.result), this.result.continue()) }, t(n.transaction) })) } n.clear = function () { var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : o(); return n("readwrite", (function (n) { return n.clear(), t(n.transaction) })) }, n.createStore = e, n.del = function (n) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : o(); return e("readwrite", (function (e) { return e.delete(n), t(e.transaction) })) }, n.delMany = function (n) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : o(); return e("readwrite", (function (e) { return n.forEach((function (n) { return e.delete(n) })), t(e.transaction) })) }, n.entries = function () { var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : o(), t = []; return u(n, (function (n) { return t.push([n.key, n.value]) })).then((function () { return t })) }, n.get = function (n) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : o(); return e("readonly", (function (e) { return t(e.get(n)) })) }, n.getMany = function (n) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : o(); return e("readonly", (function (e) { return Promise.all(n.map((function (n) { return t(e.get(n)) }))) })) }, n.keys = function () { var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : o(), t = []; return u(n, (function (n) { return t.push(n.key) })).then((function () { return t })) }, n.promisifyRequest = t, n.set = function (n, e) { var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : o(); return r("readwrite", (function (r) { return r.put(e, n), t(r.transaction) })) }, n.setMany = function (n) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : o(); return e("readwrite", (function (e) { return n.forEach((function (n) { return e.put(n[1], n[0]) })), t(e.transaction) })) }, n.update = function (n, e) { var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : o(); return r("readwrite", (function (r) { return new Promise((function (o, u) { r.get(n).onsuccess = function () { try { r.put(e(this.result), n), o(t(r.transaction)) } catch (n) { u(n) } } })) })) }, n.values = function () { var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : o(), t = []; return u(n, (function (n) { return t.push(n.value) })).then((function () { return t })) }, Object.defineProperty(n, "__esModule", { value: !0 }) }));
  142.  
  143. // *** *** Language components *** ***
  144. const KeyWords = {
  145. // *** Which languages have been setup (for dialog box)
  146. // -- not used as keywords for detection of anything
  147.  
  148. // - 'en' is default.
  149. LANGUAGES: [
  150. 'en', // English
  151. 'pt', // Português (Portugal and Brazil)
  152. 'de', // Deutsch (Germany)
  153. 'fr', // Français (France)
  154. 'es', // Espanol (Spain)
  155. 'cs', // Čeština (Czechia)
  156. 'vi', // Tiếng Việt (Vietnam)
  157. 'it', // Italino (Italy)
  158. 'lv', // Latviešu (Latvia)
  159. 'pl', // Polski (Poland)
  160. 'nl', // Nederlands (Netherlands)
  161. 'he', // עִברִית (Hebrew)
  162. 'ar', // العربية (Arabic)
  163. 'id', // Bahasa Indonesia (Indonesia)
  164. 'zh-Hans', // Chinese (Simplified)
  165. 'zh-Hant', // Chinese (Traditional)
  166. 'ja', // Japanese (Japan)
  167. 'fi', // Suomi - Finnish (Finland)
  168. 'tr', // Türkçe (Turkey)
  169. 'el', // Ελληνικά (Greece)
  170. 'ru', // Русский (Russia)
  171. 'uk', // Україна (Ukraine)
  172. 'bg', // България (Bulgaria)
  173. ],
  174.  
  175. // *** sample Object setup:
  176. // _VARIABLE_NAME_: {
  177. // 'en': '',
  178. // 'pt': '',
  179. // 'de': '',
  180. // 'fr': '',
  181. // 'es': '',
  182. // 'cs': '',
  183. // 'vi': '',
  184. // 'it': '',
  185. // 'lv': '',
  186. // 'pl': '',
  187. // 'nl': '',
  188. // 'he': '',
  189. // 'ar': '',
  190. // 'id': '',
  191. // 'zh-Hans': '',
  192. // 'zh-Hant': '',
  193. // 'ja': '',
  194. // 'fi': '',
  195. // 'tr': '',
  196. // 'el': '',
  197. // 'ru': '',
  198. // 'uk': '',
  199. // 'bg': '',
  200. // },
  201.  
  202.  
  203. // - Sponsored
  204. SPONSORED: {
  205. 'en': 'Sponsored',
  206. 'pt': 'Patrocinado',
  207. 'de': 'Gesponsert',
  208. 'fr': 'Sponsorisé',
  209. 'es': 'Publicidad',
  210. 'cs': 'Sponzorováno',
  211. 'vi': 'Được tài trợ',
  212. 'it': 'Sponsorizzato',
  213. 'lv': 'Apmaksāta reklāma',
  214. 'pl': 'Sponsorowane',
  215. 'nl': 'Gesponsord',
  216. 'he': 'ממומן',
  217. 'ar': 'مُموَّل',
  218. 'id': 'Bersponsor',
  219. 'zh-Hans': '赞助内容',
  220. 'zh-Hant': '贊助',
  221. 'ja': '広告',
  222. 'fi': 'Sponsoroitu',
  223. 'tr': 'Sponsorlu',
  224. 'el': 'Χορηγούμενη',
  225. 'ru': 'Реклама',
  226. 'uk': 'Спонсорована',
  227. 'bg': 'Спонсорирано',
  228. 'defaultEnabled': true
  229. },
  230.  
  231. // *** News Feed ::
  232.  
  233. // - "Stories | Reels | Rooms" tablist box
  234. // -- includes the standalone Stories component
  235. NF_TABLIST_STORIES_REELS_ROOMS: {
  236. 'en': '"Stories | Reels | Rooms" tabs list box',
  237. 'pt': 'Caixa de listagem da guia "Stories | Vídeos do Reels | Salas"',
  238. 'de': 'Listenfeld der Registerkarte "Stories | Reels | Rooms"',
  239. 'fr': 'Zone de liste de l\'onglet "Stories | Reels | Salons"',
  240. 'es': 'Cuadro de lista de la pestaña "Historias | Reels | Salas"',
  241. 'cs': 'Seznam karet "Stories | Reels | Místnosti"',
  242. 'vi': 'Hộp danh sách tab "Tin | Reels | Phòng họp mặt"',
  243. 'it': 'Casella di riepilogo della scheda "Storie | Reels | Stanze"',
  244. 'lv': 'Cilnes "Stāsti | Video rullīši | Rooms" sarakstlodziņš',
  245. 'pl': 'Pole listy zakładki "Relacje | Reels | Pokoje"',
  246. 'nl': 'Keuzelijst tabblad "Verhalen | Reels | Ruimtes"',
  247. 'he': 'תיבת רשימה של כרטיסיות "סטוריז | Reels | חדרים"',
  248. 'ar': '"القصص | ريلز | الغرف" مربع قائمة علامات تبويب',
  249. 'id': 'Kotak daftar tab "Cerita | Reels | Forum"',
  250. 'zh-Hans': '“快拍|Reels|畅聊室”选项卡列表框',
  251. 'zh-Hant': '"限時動態 | Reels | 包廂" 分頁列表框',
  252. 'ja': '「Stories | Reels | Rooms」タブのリストボックス',
  253. 'fi': '"Tarinat | Reels | Rooms" -välilehtien luetteloruutu',
  254. 'tr': '"Hikayeler | Makaralar | Odalar" sekmeleri liste kutusu',
  255. 'el': 'Λίστα καρτελών "Ιστορίες | Reels | Δωμάτια"',
  256. 'ru': 'Список вкладок "Истории | Reels | Комнаты"',
  257. 'uk': 'Поле списку вкладок «Історії | Reels | Кімнати»',
  258. 'bg': 'Списъчно поле на раздела „Истории | Макари | Стаи“',
  259. 'defaultEnabled': false
  260. },
  261. // - "Stories" posts (separate from tablist, in News Feed stream)
  262. NF_STORIES: {
  263. 'en': 'Stories',
  264. 'pt': 'Stories',
  265. 'de': 'Stories',
  266. 'fr': 'Stories',
  267. 'es': 'Historias',
  268. 'cs': 'Stories',
  269. 'vi': 'Tin',
  270. 'it': 'Storie',
  271. 'lv': 'Stāsti',
  272. 'pl': 'Relacje',
  273. 'nl': 'Verhalen',
  274. 'he': 'סטוריז ',
  275. 'ar': 'القصص',
  276. 'id': 'Cerita',
  277. 'zh-Hans': '故事',
  278. 'zh-Hant': '故事',
  279. 'ja': 'Stories',
  280. 'fi': 'Tarinat',
  281. 'tr': 'Hikayeler',
  282. 'el': 'Ιστορίες',
  283. 'ru': 'Истории',
  284. 'uk': 'Історії',
  285. 'bg': 'Истории',
  286. 'defaultEnabled': false
  287. },
  288. // - fb's survey
  289. // - <name>, we're asking a small group of people for their opinion
  290. // - could you take a few minutes to answer a short survey? <button>start survey</button>
  291. NF_SURVEY: {
  292. 'en': 'Survey',
  293. 'pt': 'Enquete',
  294. 'de': 'Umfrage',
  295. 'fr': 'Enquête',
  296. 'es': 'Encuesta',
  297. 'cs': 'Průzkum',
  298. 'vi': 'Khảo sát',
  299. 'it': 'Sondaggio',
  300. 'lv': 'Aptauja',
  301. 'pl': 'Badanie',
  302. 'nl': 'Vragenlijst',
  303. 'he': 'סקר',
  304. 'ar': 'استبيان',
  305. 'id': 'Survei',
  306. 'zh-Hans': '调查',
  307. 'zh-Hant': '調查',
  308. 'ja': 'アンケート',
  309. 'fi': 'Kysely',
  310. 'tr': 'Anket',
  311. 'el': 'Τοπογράφηση',
  312. 'ru': 'Опрос',
  313. 'uk': 'Опитування',
  314. 'bg': 'Анкета',
  315. 'defaultEnabled': false
  316. },
  317.  
  318. // - People you may know:
  319. NF_PEOPLE_YOU_MAY_KNOW: {
  320. 'en': 'People you may know',
  321. 'pt': 'Pessoas que talvez conheças',
  322. 'de': 'Personen, die du kennen könntest',
  323. 'fr': 'Connaissez-vous...',
  324. 'es': 'Personas que quizá conozcas',
  325. 'cs': 'Koho možná znáte',
  326. 'vi': 'Những người bạn có thể biết',
  327. 'it': 'Persone che potresti conoscere',
  328. 'lv': 'Cilvēki, kurus tu varētu pazīt',
  329. 'pl': 'Osoby, które możesz znać',
  330. 'nl': 'Mensen die je misschien kent',
  331. 'he': 'אנשים שאולי אתה מכיר',
  332. 'ar': 'أشخاص قد تعرفهم',
  333. 'id': 'Orang yang Mungkin Anda Kenal',
  334. 'zh-Hans': '你可能认识的人',
  335. 'zh-Hant': '你可能認識的人',
  336. 'ja': 'あなたが知っているかもしれない人々',
  337. 'fi': 'Ihmiset, jotka saatat tuntea',
  338. 'tr': 'Tanıyor olabileceğin kişiler',
  339. 'el': 'Άτομα που ίσως γνωρίζετε',
  340. 'ru': 'Люди, которых вы можете знать',
  341. 'uk': 'Люди, яких Ви можете знати',
  342. 'bg': 'Хора, които може би познавате',
  343. 'defaultEnabled': false
  344. },
  345.  
  346. // - Paid partnership:
  347. // - page you follow is "sponsoring" another page's post (e.g. job)
  348. NF_PAID_PARTNERSHIP: {
  349. 'en': 'Paid partnership',
  350. 'pt': 'Parceria paga',
  351. 'de': 'Bezahlte Werbepartnerschaft',
  352. 'fr': 'Partenariat rémunéré',
  353. 'es': 'Colaboración pagada',
  354. 'cs': 'Placené partnerství',
  355. 'vi': 'Mối quan hệ tài trợ',
  356. 'it': 'Partnership pubblicizzata',
  357. 'lv': 'Apmaksāta sadarbība',
  358. 'pl': 'Post sponsorowany',
  359. 'nl': 'Betaald partnerschap',
  360. 'he': 'שותפות בתשלום',
  361. 'ar': 'شراكة مدفوعة',
  362. 'id': 'Kemitraan berbayar',
  363. 'zh-Hans': '付费合伙',
  364. 'zh-Hant': '付費合作',
  365. 'ja': '有償パートナーシップ',
  366. 'fi': 'Maksettu kumppanuus',
  367. 'tr': 'ücretli ortaklık',
  368. 'el': 'Πληρωμένη συνεργασία',
  369. 'ru': 'Платное партнерство',
  370. 'uk': 'Оплачуване партнерство',
  371. 'bg': 'Платено партньорство',
  372. 'defaultEnabled': true
  373. },
  374.  
  375. // - Sponsored · Paid for by ______ :
  376. // - (paid advertising)
  377. NF_SPONSORED_PAID: {
  378. 'en': 'Sponsored · Paid for by ______',
  379. 'pt': 'Patrocinado · Financiado por ______',
  380. 'de': 'Gesponsert · Finanziert von ______',
  381. 'fr': 'Sponsorisé · Financé par ______',
  382. 'es': 'Publicidad · Pagado por ______',
  383. 'cs': 'Sponzorováno · Platí za to ______',
  384. 'vi': 'Được tài trợ · Tài trợ bởi ______',
  385. 'it': 'Sponsorizzato · Finanziato da ______',
  386. 'lv': 'Apmaksāta reklāma · Apmaksā ______',
  387. 'pl': 'Sponsorowane · Opłacona przez ______',
  388. 'nl': 'Gesponsord · Betaald door ______',
  389. 'he': 'ממומן · שולם על ידי ______',
  390. 'ar': 'برعاية · مدفوعة بواسطة ______',
  391. 'id': 'Disponsori · Dibayar oleh ______',
  392. 'zh-Hans': '赞助 · 由 ______ 付费',
  393. 'zh-Hant': '贊助 · 出資者:______',
  394. 'ja': '後援 · ______ による支払い',
  395. 'fi': 'Sponsoroitu · Maksaja ______',
  396. 'tr': 'Sponsorlu · ______ tarafından ödendi',
  397. 'el': 'Χορηγούμενο · Πληρωμένο από ______',
  398. 'ru': 'Реклама · Оплачено ______',
  399. 'uk': 'Спонсоровано · Оплачено ______',
  400. 'bg': 'Спонсорирано · Платено от ______',
  401. 'defaultEnabled': true
  402. },
  403.  
  404. // - Various Suggested/recommendations type posts
  405. NF_SUGGESTIONS: {
  406. 'en': 'Suggestions / Recommendations',
  407. 'pt': 'Sugestões / Recomendações',
  408. 'de': 'Vorschläge / Empfehlungen',
  409. 'fr': 'Suggestions / Recommandations',
  410. 'es': 'Sugerencias / Recomendaciones',
  411. 'cs': 'Návrhy / Doporučení',
  412. 'vi': 'Đề xuất / Khuyến nghị',
  413. 'it': 'Suggerimenti / Raccomandazioni',
  414. 'lv': 'Ieteikumi',
  415. 'pl': 'Sugestie / Zalecenia',
  416. 'nl': 'Suggesties / Aanbevelingen',
  417. 'he': 'הצעות / המלצות',
  418. 'ar': 'الاقتراحات / التوصيات',
  419. 'id': 'Saran / Rekomendasi',
  420. 'zh-Hans': '建议',
  421. 'zh-Hant': '建議/推薦',
  422. 'ja': '提案/推奨事項',
  423. 'fi': 'Ehdotuksia / Suosituksia',
  424. 'tr': 'Öneriler',
  425. 'el': 'Προτάσεις / Συστάσεις',
  426. 'ru': 'Предложения / Рекомендации',
  427. 'uk': 'Пропозиції / Рекомендації',
  428. 'bg': 'Предложения / Препоръки',
  429. 'defaultEnabled': false
  430. },
  431.  
  432. // - Follow
  433. NF_FOLLOW: {
  434. 'en': 'Follow',
  435. 'pt': 'Seguir',
  436. 'de': 'Folgen',
  437. 'fr': 'Suivre',
  438. 'es': 'Seguir',
  439. 'cs': 'Sledovat',
  440. 'vi': 'Theo dõi',
  441. 'it': 'Segui',
  442. 'lv': 'Sekot',
  443. 'pl': 'Obserwuj',
  444. 'nl': 'Volgen',
  445. 'he': 'עקוב',
  446. 'ar': 'تابع',
  447. 'id': 'Ikuti',
  448. 'zh-Hans': '关注',
  449. 'zh-Hant': '追蹤',
  450. 'ja': 'フォロー',
  451. 'fi': 'Seuraa',
  452. 'tr': 'Takip Et',
  453. 'el': 'Ακολούθησε',
  454. 'ru': 'Подписаться',
  455. 'uk': 'Слідуйте',
  456. 'bg': 'Следвай',
  457. 'defaultEnabled': false
  458. },
  459.  
  460. // - Participate
  461. NF_PARTICIPATE: {
  462. 'en': 'Participate',
  463. 'pt': 'Participar',
  464. 'de': 'Teilnehmen',
  465. 'fr': 'Participer',
  466. 'es': 'Participar',
  467. 'cs': 'Participovat',
  468. 'vi': 'Tham gia',
  469. 'it': 'Partecipare',
  470. 'lv': 'Piedalīties',
  471. 'pl': 'Uczestniczyć',
  472. 'nl': 'Deelnemen',
  473. 'he': 'השתתף',
  474. 'ar': 'المشاركة',
  475. 'id': 'Berpartisipasi',
  476. 'zh-Hans': '参与',
  477. 'zh-Hant': '參與',
  478. 'ja': '参加する',
  479. 'fi': 'Osallistua',
  480. 'tr': 'Katılmak',
  481. 'el': 'Συμμετέχω',
  482. 'ru': 'Участвовать',
  483. 'uk': 'Беріть участь',
  484. 'bg': 'Участвай',
  485. 'defaultEnabled': false
  486. },
  487.  
  488. // - Reels and short videos:
  489. NF_REELS_SHORT_VIDEOS: {
  490. 'en': 'Reels and short videos',
  491. 'pt': 'Vídeos do Reels e vídeos de curta duração',
  492. 'de': 'Reels und Kurzvideos',
  493. 'fr': 'Reels et vidéos courtes',
  494. 'es': 'Reels y vídeos cortos',
  495. 'cs': 'Sekvence a krátká videa',
  496. 'vi': 'Reels và video ngắn',
  497. 'it': 'Reel e video brevi',
  498. 'lv': 'Reels un īsi videoklipi',
  499. 'pl': 'Rolki i krótkie filmy',
  500. 'nl': 'Reels en korte video\'s',
  501. 'he': 'סרטוני Reels וקטעי וידאו קצרים',
  502. 'ar': 'ريلز ومقاطع الفيديو القصيرة',
  503. 'id': 'Reels dan Video Pendek',
  504. 'zh-Hans': '卷轴和短视频',
  505. 'zh-Hant': 'Reels 和短影片',
  506. 'ja': 'リールとショート動画',
  507. 'fi': 'Keloja ja lyhyitä videoita',
  508. 'tr': 'Makaralar ve kısa videolar',
  509. 'el': 'Reel και σύντομα βίντεο',
  510. 'ru': 'Reels и короткие видео',
  511. 'uk': 'Відео Reels і короткі відео',
  512. 'bg': 'Ленти и кратки видеоклипове',
  513. 'defaultEnabled': false
  514. },
  515.  
  516. // - Reel/short video posts
  517. NF_SHORT_REEL_VIDEO: {
  518. 'en': 'Reel/short video',
  519. 'pt': 'Rolo/vídeo curto',
  520. 'de': 'Reel/kurzes Video',
  521. 'fr': 'Bobine/courte vidéo',
  522. 'es': 'Reel/video corto',
  523. 'cs': 'Naviják/krátké video',
  524. 'vi': 'Reel / video ngắn',
  525. 'it': 'Bobina/breve video',
  526. 'lv': 'Ruļļa/īss video',
  527. 'pl': 'Reel/krótki film',
  528. 'nl': 'Spoel/korte video',
  529. 'he': 'סליל/סרטון קצר',
  530. 'ar': 'بكرة / فيديو قصير',
  531. 'id': 'Reel/video pendek',
  532. 'zh-Hans': '卷轴/短视频',
  533. 'zh-Hant': 'Reel/短影片',
  534. 'ja': 'リール/ショートビデオ',
  535. 'fi': 'Kela/lyhyt video',
  536. 'tr': 'makara/kısa video',
  537. 'el': 'Ριλς/μικρό βίντεο',
  538. 'ru': 'Reels/короткое видео',
  539. 'uk': 'Reel/коротке відео',
  540. 'bg': 'Рил/късо видео',
  541. 'defaultEnabled': false
  542. },
  543.  
  544. // - Events you may like:
  545. NF_EVENTS_YOU_MAY_LIKE: {
  546. 'en': 'Events you may like',
  547. 'pt': 'Eventos que você pode gostar',
  548. 'de': 'Veranstaltungen, die Ihnen gefallen könnten',
  549. 'fr': 'Évènements qui pourraient vous intéresser',
  550. 'es': 'Eventos que te pueden gustar',
  551. 'cs': 'Události, které se vám mohou líbit',
  552. 'vi': 'Sự kiện bạn có thể thích',
  553. 'it': 'Eventi che potrebbero piacerti',
  554. 'lv': 'Notikumi, kas jums varētu patikt',
  555. 'pl': 'Wydarzenia, które mogą Ci się spodobać',
  556. 'nl': 'Evenementen die je misschien leuk vindt',
  557. 'he': 'אירועים שאולי תאהבו',
  558. 'ar': 'أحداث قد تعجبك',
  559. 'id': 'Acara yang mungkin Anda sukai',
  560. 'zh-Hans': '您可能喜欢的活动',
  561. 'zh-Hant': '你可能感興趣的活動',
  562. 'ja': 'リール/ショートビデオ',
  563. 'fi': 'Kela/lyhyt video',
  564. 'tr': 'makara/kısa video',
  565. 'el': 'Εκδηλώσεις που μπορεί να σας αρέσουν',
  566. 'ru': 'Мероприятия, которые вам могут понравиться',
  567. 'uk': 'Події, які можуть вам сподобатися',
  568. 'bg': 'Събития, които може да ви харесат',
  569. 'defaultEnabled': false,
  570. },
  571.  
  572. // - pause animated GIFs:
  573. NF_ANIMATED_GIFS: {
  574. 'en': 'Pause animated GIFs',
  575. 'pt': 'Pausar GIFs animados',
  576. 'de': 'Animierte GIFs pausieren',
  577. 'fr': 'Mettre en pause les GIF animés',
  578. 'es': 'Pausar GIF animados',
  579. 'cs': 'Pozastavit animované GIFy',
  580. 'vi': 'Tạm dừng các ảnh GIF động',
  581. 'it': 'Metti in pausa le GIF animate',
  582. 'lv': 'Apturiet animētos GIF',
  583. 'pl': 'Wstrzymaj animowane GIF-y',
  584. 'nl': 'Geanimeerde GIF\'s pauzeren',
  585. 'he': 'השהה קובצי GIF מונפשים',
  586. 'ar': 'وقفة GIF المتحركة',
  587. 'id': 'Jeda GIF animasi',
  588. 'zh-Hans': '暂停动画 GIF',
  589. 'zh-Hant': '暫停 GIF 動畫',
  590. 'ja': 'アニメーション GIF を一時停止する',
  591. 'fi': 'Keskeytä animoidut GIF-kuvat',
  592. 'tr': 'Hareketli GIF\'leri duraklat',
  593. 'el': 'Παύση κινούμενων GIF',
  594. 'ru': 'Приостановить анимированные GIF',
  595. 'uk': 'Призупинити анімовані GIF-файли',
  596. 'bg': 'Пауза на анимирани GIF файлове',
  597. 'defaultEnabled': false
  598. },
  599.  
  600. // - # shares
  601. NF_SHARES: {
  602. 'en': '# shares',
  603. 'pt': '# partilhas',
  604. 'de': '# Mal geteilt',
  605. 'fr': '# partages',
  606. 'es': '# veces compartida',
  607. 'cs': '# sdílení',
  608. 'vi': '# lượt chia sẻ',
  609. 'it': 'Condivisioni: #',
  610. 'lv': '# dalījās',
  611. 'pl': '# udostępnienia',
  612. 'nl': '# keer gedeeld',
  613. 'he': '# שיתופים',
  614. 'ar': '# مشاركات',
  615. 'id': '# Kali dibagikan',
  616. 'zh-Hans': '#次分享',
  617. 'zh-Hant': '#次分享',
  618. 'ja': 'シェア#件',
  619. 'fi': '# jakoa',
  620. 'tr': '# Paylaşım',
  621. 'el': '# μερίδια',
  622. 'ru': '# поделились',
  623. 'uk': '# Поширити',
  624. 'bg': '# споделяния',
  625. 'defaultEnabled': false
  626. },
  627.  
  628. // -- Maximum Likes
  629. // -- hide posts having excessive Likes
  630. // -- user's input count value is stored in NF_LIKES_MAXIMUM_COUNT
  631. NF_LIKES_MAXIMUM: {
  632. 'en': 'Maximum number of Likes',
  633. 'pt': 'Número máximo de curtidas',
  634. 'de': 'Maximale Anzahl an Likes',
  635. 'fr': 'Nombre maximum de J\'aime',
  636. 'es': 'Número máximo de Me gusta',
  637. 'cs': 'Maximální počet hodnocení Líbí se mi',
  638. 'vi': 'Số lượt thích tối đa',
  639. 'it': 'Numero massimo di Mi piace',
  640. 'lv': 'Maksimālais atzīmju Patīk skaits',
  641. 'pl': 'Maksymalna ilość "Lubię to!"',
  642. 'nl': 'Maximaal aantal likes',
  643. 'he': 'מספר לייקים מקסימלי',
  644. 'ar': 'الحد الأقصى لعدد الإعجابات',
  645. 'id': 'Jumlah maksimum Suka',
  646. 'zh-Hans': '最大点赞数',
  647. 'zh-Hant': '最大按讚數',
  648. 'ja': '「いいね!」の最大数',
  649. 'fi': 'Maksimimäärä tykkäyksiä',
  650. 'tr': 'Maksimum Beğeni sayısı',
  651. 'el': 'Μέγιστα "Μου αρέσει"',
  652. 'ru': 'Максимальное количество «Нравится»',
  653. 'uk': 'Максимальна кількість «Подобається».',
  654. 'bg': 'Максимален брой Харесвания',
  655. 'defaultEnabled': false
  656. },
  657.  
  658. // *** Groups Feed ::
  659.  
  660. // - Paid partnership:
  661. // - a page you follow is "sponsoring" another page's post (e.g. job)
  662. GF_PAID_PARTNERSHIP: {
  663. 'en': 'Paid partnership',
  664. 'pt': 'Parceria paga',
  665. 'de': 'Bezahlte Werbepartnerschaft',
  666. 'fr': 'Partenariat rémunéré',
  667. 'es': 'Colaboración pagada',
  668. 'cs': 'Placené partnerství',
  669. 'vi': 'Mối quan hệ tài trợ',
  670. 'it': 'Partnership pubblicizzata',
  671. 'lv': 'Apmaksāta sadarbība',
  672. 'pl': 'Post sponsorowany',
  673. 'nl': 'Betaald partnerschap',
  674. 'he': 'שותפות בתשלום',
  675. 'ar': 'شراكة مدفوعة',
  676. 'id': 'Kemitraan berbayar',
  677. 'zh-Hans': '有偿合作',
  678. 'zh-Hant': '付費合作',
  679. 'ja': '有償パートナーシップ',
  680. 'fi': 'Maksettu kumppanuus',
  681. 'tr': 'ücretli ortaklık',
  682. 'el': 'Πληρωμένη συνεργασία',
  683. 'ru': 'Платное партнерство',
  684. 'uk': 'Оплачуване партнерство',
  685. 'bg': 'Платено партньорство',
  686. 'defaultEnabled': true
  687. },
  688.  
  689. // - Various suggested/recommendations:
  690. GF_SUGGESTIONS: {
  691. 'en': 'Suggestions / Recommendations',
  692. 'pt': 'Sugestões / Recomendações',
  693. 'de': 'Vorschläge / Empfehlungen',
  694. 'fr': 'Suggestions / Recommandations',
  695. 'es': 'Sugerencias / Recomendaciones',
  696. 'cs': 'Návrhy / Doporučení',
  697. 'vi': 'Đề xuất / Khuyến nghị',
  698. 'it': 'Suggerimenti / Raccomandazioni',
  699. 'lv': 'Ieteikumi',
  700. 'pl': 'Sugestie / Zalecenia',
  701. 'nl': 'Suggesties / Aanbevelingen',
  702. 'he': 'הצעות / המלצות',
  703. 'ar': 'الاقتراحات / التوصيات',
  704. 'id': 'Saran / Rekomendasi',
  705. 'zh-Hans': '建议/建议',
  706. 'zh-Hant': '建議/推薦',
  707. 'ja': '提案/推奨事項',
  708. 'fi': 'Ehdotuksia / Suosituksia',
  709. 'tr': 'Öneriler',
  710. 'el': 'Προτάσεις / Συστάσεις',
  711. 'ru': 'Предложения / Рекомендации',
  712. 'uk': 'Пропозиції / Рекомендації',
  713. 'bg': 'Предложения / Препоръки',
  714. 'defaultEnabled': false
  715. },
  716.  
  717. // - Reel/short video posts
  718. GF_SHORT_REEL_VIDEO: {
  719. 'en': 'Reel/short video',
  720. 'pt': 'Rolo/vídeo curto',
  721. 'de': 'Reel/kurzes Video',
  722. 'fr': 'Bobine/courte vidéo',
  723. 'es': 'Reel/video corto',
  724. 'cs': 'Naviják/krátké video',
  725. 'vi': 'Reel / video ngắn',
  726. 'it': 'Bobina/breve video',
  727. 'lv': 'Ruļļa/īss video',
  728. 'pl': 'Reel/krótki film',
  729. 'nl': 'Spoel/korte video',
  730. 'he': 'סליל/סרטון קצר',
  731. 'ar': 'بكرة / فيديو قصير',
  732. 'id': 'Reel/video pendek',
  733. 'zh-Hans': '卷轴和短视频',
  734. 'zh-Hant': 'Reel/短影片',
  735. 'ja': 'リールとショートビデオ',
  736. 'fi': 'Keloja ja lyhyitä videoita',
  737. 'tr': 'makara/kısa video',
  738. 'el': 'Ριλς/μικρό βίντεο',
  739. 'ru': 'Reel/короткое видео',
  740. 'uk': 'Reel/коротке відео',
  741. 'bg': 'Рил/късо видео',
  742. 'defaultEnabled': false
  743. },
  744.  
  745. // - pause animated GIFs:
  746. GF_ANIMATED_GIFS: {
  747. 'en': 'Pause animated GIFs',
  748. 'pt': 'Pausar GIFs animados',
  749. 'de': 'Animierte GIFs pausieren',
  750. 'fr': 'Mettre en pause les GIF animés',
  751. 'es': 'Pausar GIF animados',
  752. 'cs': 'Pozastavit animované GIFy',
  753. 'vi': 'Tạm dừng các ảnh GIF động',
  754. 'it': 'Metti in pausa le GIF animate',
  755. 'lv': 'Apturiet animētos GIF',
  756. 'pl': 'Wstrzymaj animowane GIF-y',
  757. 'nl': 'Geanimeerde GIF\'s pauzeren',
  758. 'he': 'השהה קובצי GIF מונפשים',
  759. 'ar': 'وقفة GIF المتحركة',
  760. 'id': 'Jeda GIF animasi',
  761. 'zh-Hans': '暂停动画 GIF',
  762. 'zh-Hant': '暫停 GIF 動畫',
  763. 'ja': 'リール/ショートビデオ',
  764. 'fi': 'Kela/lyhyt video',
  765. 'tr': 'Hareketli GIF\'leri duraklat',
  766. 'el': 'Παύση κινούμενων GIF',
  767. 'ru': 'Приостановить анимированные GIF',
  768. 'uk': 'Призупинити анімовані GIF-файли',
  769. 'bg': 'Пауза на анимирани GIF файлове',
  770. 'defaultEnabled': false,
  771. },
  772. // - # shares
  773. GF_SHARES: {
  774. 'en': '# shares',
  775. 'pt': '# partilhas',
  776. 'de': '# Mal geteilt',
  777. 'fr': '# partages',
  778. 'es': '# veces compartida',
  779. 'cs': '# sdílení',
  780. 'vi': '# lượt chia sẻ',
  781. 'it': 'Condivisioni: #',
  782. 'lv': '# dalījās',
  783. 'pl': '# udostępnienia',
  784. 'nl': '# keer gedeeld',
  785. 'he': '# שיתופים',
  786. 'ar': '# مشاركات',
  787. 'id': '# Kali dibagikan',
  788. 'zh-Hans': '#次分享',
  789. 'zh-Hant': '#次分享',
  790. 'ja': 'シェア#件',
  791. 'fi': '# jakoa',
  792. 'tr': '# Paylaşım',
  793. 'el': '# μερίδια',
  794. 'ru': '# поделились',
  795. 'uk': '# Поширити',
  796. 'bg': '# споделяния',
  797. 'defaultEnabled': false
  798. },
  799.  
  800. // *** Watch Videos Feed ::
  801.  
  802. // - LIVE videos:
  803. VF_LIVE: {
  804. 'en': 'LIVE',
  805. 'pt': 'DIRETO',
  806. 'de': 'LIVE',
  807. 'fr': 'EN DIRECT',
  808. 'es': 'ESTRENO',
  809. 'cs': 'ŽIVĚ',
  810. 'vi': 'TRỰC TIẾP',
  811. 'it': 'IN DIRETTA',
  812. 'lv': 'TIEŠRAIDE',
  813. 'pl': 'NA ŻYWO',
  814. 'nl': 'LIVE',
  815. 'he': 'שידור חי',
  816. 'ar': 'مباشر',
  817. 'id': 'LANGSUNG',
  818. 'zh-Hans': '现场直播',
  819. 'zh-Hant': '現場直播',
  820. 'ja': 'ライブ',
  821. 'fi': 'LIVE',
  822. 'tr': 'CANLI',
  823. 'el': 'ΖΩΝΤΑΝΑ',
  824. 'ru': 'В ЭФИРЕ',
  825. 'uk': 'ЕФІР',
  826. 'bg': 'НА ЖИВО',
  827. 'defaultEnabled': false,
  828. },
  829.  
  830. // - pause animated GIFs:
  831. VF_ANIMATED_GIFS: {
  832. 'en': 'Pause animated GIFs',
  833. 'pt': 'Pausar GIFs animados',
  834. 'de': 'Animierte GIFs pausieren',
  835. 'fr': 'Mettre en pause les GIF animés',
  836. 'es': 'Pausar GIF animados',
  837. 'cs': 'Pozastavit animované GIFy',
  838. 'vi': 'Tạm dừng các ảnh GIF động',
  839. 'it': 'Metti in pausa le GIF animate',
  840. 'lv': 'Apturiet animētos GIF',
  841. 'pl': 'Wstrzymaj animowane GIF-y',
  842. 'nl': 'Geanimeerde GIF\'s pauzeren',
  843. 'he': 'השהה קובצי GIF מונפשים',
  844. 'ar': 'وقفة GIF المتحركة',
  845. 'id': 'Jeda GIF animasi',
  846. 'zh-Hans': '暂停动画 GIF',
  847. 'zh-Hant': '暫停 GIF 動畫',
  848. 'ja': 'アニメーション GIF を一時停止する',
  849. 'fi': 'Keskeytä animoidut GIF-kuvat',
  850. 'tr': 'Hareketli GIF\'leri duraklat',
  851. 'el': 'Παύση κινούμενων GIF',
  852. 'ru': 'Приостановить анимированные GIF',
  853. 'uk': 'Призупинити анімовані GIF-файли',
  854. 'bg': 'Пауза на анимирани GIF файлове',
  855. 'defaultEnabled': false,
  856. },
  857. // (videos do not have # shares count)
  858.  
  859.  
  860. // *** block text - feeds
  861.  
  862. // - text filter for News Feed:
  863. NF_BLOCKED_FEED: {
  864. 'en': ['News Feed', 'Groups Feed', 'Videos Feed'],
  865. 'pt': ['Feed de notícias', 'Feed de grupos', 'Feed de vídeos'],
  866. 'de': ['Newsfeed', 'Gruppen-Feed', 'Video-Feed'],
  867. 'fr': ['Fil de nouvelles', 'Flux de groupes', 'Flux de vidéos'],
  868. 'es': ['Feed de noticias', 'Feed de grupos', 'Feed de videos'],
  869. 'cs': ['Informační kanál', 'Skupinový kanál', 'Video kanál'],
  870. 'vi': ['Nguồn cấp tin tức', 'Nguồn cấp dữ liệu Nhóm', 'Nguồn cấp dữ liệu video'],
  871. 'it': ['Feed di notizie', 'Feed di gruppo', 'Feed di video'],
  872. 'lv': ['Ziņu plūsma', 'Grupu plūsma', 'Video plūsma'],
  873. 'pl': ['Kanał aktualności', 'Kanał grup', 'Kanał wideo'],
  874. 'nl': ['Nieuwsfeed', 'Groepsfeed', 'Videofeed'],
  875. 'he': ['ניוז פיד', 'פיד קבוצות', 'צפה בפיד סרטונים'],
  876. 'ar': ['موجز الأخبار', 'تغذية المجموعات', 'تغذية الفيديو'],
  877. 'id': ['Umpan Berita', 'Umpan Grup', 'Umpan Video'],
  878. 'zh-Hans': ['新闻提要', '组提要', '视频提要'],
  879. 'zh-Hant': ['新聞動態消息', '群組動態消息', '影片動態消息'],
  880. 'ja': ['ニュースフィード', 'グループ フィード', '動画フィード'],
  881. 'fi': ['Uutissyöte', 'Ryhmäsyöte', 'Videosyöte'],
  882. 'tr': ['Haber akışı', 'Gruplar Feed\'i', 'Video Beslemelerini İzle'],
  883. 'el': ['Ροή ειδήσεων', 'Ροή ομάδων', 'Ροή βίντεο'],
  884. 'ru': ['Лента новостей', 'Лента групп', 'Лента видео'],
  885. 'uk': ['Стрічка новин', 'Стрічка Групи', 'Стрічка відео'],
  886. 'bg': ['Новинарски поток', 'Поток с групи', 'Поток с видеа'],
  887. 'defaultEnabled': ['1', '0', '0'],
  888. },
  889. // - text filter for Groups Feed:
  890. GF_BLOCKED_FEED: {
  891. 'en': ['News Feed', 'Groups Feed', 'Videos Feed'],
  892. 'pt': ['Feed de notícias', 'Feed de grupos', 'Feed de vídeos'],
  893. 'de': ['Newsfeed', 'Gruppen-Feed', 'Video-Feed'],
  894. 'fr': ['Fil de nouvelles', 'Flux de groupes', 'Flux de vidéos'],
  895. 'es': ['Feed de noticias', 'Feed de grupos', 'Feed de videos'],
  896. 'cs': ['Informační kanál', 'Skupinový kanál', 'Video kanál'],
  897. 'vi': ['Nguồn cấp tin tức', 'Nguồn cấp dữ liệu Nhóm', 'Nguồn cấp dữ liệu video'],
  898. 'it': ['Feed di notizie', 'Feed di gruppo', 'Feed di video'],
  899. 'lv': ['Ziņu plūsma', 'Grupu plūsma', 'Video plūsma'],
  900. 'pl': ['Kanał aktualności', 'Kanał grup', 'Kanał wideo'],
  901. 'nl': ['Nieuwsfeed', 'Groepsfeed', 'Videofeed'],
  902. 'he': ['ניוז פיד', 'פיד קבוצות', 'צפה בפיד סרטונים'],
  903. 'ar': ['موجز الأخبار', 'تغذية المجموعات', 'تغذية الفيديو'],
  904. 'id': ['Umpan Berita', 'Umpan Grup', 'Umpan Video'],
  905. 'zh-Hans': ['新闻提要', '组提要', '视频提要'],
  906. 'zh-Hant': ['新聞動態消息', '群組動態消息', '影片動態消息'],
  907. 'ja': ['ニュースフィード', 'グループ フィード', '動画フィード'],
  908. 'fi': ['Uutissyöte', 'Ryhmäsyöte', 'Videosyöte'],
  909. 'tr': ['Haber akışı', 'Gruplar Feed\'i', 'Video Beslemelerini İzle'],
  910. 'el': ['Ροή ειδήσεων', 'Ροή ομάδων', 'Ροή βίντεο'],
  911. 'ru': ['Лента новостей', 'Лента групп', 'Лента видео'],
  912. 'uk': ['Стрічка новин', 'Стрічка Групи', 'Стрічка відео'],
  913. 'bg': ['Новинарски поток', 'Поток с групи', 'Поток с видеа'],
  914. 'defaultEnabled': ['0', '1', '0'],
  915. },
  916. // - text filter for Vidoes Feed:
  917. VF_BLOCKED_FEED: {
  918. 'en': ['News Feed', 'Groups Feed', 'Videos Feed'],
  919. 'pt': ['Feed de notícias', 'Feed de grupos', 'Feed de vídeos'],
  920. 'de': ['Newsfeed', 'Gruppen-Feed', 'Video-Feed'],
  921. 'fr': ['Fil de nouvelles', 'Flux de groupes', 'Flux de vidéos'],
  922. 'es': ['Feed de noticias', 'Feed de grupos', 'Feed de videos'],
  923. 'cs': ['Informační kanál', 'Skupinový kanál', 'Video kanál'],
  924. 'vi': ['Nguồn cấp tin tức', 'Nguồn cấp dữ liệu Nhóm', 'Nguồn cấp dữ liệu video'],
  925. 'it': ['Feed di notizie', 'Feed di gruppo', 'Feed di video'],
  926. 'lv': ['Ziņu plūsma', 'Grupu plūsma', 'Video plūsma'],
  927. 'pl': ['Kanał aktualności', 'Kanał grup', 'Kanał wideo'],
  928. 'nl': ['Nieuwsfeed', 'Groepsfeed', 'Videofeed'],
  929. 'he': ['ניוז פיד', 'פיד קבוצות', 'צפה בפיד סרטונים'],
  930. 'ar': ['موجز الأخبار', 'تغذية المجموعات', 'تغذية الفيديو'],
  931. 'id': ['Umpan Berita', 'Umpan Grup', 'Umpan Video'],
  932. 'zh-Hans': ['新闻提要', '组提要', '视频提要'],
  933. 'zh-Hant': ['新聞動態消息', '群組動態消息', '影片動態消息'],
  934. 'ja': ['ニュースフィード', 'グループ フィード', '動画フィード'],
  935. 'fi': ['Uutissyöte', 'Ryhmäsyöte', 'Videosyöte'],
  936. 'tr': ['Haber akışı', 'Gruplar Feed\'i', 'Video Beslemelerini İzle'],
  937. 'el': ['Ροή ειδήσεων', 'Ροή ομάδων', 'Ροή βίντεο'],
  938. 'ru': ['Лента новостей', 'Лента групп', 'Лента видео'],
  939. 'uk': ['Стрічка новин', 'Стрічка Групи', 'Стрічка відео'],
  940. 'bg': ['Новинарски поток', 'Поток с групи', 'Поток с видеа'],
  941. 'defaultEnabled': ['0', '0', '1'],
  942. },
  943. // - text filter for Marketplace feed:
  944. MP_BLOCKED_FEED: {
  945. 'en': ['Marketplace Feed'],
  946. 'pt': ['Feed de mercado'],
  947. 'de': ['Marktplatz-Feed'],
  948. 'fr': ['Flux de la place de marché'],
  949. 'es': ['Feed de Marketplace'],
  950. 'cs': ['Marketplace kanál'],
  951. 'vi': ['Nguồn cấp dữ liệu Marketplace'],
  952. 'it': ['Feed id Marketplace'],
  953. 'lv': ['Marketplace'],
  954. 'pl': ['Kanał Marketplace'],
  955. 'nl': ['Marktplaatsfeed'],
  956. 'he': ['זירת מסחר'],
  957. 'ar': ['السوق تغذية'],
  958. 'id': ['Umpan Marketplace'],
  959. 'zh-Hans': ['市场提要'],
  960. 'zh-Hant': ['Marketplace 動態消息'],
  961. 'ja': ['マーケットプレイス フィード'],
  962. 'fi': ['Marketplace-syöte'],
  963. 'tr': ['Pazar Yeri Feed\'i'],
  964. 'el': ['Ροή Marketplace'],
  965. 'ru': ['Лента Marketplace'],
  966. 'uk': ['Стрічка Marketplace'],
  967. 'bg': ['Поток с Marketplace'],
  968. 'defaultEnabled': ['1', '0', '0'],
  969. },
  970.  
  971.  
  972. // *** Miscellaneous/Supplementary/Other items ::
  973.  
  974. // - Info box - coronavirus:
  975. OTHER_INFO_BOX_CORONAVIRUS: {
  976. 'en': 'Coronavirus (information box)',
  977. 'pt': 'Coronavírus (caixa de informações)',
  978. 'de': 'Coronavirus (Infobox)',
  979. 'fr': 'Coronavirus (encadré d\'information)',
  980. 'es': 'Coronavirus (cuadro de información)',
  981. 'cs': 'Coronavirus (informační box)',
  982. 'vi': 'Virus corona (hộp thông tin)',
  983. 'it': 'Coronavirus (casella informativa)',
  984. 'lv': 'Koronavīruss (informācijas lodziņš)',
  985. 'pl': 'Koronawirus (skrzynka informacyjna)',
  986. 'nl': 'Coronavirus (informatiebox)',
  987. 'he': 'וירוס קורונה (תיבת מידע)',
  988. 'ar': 'فيروس كورونا (صندوق المعلومات)',
  989. 'id': 'Virus Corona (kotak informasi)',
  990. 'zh-Hans': '冠状病毒(信息框)',
  991. 'zh-Hant': '武漢肺炎病毒(資訊框)',
  992. 'ja': 'コロナウイルス(インフォメーションボックス)',
  993. 'fi': 'Koronavirus (tietolaatikko)',
  994. 'tr': 'Koronavirüs (bilgi kutusu)',
  995. 'el': 'Κορονοϊός (πλαίσιο πληροφοριών)',
  996. 'ru': 'Коронавирус (информационное окно)',
  997. 'uk': 'Коронавірус (інформаційне вікно)',
  998. 'bg': 'Коронавирус (информационна кутия)',
  999. 'defaultEnabled': false,
  1000. 'pathMatch': '/coronavirus_info/',
  1001. },
  1002.  
  1003. // - Info box - climate science
  1004. OTHER_INFO_BOX_CLIMATE_SCIENCE: {
  1005. 'en': 'Climate Science (information box)',
  1006. 'pt': 'Ciência do Clima (caixa de informações)',
  1007. 'de': 'Klimawissenschaft (Infobox)',
  1008. 'fr': 'Science du climat (encadré d\'information)',
  1009. 'es': 'Ciencia del clima (cuadro de información)',
  1010. 'cs': 'Klimatická věda (informační box)',
  1011. 'vi': 'Khoa học khí hậu (hộp thông tin)',
  1012. 'it': 'Scienza del clima (casella informativa)',
  1013. 'lv': 'Klimata zinātne (informācijas lodziņš)',
  1014. 'pl': 'Nauka o klimacie (skrzynka informacyjna)',
  1015. 'nl': 'Klimaatwetenschap (informatiebox)',
  1016. 'he': 'מדע האקלים (תיבת מידע)',
  1017. 'ar': 'علوم المناخ (صندوق المعلومات)',
  1018. 'id': 'Ilmu iklim (kotak informasi)',
  1019. 'zh-Hans': '气候科学(信息框)',
  1020. 'zh-Hant': '氣候科學(資訊框)',
  1021. 'ja': '気候科学(情報ボックス)',
  1022. 'fi': 'Ilmastotiede (tietolaatikko)',
  1023. 'tr': 'İklim Bilimi (bilgi kutusu)',
  1024. 'el': 'Επιστήμη του κλίματος (πλαίσιο πληροφοριών)',
  1025. 'ru': 'Наука о климате (информационное окно)',
  1026. 'uk': 'Наука про клімат (інформаційне вікно)',
  1027. 'bg': 'Наука за климата (информационна кутия)',
  1028. 'defaultEnabled': false,
  1029. 'pathMatch': '/climatescienceinfo/',
  1030. },
  1031.  
  1032. // - Info box - subscribe
  1033. OTHER_INFO_BOX_SUBSCRIBE: {
  1034. 'en': 'Subscribe (information box)',
  1035. 'pt': 'Assine (caixa de informações)',
  1036. 'de': 'Abonnieren (Infobox)',
  1037. 'fr': 'S’abonner (encadré d\'information)',
  1038. 'es': 'Suscribir (cuadro de información)',
  1039. 'cs': 'Odebírat (informační box)',
  1040. 'vi': 'Đăng kí (hộp thông tin)',
  1041. 'it': 'Iscriviti (casella informativa)',
  1042. 'lv': 'Abonēt (informācijas lodziņš)',
  1043. 'pl': 'Subskrybuj (pole informacyjne)',
  1044. 'nl': 'Abonneren (informatievak)',
  1045. 'he': 'הירשם (תיבת מידע)',
  1046. 'ar': '(صندوق المعلومات) الاشتراك',
  1047. 'id': 'Berlangganan (kotak informasi)',
  1048. 'zh-Hans': '订阅(信息框)',
  1049. 'zh-Hant': '訂閱(資訊框)',
  1050. 'ja': '購読する(情報ボックス)',
  1051. 'fi': 'Rekisteröidy (tietolaatikko)',
  1052. 'tr': 'Abone ol (bilgi kutusu)',
  1053. 'el': 'Εγγραφή (πλαίσιο πληροφοριών)',
  1054. 'ru': 'Подписаться (информационное окно)',
  1055. 'uk': 'Підписатися (інформаційне вікно)',
  1056. 'bg': 'Абонирай се (информационна кутия)',
  1057. 'defaultEnabled': false,
  1058. 'pathMatch': '/support/',
  1059. },
  1060.  
  1061. REELS_TITLE: {
  1062. 'en': 'Reels',
  1063. 'pt': 'Reels',
  1064. 'de': 'Reels',
  1065. 'fr': 'Reels',
  1066. 'es': 'Reels',
  1067. 'cs': 'Reels',
  1068. 'vi': 'Reels',
  1069. 'it': 'Reels',
  1070. 'lv': 'Reels',
  1071. 'pl': 'Reels',
  1072. 'nl': 'Reels',
  1073. 'he': 'Reels', // -- FB's label
  1074. 'ar': 'ريلز', // -- FB's label
  1075. 'id': 'Reels',
  1076. 'zh-Hans': 'Reels',
  1077. 'zh-Hant': 'Reels',
  1078. 'ja': 'リール動画',
  1079. 'fi': 'Reels',
  1080. 'tr': 'Reels',
  1081. 'el': 'Reel',
  1082. 'ru': 'Видео Reels',
  1083. 'uk': 'Reels',
  1084. 'bg': 'Ленти', // -- FB's label
  1085. },
  1086.  
  1087. REELS_CONTROLS: {
  1088. 'en': 'Show video controls',
  1089. 'pt': 'Mostrar controles do vídeo',
  1090. 'de': 'Video-Steuerung anzeigen',
  1091. 'fr': 'Afficher les contrôles vidéo',
  1092. 'es': 'Mostrar controles de video',
  1093. 'cs': 'Zobrazit ovládání videa',
  1094. 'vi': 'Hiển thị điều khiển video',
  1095. 'it': 'Mostra controlli video',
  1096. 'lv': 'Rādīt video vadīklus',
  1097. 'pl': 'Pokaż sterowanie wideo',
  1098. 'nl': 'Toon video bedieningselementen',
  1099. 'he': 'הצג אפשרויות בקרת וידאו',
  1100. 'ar': 'عرض أدوات التحكم في الفيديو',
  1101. 'id': 'Tampilkan kontrol video',
  1102. 'zh-Hans': '显示视频控制',
  1103. 'zh-Hant': '顯示影片控制',
  1104. 'ja': 'ビデオコントロールを表示',
  1105. 'fi': 'Näytä videon hallintaelementit',
  1106. 'tr': 'Video kontrollerini göster',
  1107. 'el': 'Εμφάνιση χειριστηρίων βίντεο',
  1108. 'ru': 'Показать элементы управления видео',
  1109. 'uk': 'Відображення елементів керування відео',
  1110. 'bg': 'Покажи контроли на видеото',
  1111. 'defaultEnabled': true
  1112. },
  1113.  
  1114. // *** Dialog box ::
  1115.  
  1116. // - CMF's dialog title:
  1117. DLG_TITLE: {
  1118. 'en': 'Clean my feeds',
  1119. 'pt': 'Limpe meus feeds',
  1120. 'de': 'Bereinige meine Feeds',
  1121. 'fr': 'Nettoyer mes flux',
  1122. 'es': 'Limpia mis feeds',
  1123. 'cs': 'Vyčistěte mé kanály',
  1124. 'vi': 'Làm sạch nguồn cấp dữ liệu của tôi',
  1125. 'it': 'Pulisci i miei feed',
  1126. 'lv': 'Tīrīt manas plūsmas',
  1127. 'pl': 'Wyczyść moje kanały',
  1128. 'nl': 'Schoon mijn feeds',
  1129. 'he': 'תנקה את הזנות שלי',
  1130. 'ar': 'تنظيف خلاصاتي',
  1131. 'id': 'Bersihkan feed saya',
  1132. 'zh-Hans': '清理我的提要',
  1133. 'zh-Hant': '清理我的動態消息',
  1134. 'ja': 'フィードをクリーンアップ',
  1135. 'fi': 'Puhdista syötteeni',
  1136. 'tr': 'Feed\'lerimi temizle',
  1137. 'el': 'Καθαρισμός των ροών μου',
  1138. 'ru': 'Очистить мои новостные ленты',
  1139. 'uk': 'Очистити мої стрічки',
  1140. 'bg': 'Почисти моите емисии',
  1141. },
  1142.  
  1143. // - label for News Feed:
  1144. DLG_NF: {
  1145. 'en': 'News Feed',
  1146. 'pt': 'Feed de notícias',
  1147. 'de': 'Newsfeed',
  1148. 'fr': 'Fil de nouvelles',
  1149. 'es': 'Feed de noticias',
  1150. 'cs': 'Informační kanál',
  1151. 'vi': 'Nguồn cấp tin tức',
  1152. 'it': 'Feed di notizie',
  1153. 'lv': 'Ziņu plūsma',
  1154. 'pl': 'Kanał aktualności',
  1155. 'nl': 'Nieuwsfeed',
  1156. 'he': 'ניוז פיד',
  1157. 'ar': 'الأخبار تغذية',
  1158. 'id': 'Umpan Berita',
  1159. 'zh-Hans': '新闻提要',
  1160. 'zh-Hant': '新聞動態消息',
  1161. 'ja': 'ニュースフィード',
  1162. 'fi': 'Uutisvirta',
  1163. 'tr': 'Haber akışı',
  1164. 'el': 'Ροή ειδήσεων',
  1165. 'ru': 'Лента новостей',
  1166. 'uk': 'Стрічка новин',
  1167. 'bg': 'Новинарски поток',
  1168. },
  1169.  
  1170. // - label for Groups Feed:
  1171. DLG_GF: {
  1172. 'en': 'Groups Feed',
  1173. 'pt': 'Feed de grupos',
  1174. 'de': 'Gruppen-Feed',
  1175. 'fr': 'Flux de groupes',
  1176. 'es': 'Feed de grupos',
  1177. 'cs': 'Skupinový kanál',
  1178. 'vi': 'Nguồn cấp dữ liệu Nhóm',
  1179. 'it': 'Feed di gruppo',
  1180. 'lv': 'Grupu plūsma',
  1181. 'pl': 'Kanał grup',
  1182. 'nl': 'Groepsfeed',
  1183. 'he': 'פיד קבוצות',
  1184. 'ar': 'مجموعات تغذية',
  1185. 'id': 'Umpan Grup',
  1186. 'zh-Hans': '群组提要',
  1187. 'zh-Hant': '群組動態消息',
  1188. 'ja': 'グループ フィード',
  1189. 'fi': 'Ryhmäsyöte',
  1190. 'tr': 'Gruplar Feed\'i',
  1191. 'el': 'Ροή ομάδων',
  1192. 'ru': 'Лента групп',
  1193. 'uk': 'Стрічка Групи',
  1194. 'bg': 'Поток с групи',
  1195. },
  1196.  
  1197. // - label for Videos Feed:
  1198. DLG_VF: {
  1199. 'en': 'Videos Feed',
  1200. 'pt': 'Feed de vídeos',
  1201. 'de': 'Video-Feed',
  1202. 'fr': 'Flux de vidéos',
  1203. 'es': 'Feed de vídeos',
  1204. 'cs': 'Video kanál',
  1205. 'vi': 'Nguồn cấp dữ liệu video',
  1206. 'it': 'Feed di video',
  1207. 'lv': 'Video plūsma',
  1208. 'pl': 'Kanał wideo',
  1209. 'nl': 'Videofeed',
  1210. 'he': 'צפה בפיד הסרטונים',
  1211. 'ar': 'الفيديو تغذية',
  1212. 'id': 'Umpan Video',
  1213. 'zh-Hans': '视频提要',
  1214. 'zh-Hant': '影片動態消息',
  1215. 'ja': '動画フィード',
  1216. 'fi': 'Videosyöte',
  1217. 'tr': 'Video Beslemelerini İzle',
  1218. 'el': 'Ροή βίντεο',
  1219. 'ru': 'Лента видео',
  1220. 'uk': 'Стрічка відео',
  1221. 'bg': 'Поток с видеа',
  1222. },
  1223.  
  1224. // - label for Marketplace Feed:
  1225. DLG_MP: {
  1226. 'en': 'Marketplace Feed',
  1227. 'pt': 'Feed de mercado',
  1228. 'de': 'Marktplatz-Feed',
  1229. 'fr': 'Flux de la place de marché',
  1230. 'es': 'Feed de Marketplace',
  1231. 'cs': 'Marketplace kanál',
  1232. 'vi': 'Nguồn cấp dữ liệu Marketplace',
  1233. 'it': 'Feed id Marketplace',
  1234. 'lv': 'Marketplace',
  1235. 'pl': 'Kanał Marketplace',
  1236. 'nl': 'Marktplaatsfeed',
  1237. 'he': 'זירת מסחר',
  1238. 'ar': 'السوق تغذية',
  1239. 'id': 'Umpan Marketplace',
  1240. 'zh-Hans': '市场提要',
  1241. 'zh-Hant': 'Marketplace 動態消息',
  1242. 'ja': 'マーケットプレイス フィード',
  1243. 'fi': 'Marketplace-syöte',
  1244. 'tr': 'Pazar Yeri Feed\'i',
  1245. 'el': 'Ροή Marketplace',
  1246. 'ru': 'Лента Marketplace',
  1247. 'uk': 'Стрічка Marketplace',
  1248. 'bg': 'Поток с Marketplace',
  1249. },
  1250.  
  1251. // - label for Miscellaneous/Other items:
  1252. // DLG_OTHER: {
  1253. // 'en': 'Miscellaneous items',
  1254. // 'pt': 'Itens miscelâneos',
  1255. // 'de': 'Sonstige Gegenstände',
  1256. // 'fr': 'Articles divers',
  1257. // 'es': 'Artículos diversos',
  1258. // 'cs': 'Různé položky',
  1259. // 'vi': 'Những thứ linh tinh',
  1260. // 'it': 'Articoli vari',
  1261. // 'lv': 'Dažādas vienumus',
  1262. // 'pl': 'Różne pozycje',
  1263. // 'nl': 'Diversen',
  1264. // 'he': 'פריטים שונים',
  1265. // 'ar': 'عناصر متنوعة',
  1266. // 'id': 'Barang lain-lain',
  1267. // 'zh-Hans': '杂件',
  1268. // 'zh-Hant': '雜項',
  1269. // 'ja': 'その他のアイテム',
  1270. // 'fi': 'Sekalaiset tavarat',
  1271. // 'tr': 'Diğer öğeler',
  1272. // 'el': 'Διάφορα αντικείμενα',
  1273. // 'ru': 'Разное',
  1274. // },
  1275. DLG_OTHER: {
  1276. 'en': 'Supplementary / information section',
  1277. 'pt': 'Seção suplementar / informativa',
  1278. 'de': 'Ergänzungs-/Informationsbereich',
  1279. 'fr': 'Section supplémentaire / information',
  1280. 'es': 'Sección suplementaria / información',
  1281. 'cs': 'Doplňková/informační část',
  1282. 'vi': 'Phần bổ sung/thông tin',
  1283. 'it': 'Sezione supplementare / informativa',
  1284. 'lv': 'Papildu / informācija sadaļa',
  1285. 'pl': 'Sekcja uzupełniająca/informacyjna',
  1286. 'nl': 'Aanvullende / informatie sectie',
  1287. 'he': 'מדור משלים / מידע',
  1288. 'ar': 'قسم التكميلي / المعلومات',
  1289. 'id': 'Bagian tambahan / informasi',
  1290. 'zh-Hans': '补充/资料部分',
  1291. 'zh-Hant': '補充/資訊部分',
  1292. 'ja': '補足・情報セクション',
  1293. 'fi': 'Täydentävä / tieto-osio',
  1294. 'tr': 'Tamamlayıcı / bilgi bölümü',
  1295. 'el': 'Συμπληρωματικό τμήμα / πληροφοριακό τμήμα',
  1296. 'ru': 'Дополнительный/информационный раздел',
  1297. 'uk': 'Додатковий/інформаційний розділ',
  1298. 'bg': 'Допълнителен / информационен раздел',
  1299. },
  1300.  
  1301. // - text filter label (title)
  1302. DLG_BLOCK_TEXT_FILTER_TITLE: {
  1303. 'en': 'Text filter',
  1304. 'pt': 'Filtro de texto',
  1305. 'de': 'Textfilter',
  1306. 'fr': 'Filtre de texte',
  1307. 'es': 'Filtro de texto',
  1308. 'cs': 'Textový filtr',
  1309. 'vi': 'Bộ lọc văn bản',
  1310. 'it': 'Filtro di testo',
  1311. 'lv': 'Teksta filtrs',
  1312. 'pl': 'Filtr tekstu',
  1313. 'nl': 'Tekstfilter',
  1314. 'he': 'מסנן טקסט',
  1315. 'ar': 'مرشح النص',
  1316. 'id': 'Filter teks',
  1317. 'zh-Hans': '文本过滤器',
  1318. 'zh-Hant': '文字過濾器',
  1319. 'ja': 'テキストフィルター',
  1320. 'fi': 'Tekstisuodatin',
  1321. 'tr': 'Metin filtresi',
  1322. 'el': 'Φίλτρο κειμένου',
  1323. 'ru': 'Текстовый фильтр',
  1324. 'uk': 'Текстовий фільтр',
  1325. 'bg': 'Текстов филтър',
  1326. },
  1327.  
  1328. // - text filter - separate keywords with new line:
  1329. DLG_BLOCK_NEW_LINE: {
  1330. 'en': '(separate words or phrases with a line break)',
  1331. 'pt': '(separe palavras ou frases com quebras de linha)',
  1332. 'de': '(trennen Sie Wörter oder Sätze mit Zeilenumbrüchen)',
  1333. 'fr': '(mots ou phrases séparés avec des sauts de ligne)',
  1334. 'es': '(palabras o frases separadas con saltos de línea)',
  1335. 'cs': '(oddělte slova nebo fráze na nový řádek)',
  1336. 'vi': '(tách các từ hoặc cụm từ bằng dấu ngắt dòng)',
  1337. 'it': '(separare parole o frasi con un\'interruzione di riga)',
  1338. 'lv': '(atdaliet vārdus vai frāzes ar rindas pārtraukumu)',
  1339. 'pl': '(oddziel słowa lub wyrażenia z podziałem wiersza)',
  1340. 'nl': '(scheid woorden of woordgroepen met een regeleinde)',
  1341. 'he': '(הפרד מילים או ביטויים עם מעבר שורה)',
  1342. 'ar': '(افصل الكلمات أو العبارات بفاصل أسطر)',
  1343. 'id': '(pisahkan kata atau frasa dengan jeda baris)',
  1344. 'zh-Hans': '(用换行符分隔单词或短语)',
  1345. 'zh-Hant': '(用換行符號分隔單字或短語)',
  1346. 'ja': '(改行で単語または語句を区切ります)',
  1347. 'fi': '(erottele sanat tai lauseet rivinvaihdolla)',
  1348. 'tr': '(sözcükleri veya tümcecikleri satır sonu ile ayırın)',
  1349. 'el': '(διαχωρίστε λέξεις ή φράσεις με αλλαγή γραμμής)',
  1350. 'ru': '(разделяйте слова или фразы с помощью переноса строки)',
  1351. 'uk': '(розділяти слова або фрази розривом рядка)',
  1352. 'bg': '(разделяйте думи или фрази с нов ред)',
  1353. },
  1354.  
  1355. NF_BLOCKED_ENABLED: {
  1356. 'en': 'Enabled',
  1357. 'pt': 'Habilidoso',
  1358. 'de': 'Ermöglichte',
  1359. 'fr': 'Activé',
  1360. 'es': 'Habilitadas',
  1361. 'cs': 'Zapnuto',
  1362. 'vi': 'Đã kích hoạt',
  1363. 'it': 'Abilita opzione',
  1364. 'lv': 'Iespējots',
  1365. 'pl': 'Włączone',
  1366. 'nl': 'Ingeschakeld',
  1367. 'he': 'מופעל',
  1368. 'ar': 'تمكين',
  1369. 'id': 'Diaktifkan',
  1370. 'zh-Hans': '启用',
  1371. 'zh-Hant': '啟用',
  1372. 'ja': '有効化',
  1373. 'fi': 'Ota vaihtoehto käyttöön',
  1374. 'tr': 'Etkinleştirildi',
  1375. 'el': 'Ενεργοποιημένο',
  1376. 'ru': 'Включено',
  1377. 'uk': 'Увімкнено',
  1378. 'bg': 'Активирано',
  1379. 'defaultEnabled': false,
  1380. },
  1381.  
  1382. GF_BLOCKED_ENABLED: {
  1383. 'en': 'Enabled',
  1384. 'pt': 'Habilidoso',
  1385. 'de': 'Ermöglichte',
  1386. 'fr': 'Activé',
  1387. 'es': 'Habilitadas',
  1388. 'cs': 'Zapnuto',
  1389. 'vi': 'Đã kích hoạt',
  1390. 'it': 'Abilita opzione',
  1391. 'lv': 'Iespējots',
  1392. 'pl': 'Włączone',
  1393. 'nl': 'Ingeschakeld',
  1394. 'he': 'מופעל',
  1395. 'ar': 'تمكين',
  1396. 'id': 'Diaktifkan',
  1397. 'zh-Hans': '启用',
  1398. 'zh-Hant': '啟用',
  1399. 'ja': '有効化',
  1400. 'fi': 'Ota vaihtoehto käyttöön',
  1401. 'tr': 'Etkinleştirildi',
  1402. 'el': 'Ενεργοποιημένο',
  1403. 'ru': 'Включено',
  1404. 'uk': 'Увімкнено',
  1405. 'bg': 'Активирано',
  1406. 'defaultEnabled': false,
  1407. },
  1408.  
  1409. VF_BLOCKED_ENABLED: {
  1410. 'en': 'Enabled',
  1411. 'pt': 'Habilidoso',
  1412. 'de': 'Ermöglichte',
  1413. 'fr': 'Activé',
  1414. 'es': 'Habilitadas',
  1415. 'cs': 'Zapnuto',
  1416. 'vi': 'Đã kích hoạt',
  1417. 'it': 'Abilita opzione',
  1418. 'lv': 'Iespējots',
  1419. 'pl': 'Włączone',
  1420. 'nl': 'Ingeschakeld',
  1421. 'he': 'מופעל',
  1422. 'ar': 'تمكين',
  1423. 'id': 'Diaktifkan',
  1424. 'zh-Hans': '启用',
  1425. 'zh-Hant': '啟用',
  1426. 'ja': '有効化',
  1427. 'fi': 'Ota vaihtoehto käyttöön',
  1428. 'tr': 'Etkinleştirildi',
  1429. 'el': 'Ενεργοποιημένο',
  1430. 'ru': 'Включено',
  1431. 'uk': 'Увімкнено',
  1432. 'bg': 'Активирано',
  1433. 'defaultEnabled': false,
  1434. },
  1435.  
  1436. MP_BLOCKED_ENABLED: {
  1437. 'en': 'Enabled',
  1438. 'pt': 'Habilidoso',
  1439. 'de': 'Ermöglichte',
  1440. 'fr': 'Activé',
  1441. 'es': 'Habilitadas',
  1442. 'cs': 'Zapnuto',
  1443. 'vi': 'Đã kích hoạt',
  1444. 'it': 'Abilita opzione',
  1445. 'lv': 'Iespējots',
  1446. 'pl': 'Włączone',
  1447. 'nl': 'Ingeschakeld',
  1448. 'he': 'מופעל',
  1449. 'ar': 'تمكين',
  1450. 'id': 'Diaktifkan',
  1451. 'zh-Hans': '启用',
  1452. 'zh-Hant': '啟用',
  1453. 'ja': '有効化',
  1454. 'fi': 'Ota vaihtoehto käyttöön',
  1455. 'tr': 'Etkinleştirildi',
  1456. 'el': 'Ενεργοποιημένο',
  1457. 'ru': 'Включено',
  1458. 'uk': 'Увімкнено',
  1459. 'bg': 'Активирано',
  1460. 'defaultEnabled': false,
  1461. },
  1462.  
  1463. // - label for Verbosity
  1464. DLG_VERBOSITY: {
  1465. 'en': 'Verbosity',
  1466. 'pt': 'Verbosidade',
  1467. 'de': 'Ausführlichkeit',
  1468. 'fr': 'Verbosité',
  1469. 'es': 'Verbosidad',
  1470. 'cs': 'Výřečnost',
  1471. 'vi': 'Tính dài dòng',
  1472. 'it': 'Verbosità',
  1473. 'lv': 'Runīgums',
  1474. 'pl': 'Włączone',
  1475. 'nl': 'Ingeschakeld',
  1476. 'he': 'ורבוסיטי',
  1477. 'ar': 'الإسهاب',
  1478. 'id': 'Verbositas',
  1479. 'zh-Hans': '详细程度',
  1480. 'zh-Hant': '詳細程度',
  1481. 'ja': '詳細度',
  1482. 'fi': 'Monisanaisuus',
  1483. 'tr': 'Ayrıntı',
  1484. 'el': 'Πολυλογία',
  1485. 'ru': 'Многословие',
  1486. 'uk': 'Багатослівність',
  1487. 'bg': 'Многословие',
  1488. 'defaultValue': '1',
  1489. },
  1490.  
  1491. // - label for display a message if a post is hidden:
  1492. DLG_VERBOSITY_MESSAGE: {
  1493. 'en': 'Display a message if a post is hidden',
  1494. 'pt': 'Exibir uma mensagem se uma postagem estiver oculta',
  1495. 'de': 'Nachricht anzeigen, wenn ein Beitrag ausgeblendet ist',
  1496. 'fr': 'Afficher un message si une publication est masquée',
  1497. 'es': 'Mostrar un mensaje si una publicación está oculta',
  1498. 'cs': 'Zobrazit zprávu, pokud je příspěvek skrytý',
  1499. 'vi': 'Hiển thị một tin nhắn nếu một bài đăng bị ẩn',
  1500. 'it': 'Visualizza un messaggio se un post è nascosto',
  1501. 'lv': 'Parādīt ziņojumu, ja raksts ir paslēpts',
  1502. 'pl': 'Wyświetlaj wiadomość, jeśli wpis jest ukryty',
  1503. 'nl': 'Een bericht weergeven als een artikel verborgen is',
  1504. 'he': 'הצג הודעה אם פוסט מוסתר',
  1505. 'ar': 'اعرض رسالة إذا كانت المشاركة مخفية',
  1506. 'id': 'Tampilkan pesan jika kiriman disembunyikan',
  1507. 'zh-Hans': '如果帖子被隐藏,则显示消息',
  1508. 'zh-Hant': '如果貼文被隱藏,則顯示訊息',
  1509. 'ja': '投稿が非表示の場合にメッセージを表示する',
  1510. 'fi': 'Näytä viesti, jos postaus on piilotettu',
  1511. 'tr': 'Bir gönderi gizlenmişse bir mesaj göster',
  1512. 'el': 'Εμφάνιση μηνύματος αν ένας δημοσίευση είναι κρυμμένη',
  1513. 'ru': 'Показывать сообщение, если пост скрыт',
  1514. 'uk': 'Відображати повідомлення, якщо публікація прихована',
  1515. 'bg': 'Показване на съобщение, ако публикацията е скрита',
  1516. },
  1517.  
  1518. // - Verbosity - say nothing:
  1519. VERBOSITY_NO_MESSAGE: {
  1520. 'en': 'no message',
  1521. 'pt': 'nenhuma mensagem',
  1522. 'de': 'keine Nachricht',
  1523. 'fr': 'pas de message',
  1524. 'es': 'Sin mensaje',
  1525. 'cs': 'žádná zpráva',
  1526. 'vi': 'không có tin nhắn',
  1527. 'it': 'Nessun messaggio',
  1528. 'lv': 'Nekādu ziņojumu',
  1529. 'pl': 'nie ma wiadomości',
  1530. 'nl': 'geen bericht',
  1531. 'he': 'אין הודעה',
  1532. 'ar': 'لا توجد رسالة',
  1533. 'id': 'tidak ada pesan',
  1534. 'zh-Hans': '没有消息',
  1535. 'zh-Hant': '不要顯示訊息',
  1536. 'ja': 'メッセージなし',
  1537. 'fi': 'ei viestiä',
  1538. 'tr': 'esaj yok',
  1539. 'el': 'Κανένα μήνυμα',
  1540. 'ru': 'сообщение отсутствует',
  1541. 'uk': 'немає повідомлення',
  1542. 'bg': 'Без съобщение',
  1543. },
  1544.  
  1545. // - notification
  1546. VERBOSITY_MESSAGE: {
  1547. 'en': ['1 post hidden. Rule: ', ' posts hidden'],
  1548. 'pt': ['1 postagem oculta. Regra: ', ' postagens ocultas'],
  1549. 'de': ['1 Beitrag ausgeblendet. Regel: ', ' Beiträge versteckt'],
  1550. 'fr': ['1 poste caché. Règle: ', ' posts cachés'],
  1551. 'es': ['1 publicación oculta. Regla: ', ' publicaciones ocultas'],
  1552. 'cs': ['1 příspěvek byl skryt. Pravidlo: ', ' příspěvků skrytých'],
  1553. 'vi': ['1 bài bị ẩn. Quy tắc: ', ' bài viết ẩn'],
  1554. 'it': ['1 post nascosto Regola: ', ' post nascosti'],
  1555. 'lv': ['1 ziņa ir paslēpta. Noteikums: ', ' ziņas ir paslēptas'],
  1556. 'pl': ['Ukryto 1 post. Reguła: ', ' posty ukryte'],
  1557. 'nl': ['1 post verborgen. Regel: ', ' posts verborgen'],
  1558. 'he': ['פוסט אחד מוסתר. כלל: ', ' פוסטים מוסתרים'],
  1559. 'ar': ['مشاركة واحدة مخفية. حكم: ', ' المشاركات المخفية'],
  1560. 'id': ['1 pos disembunyikan. Aturan: ', ' postingan disembunyikan'],
  1561. 'zh-Hans': ['1 个帖子已隐藏。 规则: ', ' 个帖子已隐藏'],
  1562. 'zh-Hant': ['1 個貼文已隱藏。 規則: ', ' 個貼文已隱藏'],
  1563. 'ja': ['1 件の投稿が非表示になっています。 ルール: ', ' 件の投稿が非表示'],
  1564. 'fi': ['1 viesti piilotettu. Sääntö: ', ' viestiä piilotettu'],
  1565. 'tr': ['1 gönderi gizlendi. Kural: ', ' gönderi gizlendi'],
  1566. 'el': ['1 δημοσίευση κρυμμένη. Κανόνας: ', ' δημοσιεύσεις κρυμμένες'],
  1567. 'ru': ['1 пост скрыт. Правило: ', ' постов скрыто'],
  1568. 'uk': ['1 допис прихований. Правило: ', ' дописи приховано'],
  1569. 'bg': ['1 скрита публикация. Правило: ', ' скрити публикации'],
  1570. },
  1571.  
  1572. // - colour of the verbosity message:
  1573. VERBOSITY_MESSAGE_COLOUR: {
  1574. 'en': 'Text colour',
  1575. 'pt': 'Cor do texto',
  1576. 'de': 'Textfarbe',
  1577. 'fr': 'Couleur du texte',
  1578. 'es': 'Color del texto',
  1579. 'cs': 'Barva textu',
  1580. 'vi': 'Màu văn bản',
  1581. 'it': 'Colore del testo',
  1582. 'lv': 'Teksta krāsa',
  1583. 'pl': 'Kolor tekstu',
  1584. 'nl': 'Tekstkleur',
  1585. 'he': 'צבע טקסט',
  1586. 'ar': 'لون النص',
  1587. 'id': 'Warna teks',
  1588. 'zh-Hans': '文字颜色',
  1589. 'zh-Hant': '文字顏色',
  1590. 'ja': 'テキストの色',
  1591. 'fi': 'Tekstin väri',
  1592. 'tr': 'Metin rengi',
  1593. 'el': 'Χρώμα κειμένου',
  1594. 'ru': 'Цвет текста',
  1595. 'uk': 'Колір тексту',
  1596. 'bg': 'Цвят на текста',
  1597. },
  1598.  
  1599. // - background colour of the verbosity message:
  1600. VERBOSITY_MESSAGE_BG_COLOUR: {
  1601. 'en': 'Background colour',
  1602. 'pt': 'Cor de fundo',
  1603. 'de': 'Hintergrundfarbe',
  1604. 'fr': 'Couleur de fond',
  1605. 'es': 'Color de fondo',
  1606. 'cs': 'Barva pozadí',
  1607. 'vi': 'Màu nền',
  1608. 'it': 'Colore di sfondo',
  1609. 'lv': 'Fona krāsa',
  1610. 'pl': 'Kolor tła',
  1611. 'nl': 'Achtergrondkleur',
  1612. 'he': 'צבע הרקע',
  1613. 'ar': 'لون الخلفية',
  1614. 'id': 'Warna latar belakang',
  1615. 'zh-Hans': '背景颜色',
  1616. 'zh-Hant': '背景顏色',
  1617. 'ja': '背景色',
  1618. 'fi': 'Taustaväri',
  1619. 'tr': 'Arka plan rengi',
  1620. 'el': 'Χρώμα φόντου',
  1621. 'ru': 'Цвет фона',
  1622. 'uk': 'Колір фону',
  1623. 'bg': 'Цвят на фона',
  1624. 'defaultValue': 'LightGrey',
  1625. },
  1626.  
  1627. // - debugging - show "hidden" posts
  1628. VERBOSITY_DEBUG: {
  1629. 'en': 'Highlight "hidden" posts',
  1630. 'pt': 'Destacar postagens "ocultas"',
  1631. 'de': 'Markieren Sie "versteckte" Beiträge',
  1632. 'fr': 'Mettez en surbrillance les messages « cachés »',
  1633. 'es': 'Destacar publicaciones "ocultas"',
  1634. 'cs': 'Zvýrazněte „skryté“ příspěvky',
  1635. 'vi': 'Đánh dấu các bài đăng "ẩn"',
  1636. 'it': 'Evidenzia i post "nascosti"',
  1637. 'lv': 'Izceliet "slēptos" rakstus',
  1638. 'pl': 'Wyróżnij „ukryte” posty',
  1639. 'nl': 'Highlight "verborgen" artikelen',
  1640. 'he': 'הדגש פוסטים "מוסתרים"',
  1641. 'ar': 'تسليط الضوء على المشاركات "المخفية"',
  1642. 'id': 'Sorot postingan "tersembunyi"',
  1643. 'zh-Hans': '突出显示“隐藏”的帖子',
  1644. 'zh-Hant': '強調顯示「隱藏」的貼文',
  1645. 'ja': '「非表示」の投稿を強調表示する',
  1646. 'fi': 'Korosta "piilotetut" postaus',
  1647. 'tr': '"Gizli" gönderileri vurgulayın',
  1648. 'el': 'Επισήμανση "κρυφών αναρτήσεων"',
  1649. 'ru': 'Выделить «скрытые» посты',
  1650. 'uk': '«Виділяти «приховані» дописи»',
  1651. 'bg': 'Открояване на скритите публикации',
  1652. 'defaultValue': false,
  1653. },
  1654.  
  1655. // - customisation of cmf's dialog box:
  1656. CMF_CUSTOMISATIONS: {
  1657. 'en': 'Customisations',
  1658. 'pt': 'Personalizações',
  1659. 'de': 'Anpassungen',
  1660. 'fr': 'Personnalisations',
  1661. 'es': 'Personalizaciones',
  1662. 'cs': 'Přizpůsobení',
  1663. 'vi': 'Các tùy chỉnh',
  1664. 'it': 'Personalizzazioni',
  1665. 'lv': 'Personalizēšana',
  1666. 'pl': 'Personalizacja',
  1667. 'nl': 'Personalisaties',
  1668. 'he': 'התאמות אישיות',
  1669. 'ar': 'التخصيصات',
  1670. 'id': 'Kustomisasi',
  1671. 'zh-Hans': '定制化',
  1672. 'zh-Hant': '客製化',
  1673. 'ja': 'カスタマイズ',
  1674. 'fi': 'Räätälöinnit',
  1675. 'tr': 'özelleştirmeler',
  1676. 'el': 'Προσαρμογές',
  1677. 'ru': 'Настройки',
  1678. 'uk': 'Налаштування',
  1679. 'bg': 'Настройки',
  1680. },
  1681.  
  1682. // - label for location of button:
  1683. CMF_BTN_LOCATION: {
  1684. 'en': 'Location of Clean my feeds\' button',
  1685. 'pt': 'Localização do botão Limpe meus feeds',
  1686. 'de': 'Position der Schaltfläche "Bereinige meine Feeds"',
  1687. 'fr': 'Emplacement du bouton Nettoyer mes flux',
  1688. 'es': 'Ubicación del botón Limpia mis feeds',
  1689. 'cs': 'Umístění tlačítka Vyčistěte mé kanály',
  1690. 'vi': 'Vị trí của nút Làm sạch nguồn cấp dữ liệu của tôi',
  1691. 'it': 'Posizione del pulsante Pulisci i miei feed',
  1692. 'lv': 'Pogas Tīrīt manas plūsmas atrašanās vieta',
  1693. 'pl': 'Lokalizacja przycisku Wyczyść moje kanały',
  1694. 'nl': 'Locatie van de knop Mijn feeds opschonen',
  1695. 'he': 'תנקה את הזנות שלי מיקום הכפתור',
  1696. 'ar': 'موقع الزر "تنظيف خلاصاتي"',
  1697. 'id': 'Lokasi tombol Bersihkan umpan saya',
  1698. 'zh-Hans': '“清理我的提要”按钮位置',
  1699. 'zh-Hant': '「清理我的動態消息」按鈕的位置',
  1700. 'ja': '「フィードをクリーンアップ」ボタンの配置',
  1701. 'fi': 'Puhdista syötteeni -painikkeen sijainti',
  1702. 'tr': '"Feed\'lerimi temizle" için düğmenin konumu',
  1703. 'el': 'Τοποθεσία του κουμπιού "Καθαρισμός των ροών μου"',
  1704. 'ru': 'Расположение кнопки «Очистить мои новостные ленты»',
  1705. 'uk': 'Розташування кнопки «Очистити мої стрічки»',
  1706. 'bg': 'Местоположение на бутона "Почисти моите емисии"',
  1707. },
  1708.  
  1709. // - location of button:
  1710. CMF_BTN_OPTION: {
  1711. 'en': ['bottom left', 'top right', 'disabled (use "Settings" in User Script Commands menu")'],
  1712. 'pt': ['inferior esquerdo', 'superior direito', 'desativado (use "Configurações" no menu Comandos de script do usuário)'],
  1713. 'de': ['unten links', 'oben rechts', 'deaktiviert (verwenden Sie "Einstellungen" im Menü "Benutzerskriptbefehle")'],
  1714. 'fr': ['en bas à gauche', 'en haut à droite', 'désactivé (utilisez "Paramètres" dans le menu Commandes de script utilisateur)'],
  1715. 'es': ['abajo a la izquierda', 'arriba a la derecha', 'deshabilitado (use "Configuración" en el menú Comandos de script de usuario)'],
  1716. 'cs': ['vlevo dole', 'vpravo nahoře', 'zakázáno (použijte "Nastavení" v nabídce Příkazy uživatelského skriptu)'],
  1717. 'vi': ['dưới cùng bên trái', 'trên cùng bên phải', 'bị vô hiệu hóa (sử dụng "Cài đặt" trong menu Lệnh của Tập lệnh Người dùng)'],
  1718. 'it': ['in basso a sinistra', 'in alto a destra', 'disabilitato (usa "Impostazioni" nel menu Comandi script utente)'],
  1719. 'lv': ['apakšējā kreisajā stūrī', 'augšējā labajā stūrī', 'atspējota (lietotāja skripta komandu izvēlnē izmantojiet sadaļu Iestatījumi)'],
  1720. 'pl': ['lewy dolny róg', 'prawy górny róg', 'wyłączone (użyj "Ustawienia" w menu Polecenia skryptu użytkownika)'],
  1721. 'nl': ['linksonder', 'rechtsboven', 'uitgeschakeld (gebruik "Instellingen" in het menu Gebruikersscriptopdrachten)'],
  1722. 'he': ['שמאל למטה', 'ימינה למעלה', 'מושבת (השתמש ב"הגדרות" בתפריט פקודות סקריפט משתמש)'],
  1723. 'ar': ['أسفل اليسار', 'أعلى اليمين', 'معطل (استخدم "الإعدادات" في قائمة أوامر البرنامج النصي للمستخدم)'],
  1724. 'id': ['kiri bawah', 'kanan atas', 'dinonaktifkan (gunakan "Pengaturan" di menu Perintah Skrip Pengguna)'],
  1725. 'zh-Hans': ['左下方', '右上', '禁用(使用用户脚本命令菜单中的“设置”)'],
  1726. 'zh-Hant': ['左下方', '右上方', '禁用(在用户脚本命令菜单中使用“设置”)'],
  1727. 'ja': ['下左', '上右', '無効 ([ユーザー スクリプト コマンド] メニューの [設定] を使用)'],
  1728. 'fi': ['alhaalla vasemmalla', 'ylhäällä oikealle', 'pois käytöstä (käytä "Asetukset" User Script Commands -valikossa)'],
  1729. 'tr': ['sol alt', 'sağ üst', 'devre dışı (Kullanıcı Komut Dosyası Komutları menüsünde "Ayarlar"ı kullanın)'],
  1730. 'el': ['κάτω αριστερά', 'πάνω δεξιά', 'απενεργοποιημένο (χρησιμοποιήστε "Ρυθμίσεις" στο μενού "Εντολές σεναρίου χρήστη")'],
  1731. 'ru': ['внизу слева', 'вверху справа', 'отключено (используйте «Настройки» в меню «Пользовательские команды скрипта»)'],
  1732. 'uk': ['внизу ліворуч', 'вгорі праворуч', 'вимкнено (використовуйте «Параметри» в меню команд сценарію користувача»)'],
  1733. 'bg': ['долу вляво', 'горе вдясно', 'деактивирано (използвайте "Настройки" в менюто с команди за потребителски сценарии)'],
  1734. 'defaultValue': '0',
  1735. },
  1736. // - script manager's menu item "Settings"
  1737. GM_MENU_SETTINGS: {
  1738. 'en': 'Settings',
  1739. 'pt': 'Configurações',
  1740. 'de': 'Einstellungen',
  1741. 'fr': 'Paramètres',
  1742. 'es': 'Configuración',
  1743. 'cs': 'Nastavení',
  1744. 'vi': 'Cài đặt',
  1745. 'it': 'Impostazioni',
  1746. 'lv': 'Iestatījumi',
  1747. 'pl': 'Ustawienia',
  1748. 'nl': 'Instellingen',
  1749. 'he': 'ההגדרות',
  1750. 'ar': 'الإعدادات',
  1751. 'id': 'Pengaturan',
  1752. 'zh-Hans': '设置',
  1753. 'zh-Hant': '設置',
  1754. 'ja': '設定',
  1755. 'fi': 'Asetukset',
  1756. 'tr': 'Ayarlar',
  1757. 'el': 'Ρυθμίσεις',
  1758. 'ru': 'Настройки',
  1759. 'uk': 'Параметри',
  1760. 'bg': 'Настройки',
  1761. },
  1762.  
  1763. // - label for location of dialog:
  1764. CMF_DIALOG_LOCATION: {
  1765. 'en': 'Location of Clean my feeds\' dialog box',
  1766. 'pt': 'Localização da caixa de diálogo Limpe meus feeds',
  1767. 'de': 'Position des Dialogfelds "Bereinige meine Feeds"',
  1768. 'fr': 'Emplacement de la boîte de dialogue Nettoyer mes flux',
  1769. 'es': 'Ubicación del cuadro de diálogo Limpia mis feeds',
  1770. 'cs': 'Umístění dialogového okna Vyčistěte mé kanály',
  1771. 'vi': 'Vị trí của hộp thoại Làm sạch nguồn cấp dữ liệu của tôi',
  1772. 'it': 'Posizione della finestra di dialogo Pulisci i miei feed',
  1773. 'lv': 'Dialoglodziņa Tīrīt manas plūsmas atrašanās vieta',
  1774. 'pl': 'Lokalizacja okna dialogowego Wyczyść moje kanały',
  1775. 'nl': 'Locatie van het dialoogvenster Mijn feeds opschonen',
  1776. 'he': 'מיקום תיבת הדו-שיח "נקה את ההזנות שלי"',
  1777. 'ar': 'موقع مربع الحوار "تنظيف موجز ويباتي"',
  1778. 'id': 'Lokasi kotak dialog Bersihkan umpan saya',
  1779. 'zh-Hans': '“清理我的提要”对话框位置',
  1780. 'zh-Hant': '「清理我的動態消息」對話框的位置',
  1781. 'ja': '[フィードの消去] ダイアログ ボックスの配置',
  1782. 'fi': 'Puhdista syötteeni -valintaikkunan sijainti',
  1783. 'tr': '"Feed\'lerimi temizle" iletişim kutusunun konumu',
  1784. 'el': 'Τοποθεσία της διαλόγου "Καθαρισμός των ροών μου"',
  1785. 'ru': 'Расположение диалогового окна «Очистить мои ленты»',
  1786. 'uk': 'Розташування діалогового вікна «Очистити мої стрічки»',
  1787. 'bg': 'Местоположение на диалоговия прозорец "Почисти моите емисии"',
  1788. },
  1789.  
  1790. // - location of dialog:
  1791. CMF_DIALOG_OPTION: {
  1792. 'en': ['left side', 'right side'],
  1793. 'pt': ['lado esquerdo', 'lado direito'],
  1794. 'de': ['linke Seite', 'rechte Seite'],
  1795. 'fr': ['côté gauche', 'côté droit'],
  1796. 'es': ['lado izquierdo', 'lado derecho'],
  1797. 'cs': ['levá strana', 'pravá strana'],
  1798. 'vi': ['bên trái', 'bên phải'],
  1799. 'it': ['lato sinistro', 'lato destro'],
  1800. 'lv': ['kreisā puse', 'labā puse'],
  1801. 'pl': ['lewa strona', 'prawa strona'],
  1802. 'nl': ['linkerkant', 'rechterkant'],
  1803. 'he': ['צד שמאל', 'צד ימין'],
  1804. 'ar': ['الجهه اليسرى', 'الجانب الصحيح'],
  1805. 'id': ['sisi kiri', 'sisi kanan'],
  1806. 'zh-Hans': ['左边', '右边'],
  1807. 'zh-Hant': ['左邊', '右邊'],
  1808. 'ja': ['左側', '右側'],
  1809. 'fi': ['vasen puoli', 'oikea puoli'],
  1810. 'tr': ['sol yan', 'sağ yan'],
  1811. 'el': ['αριστερή πλευρά', 'δεξιά πλευρά'],
  1812. 'ru': ['левая сторона', 'правая сторона'],
  1813. 'uk': ['ліва сторона', 'права сторона'],
  1814. 'bg': ['лява страна', 'дясна страна'],
  1815. 'defaultValue': '0',
  1816. },
  1817.  
  1818. // - colour of the dialog's text:
  1819. CMF_DIALOG_COLOUR: {
  1820. 'en': 'Text colour',
  1821. 'pt': 'Cor do texto',
  1822. 'de': 'Textfarbe',
  1823. 'fr': 'Couleur du texte',
  1824. 'es': 'Color del texto',
  1825. 'cs': 'Barva textu',
  1826. 'vi': 'Màu văn bản',
  1827. 'it': 'Colore del testo',
  1828. 'lv': 'Teksta krāsa',
  1829. 'pl': 'Kolor tekstu',
  1830. 'nl': 'Tekstkleur',
  1831. 'he': 'צבע טקסט',
  1832. 'ar': 'لون النص',
  1833. 'id': 'Warna teks',
  1834. 'zh-Hans': '文字颜色',
  1835. 'zh-Hant': '文字顏色',
  1836. 'ja': 'テキストの色',
  1837. 'fi': 'Tekstin väri',
  1838. 'tr': 'Metin rengi',
  1839. 'el': 'Χρώμα κειμένου',
  1840. 'ru': 'Цвет текста',
  1841. 'uk': 'Колір тексту',
  1842. 'bg': 'Цвят на текста',
  1843. 'defaultValue': '',
  1844. },
  1845.  
  1846. // - background colour of the dialog:
  1847. CMF_DIALOG_BG_COLOUR: {
  1848. 'en': 'Background colour',
  1849. 'pt': 'Cor de fundo',
  1850. 'de': 'Hintergrundfarbe',
  1851. 'fr': 'Couleur de fond',
  1852. 'es': 'Color de fondo',
  1853. 'cs': 'Barva pozadí',
  1854. 'vi': 'Màu nền',
  1855. 'it': 'Colore di sfondo',
  1856. 'lv': 'Fona krāsa',
  1857. 'pl': 'Kolor tła',
  1858. 'nl': 'Achtergrondkleur',
  1859. 'he': 'צבע הרקע',
  1860. 'ar': 'لون الخلفية',
  1861. 'id': 'Warna latar belakang',
  1862. 'zh-Hans': '背景颜色',
  1863. 'zh-Hant': '背景顏色',
  1864. 'ja': '背景色',
  1865. 'fi': 'Taustaväri',
  1866. 'tr': 'Arka plan rengi',
  1867. 'el': 'Χρώμα φόντου',
  1868. 'ru': 'Цвет фона',
  1869. 'uk': 'Колір фону',
  1870. 'bg': 'Цвят на фона',
  1871. 'defaultValue': '',
  1872. },
  1873.  
  1874. // - dialog's border colour:
  1875. CMF_BORDER_COLOUR: {
  1876. 'en': 'Border colour',
  1877. 'pt': 'Cor da borda',
  1878. 'de': 'Farbe der Umrandung',
  1879. 'fr': 'Couleur de bordure',
  1880. 'es': 'Color de borde',
  1881. 'cs': 'Barva ohraničení',
  1882. 'vi': 'Màu viền',
  1883. 'it': 'Colore del bordo',
  1884. 'lv': 'Apmales krāsa',
  1885. 'pl': 'Kolor obramowania',
  1886. 'nl': 'Randkleur',
  1887. 'he': 'צבע גבול',
  1888. 'ar': 'لون الحدود',
  1889. 'id': 'Warna perbatasan',
  1890. 'zh-Hans': '边框颜色',
  1891. 'zh-Hant': '邊框顏色',
  1892. 'ja': 'ボーダーカラー',
  1893. 'fi': 'Reunuksen väri',
  1894. 'tr': 'Kenarlık rengi',
  1895. 'el': 'Χρώμα περιγράμματος',
  1896. 'ru': 'Цвет границы',
  1897. 'uk': 'Колір кордону',
  1898. 'bg': 'Цвят на рамката',
  1899. 'defaultValue': 'OrangeRed',
  1900. },
  1901.  
  1902. // - label for tips:
  1903. DLG_TIPS: {
  1904. 'en': 'Tips',
  1905. 'pt': 'Pontas',
  1906. 'de': 'Tipps',
  1907. 'fr': 'Des astuces',
  1908. 'es': 'Consejos',
  1909. 'cs': 'Tipy',
  1910. 'vi': 'Thủ thuật',
  1911. 'it': 'Suggerimenti',
  1912. 'lv': 'Padomi',
  1913. 'pl': 'Sugestia',
  1914. 'nl': 'Tips',
  1915. 'he': 'טיפים',
  1916. 'ar': 'تلميحات',
  1917. 'id': 'Tips',
  1918. 'zh-Hans': '提示',
  1919. 'zh-Hant': '提示',
  1920. 'ja': 'ヒント',
  1921. 'fi': 'Vinkkejä',
  1922. 'tr': 'Ipuçları',
  1923. 'el': 'Συμβουλές',
  1924. 'ru': 'Советы',
  1925. 'uk': 'Підказки',
  1926. 'bg': 'Съвети',
  1927. },
  1928.  
  1929. // - tip's content:
  1930. DLG_TIPS_CONTENT: {
  1931. 'en': 'Clearing your browser\'s cache will reset your settings to their default values.\n\nUse the "Export" and "Import" buttons to backup and restore your customised settings.',
  1932. 'pt': 'Limpar o cache do navegador redefinirá suas configurações para os valores padrão.\n\nUse os botões "Exportar" e "Importar" para fazer backup e restaurar suas configurações personalizadas.',
  1933. 'de': 'Wenn Sie den Cache Ihres Browsers leeren, werden Ihre Einstellungen auf die Standardwerte zurückgesetzt.\n\nVerwenden Sie die Schaltflächen "Exportieren" und "Importieren", um Ihre benutzerdefinierten Einstellungen zu sichern und wiederherzustellen.',
  1934. 'fr': 'Vider le cache de votre navigateur réinitialisera vos paramètres à leurs valeurs par défaut.\n\nUtilisez les boutons "Exporter" et "Importer" pour sauvegarder et restaurer vos paramètres personnalisés.',
  1935. 'es': 'Limpiar la memoria caché de su navegador restablecerá la configuración a sus valores predeterminados.\n\nUtilice los botones "Exportar" e "Importar" para hacer una copia de seguridad y restaurar su configuración personalizada.',
  1936. 'cs': 'Vymazáním mezipaměti prohlížeče obnovíte výchozí hodnoty nastavení.\n\nPomocí tlačítek "Export" a "Import" zálohujte a obnovte svá přizpůsobená nastavení.',
  1937. 'vi': 'Xóa bộ nhớ cache của trình duyệt sẽ đặt lại cài đặt của bạn về các giá trị mặc định của chúng.\n\nSử dụng các nút "Xuất" và "Nhập" để sao lưu và khôi phục cài đặt tùy chỉnh của bạn.',
  1938. 'it': 'La cancellazione della cache del browser ripristinerà le impostazioni ai valori predefiniti.\n\nUtilizza i pulsanti "Esporta" e "Importa" per eseguire il backup e ripristinare le impostazioni personalizzate.',
  1939. 'lv': 'Iztīrot pārlūkprogrammas kešatmiņu, iestatījumi tiks atiestatīti uz noklusējuma vērtībām.\n\nIzmantojiet pogas "Eksportēt" un "Importēt", lai dublētu un atjaunotu pielāgotos iestatījumus.',
  1940. 'pl': 'Wyczyszczenie pamięci podręcznej przeglądarki spowoduje zresetowanie ustawień do wartości domyślnych.\n\nUżyj przycisków „Eksportuj” i „Importuj”, aby wykonać kopię zapasową i przywrócić niestandardowe ustawienia.',
  1941. 'nl': 'Als u de cache van uw browser wist, worden uw instellingen teruggezet naar hun standaardwaarden.\n\nGebruik de knoppen "Exporteren" en "Importeren" om een back-up te maken van uw aangepaste instellingen en deze te herstellen.',
  1942. 'he': 'מחיקת ההיסטורה בדפדפן תנקה את ההגדרות ותחזיר אותם לברירת המחדל.\n\nהשתמש ב"ייצא" ו"ייבא" כדי לגבות ולהחזיר את ההגדרות שלך',
  1943. 'ar': 'سيؤدي مسح ذاكرة التخزين المؤقت للمتصفح إلى إعادة تعيين الإعدادات إلى قيمها الافتراضية.\n\nاستخدم الزرين "تصدير" و "استيراد" للنسخ الاحتياطي واستعادة الإعدادات المخصصة.',
  1944. 'id': 'Menghapus cache browser Anda akan mengatur ulang pengaturan Anda ke nilai defaultnya.\n\nGunakan tombol "Ekspor" dan "Impor" untuk mencadangkan dan memulihkan pengaturan khusus Anda.',
  1945. 'zh-Hans': '清除浏览器缓存会将您的设置重置为默认值。\n\n使用“导出”和“导入”按钮来备份和恢复您的自定义设置。',
  1946. 'zh-Hant': '清除瀏覽器快取會將您的設定重置為預設值。\n\n使用「匯出」和「匯入」按鈕來備份和回復您的自定義設定。',
  1947. 'ja': 'ブラウザのキャッシュをクリアすると、設定がデフォルト値にリセットされます。\n\n[エクスポート] および [インポート] ボタンを使用して、カスタマイズした設定をバックアップおよび復元します。',
  1948. 'fi': 'Selaimen välimuistin tyhjentäminen palauttaa asetuksesi oletusarvoihinsa.\n\nKäytä "Vie"- ja "Tuo"-painikkeita varmuuskopioidaksesi ja palauttaaksesi mukautetut asetukset.',
  1949. 'tr': 'Tarayıcınızın önbelleğini temizlemek, ayarlarınızı varsayılan değerlerine sıfırlayacaktır. \n\nÖzelleştirilmiş ayarlarınızı yedeklemek ve geri yüklemek için "Dışa Aktar" ve "İçe Aktar" düğmelerini kullanın.',
  1950. 'el': 'Η εκκαθάριση της μνήμης cache του προγράμματος περιήγησης θα επαναφέρει τις ρυθμίσεις σας στις προεπιλεγμένες τιμές τους.\n\nΧρησιμοποιήστε τα κουμπιά "Εξαγωγή" και "Εισαγωγή" για να δημιουργήσετε αντίγραφο ασφαλείας και να επαναφέρετε τις εξατομικευμένες ρυθμίσεις σας.',
  1951. 'ru': 'Очистка кэша браузера сбросит ваши настройки на значения по умолчанию.\n\nИспользуйте кнопки «Экспорт» и «Импорт», чтобы создать резервную копию и восстановить ваши настройки.',
  1952. 'uk': 'Очищення кешу браузера призведе до скидання налаштувань до значень за замовчуванням.\n\nВикористовуйте кнопки «Експорт» та «Імпорт», щоб створити резервну копію та відновити налаштовані налаштування.',
  1953. 'bg': 'Изчистването на кеша на браузъра ще нулира настройките ви до техните стандартни стойности.\n\nИзползвайте бутоните "Експорт" и "Импорт", за да запазите и възстановите персонализираните си настройки.'
  1954. },
  1955.  
  1956. DLG_BUTTONS: {
  1957. 'en': ['Save', 'Close', 'Export', 'Import', 'Reset'],
  1958. 'pt': ['Salvar', 'Fechar', 'Exportar', 'Importar', 'Redefinir'],
  1959. 'de': ['Speichern', 'Schließen', 'Exportieren', 'Importieren', 'Zurücksetzen'],
  1960. 'fr': ['Sauvegarder', 'Fermer', 'Exporter', 'Importer', 'Réinitialiser'],
  1961. 'es': ['Guardar', 'Cerrar', 'Exportar', 'Importar', 'Reajustar'],
  1962. 'cs': ['Uložit', 'Zavřít', 'Export', 'Import', 'Resetovat'],
  1963. 'vi': ['Lưu', 'Đóng', 'Xuất', 'Nhập', 'Đặt lại'],
  1964. 'it': ['Salva', 'Chiudi', 'Esportare', 'Importare', 'Ripristina'],
  1965. 'lv': ['Saglabājiet', 'Aizveriet', 'Eksportēt', 'Importēt', 'Atiestatīt'],
  1966. 'pl': ['Zapisz', 'Zamknij', 'Eksport', 'Import', 'Przeskładać'],
  1967. 'nl': ['Opslaan', 'Sluiten', 'Exporteren', 'Importeren', 'Reset'],
  1968. 'he': ['שמור', 'סגור', 'ייצא', 'ייבא', 'איפוס'],
  1969. 'ar': ['حفظ', 'قريب', 'يصدّر', 'يستورد', 'إعادة تعيين'],
  1970. 'id': ['Simpan', 'Tutup', 'Ekspor', 'Impor', 'Reset'],
  1971. 'zh-Hans': ['节省', '关', '出口', '进口', '重置'],
  1972. 'zh-Hant': ['儲存', '關閉', '匯出', '匯入', '重設'],
  1973. 'ja': ['セーブ', 'クローズ', '輸出する', '輸入', 'リセット'],
  1974. 'fi': ['Tallentaa', 'Sulkea', 'Vienti', 'Tuonti', 'Nollaa'],
  1975. 'tr': ['Kaydetmek', 'Kapat', 'İhracat', 'İçe aktarmak', 'Sıfırla'],
  1976. 'el': ['Αποθήκευση', 'Κλείσιμο', 'Εξαγωγή', 'Εισαγωγή', 'Επαναφορά'],
  1977. 'ru': ['Сохранить', 'Закрыть', 'Экспорт', 'Импорт', 'Сброс'],
  1978. 'uk': ['Зберегти', 'Закрити', 'Експорт', 'Імпорт', 'Скинути'],
  1979. 'bg': ['Запази', 'Затвори', 'Експорт', 'Импорт', 'Нулиране'],
  1980. },
  1981.  
  1982. DLG_FB_COLOUR_HINT: {
  1983. 'en': 'Leave blank to use FB\'s colour scheme',
  1984. 'pt': 'Deixe em branco para usar o esquema de cores do FB',
  1985. 'de': 'Leer lassen, um das Farbschema von FB zu verwenden',
  1986. 'fr': 'Laissez vide pour utiliser le jeu de couleurs de FB',
  1987. 'es': 'Dejar en blanco para usar el esquema de color de FB',
  1988. 'cs': 'Chcete-li použít barevné schéma FB, nechte prázdné',
  1989. 'vi': 'Để trống để sử dụng bảng màu của FB',
  1990. 'it': 'Lascia vuoto per usare la combinazione di colori di FB',
  1991. 'lv': 'Atstājiet tukšu, lai izmantotu FB krāsu shēmu',
  1992. 'pl': 'Pozostaw puste, aby użyć schematu kolorów FB',
  1993. 'nl': 'Laat leeg om het kleurenschema van FB te gebruiken',
  1994. 'he': 'השאר ריק כדי להשתמש בערכת הצבעים של FB',
  1995. 'ar': 'اتركه فارغًا لاستخدام نظام ألوان FB',
  1996. 'id': 'Biarkan kosong untuk menggunakan skema warna FB',
  1997. 'zh-Hans': '留空以使用 FB 的配色方案',
  1998. 'zh-Hant': '留空以使用 FB 的配色方案',
  1999. 'ja': '空白のままにすると、FB の配色が使用されます',
  2000. 'fi': 'Jätä tyhjäksi käyttääksesi FB:n värimaailmaa',
  2001. 'tr': 'FB\'un renk düzenini kullanmak için boş bırakın',
  2002. 'el': 'Αφήστε κενό για να χρησιμοποιήσετε το χρωματικό σχήμα του FB',
  2003. 'ru': 'Оставьте пустым, чтобы использовать цветовую схему FB',
  2004. 'uk': 'Залиште порожнім, щоб використовувати колірну схему FB',
  2005. 'bg': 'Оставете празно, за да използвате цветовата схема на FB',
  2006. }
  2007. };
  2008.  
  2009. // *** *** end of language components *** ***
  2010.  
  2011. // - console log "label" - used for filtering console logs.
  2012. const log = '-- fbcmf :: ';
  2013.  
  2014. // - idb-keyval - indexedDB wrapper
  2015. // -- needs the "@require https://unpkg.com/idb-keyval@6.0.3/dist/umd.js" entry.
  2016. // -- which functions do we want to use from the idb-keyval?
  2017. const { get, set, del, createStore } = idbKeyval;
  2018. // - override idb-keyval's default db and store names.
  2019. let DBVARS = {
  2020. DBName: 'dbCMF',
  2021. DBStore: 'Mopping',
  2022. DBKey: 'Options',
  2023. ostore: null
  2024. }
  2025. // - make sure the db's store exists ...
  2026. DBVARS.ostore = createStore(DBVARS.DBName, DBVARS.DBStore);
  2027.  
  2028. // - post attribute - hidden and reason
  2029. const postAtt = 'cmfrx';
  2030. // - post attribute - consecutive posts id
  2031. const postAttCPID = 'cmfcpid';
  2032. // - post property - # of light dusting duties done
  2033. const postPropDS = 'cmfDusted';
  2034. // - post's child element attribute - used for queries that original don't include the parent element.
  2035. const postAttChildFlag = 'cmfcf';
  2036. // - post's toggle state bar + post tab.
  2037. const postAttTab = 'cmftsb'
  2038. // - marketplace post - indicate already scanned
  2039. const postAttMPSkip = 'cmfsmp';
  2040.  
  2041. // - Feed Details variables
  2042. // -- nb: setFeedSettings() adjusts some of these settings.
  2043. const VARS = {
  2044. // - mutations counter
  2045. mutationsCount: 0,
  2046. // - how many mutations to ignore @ start (usually non-feed elements)
  2047. mutationsInitSkip: 75,
  2048. // - how many times to scan a post
  2049. scanCountStart: 0,
  2050. scanCountMaxLoop: 15, // Nov 2023; changed from 12 to 15, need to make code a tad bit more aggressive.
  2051.  
  2052. // - langauge (default to EN)
  2053. language: '',
  2054. // - user options
  2055. Options: {},
  2056. optionsReady: false,
  2057. // - blocked text
  2058. Filters: {},
  2059. // - blocked text separator
  2060. SEP: '¦¦',
  2061.  
  2062. // - Feed toggles
  2063. isNF: false, // news
  2064. isGF: false, // groups
  2065. isVF: false, // videos
  2066. isMF: false, // marketplace
  2067. isAF: false, // all feeds
  2068. isSF: false, // search feed
  2069. isRF: false, // reel feed
  2070.  
  2071. isRF_InTimeoutMode: false, // -- processing Reel videos in timeout calls instead of mutations
  2072.  
  2073. // groups feed type : 'group' = single group; 'groups' = multiple groups;
  2074. gfType: '',
  2075.  
  2076. // watch/videos feed type : 'vidoes' = normal feed; 'search' = search videos;
  2077. vfType: '',
  2078.  
  2079. // marketplace feed type: 'marketplace' = default view; 'category' = category view; 'item' = viewing an item; 'search' = search results;
  2080. mpType: '',
  2081.  
  2082. // remember current URL - used for page change detection
  2083. prevURL: '',
  2084. prevPathname: '',
  2085.  
  2086. // element containing echo message about post(s) being hidden
  2087. echoEl: null,
  2088. echoElFirstNote: null, // for restoring "missing" echo message
  2089. echoElCreatedCount: 0,
  2090. echoELFirstPost: null,
  2091. // how many consecutive posts have been hidden
  2092. echoCount: 0,
  2093. // current consecutive posts id
  2094. echoCPID: '',
  2095.  
  2096. // StyleSheet Id
  2097. cssID: '',
  2098. // CSS class names
  2099. cssHide: '',
  2100. cssHideEl: '',
  2101. cssEcho: '',
  2102. cssHideNumberOfShares: '',
  2103. cssShow: '',
  2104. // toggle dialog button (visible if is a Feed page)
  2105. btnToggleEl: null,
  2106. // - script's logo
  2107. logoHTML: '<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="32" height="32"><g id="Layer" fill="currentColor"><path id="Layer" fill-rule="evenodd" class="s0" d="m51 3.2c0.7 1.1 0.7 1-1.6 9.2-1.4 5-2.1 7.4-2.3 7.6-0.1 0.1-0.3 0.2-0.6 0.2-0.4 0-0.9-0.4-0.9-0.7 0-0.1 1-3.5 2-7.4 1.2-4 2-7.3 2-7.5 0-0.4-0.6-1-0.9-1-0.2 0-0.5 0.2-0.7 0.3-0.3 0.3-0.7 1.8-5.5 19.2l-5.3 18.9 0.9 0.5c0.5 0.3 0.9 0.5 0.9 0.5 0 0 1.3-4.4 2.8-9.8 1.5-5.3 2.8-10 2.8-10.3 0.2-0.5 0.3-0.7 0.6-0.9 0.3-0.1 0.4-0.1 0.8 0 0.2 0.2 0.4 0.3 0.4 0.5 0.1 0.2-0.4 2.2-1.5 6.1-0.9 3.2-1.6 5.8-1.6 5.9 0 0 0.5 0.1 1.3 0.1 1.9 0 2.7 0.4 3.2 1.5 0.3 0.6 0.3 2.7 0 3.4-0.3 0.9-1.2 1.4-2 1.4-0.3 0-0.5 0.1-0.5 0.1 0 0.2-2.3 20.2-2.3 20.4-0.2 0.8 0.7 0.7-14.1 0.7-15.3 0-14.3 0.1-15.3-1-0.8-0.8-1.1-1.5-1-2.9 0.2-3.6 2.7-6.7 6.3-7.8 0.4-0.2 0.9-0.3 1-0.3 0.6 0 0.6 0.1 0.1-4.5-0.3-2.4-0.5-4.4-0.5-4.5-0.1-0.1-0.3-0.1-0.7-0.2-0.6 0-1.1-0.3-1.6-1-0.3-0.4-0.3-0.5-0.4-1.8 0-1.7 0.1-2.1 0.6-2.7 0.7-0.6 1-0.7 2.5-0.8h1.3v-2.9c0-3.1 0-3.4 0.6-3.6 0.2-0.1 2.4-0.1 7.1-0.1 6.5 0.1 6.9 0.1 7.1 0.3 0.2 0.2 0.2 0.3 0.2 3.3v3h0.6l0.6-0.1 4.3-15.3c2.4-8.5 4.4-15.6 4.5-15.9 0.4-0.6 0.9-1 1.5-1.3 1.2-0.4 2.6 0.1 3.3 1.2zm-26.6 26.6h-0.7c-0.3 0-0.6 0-0.7 0 0 0.1-0.1 1.2-0.1 2.5v2.3h1.5zm3.4 0h-0.7c-0.5 0-0.9 0-0.9 0.1 0 0-0.1 1.1-0.1 2.4v2.3h1.8v-2.4zm3.4 0h-1.6v4.8h1.6zm3.2 0h-1.3v4.8h1.3zm-6.4 6.6c-7.9 0-9 0-9.2 0.2-0.3 0.2-0.3 0.3-0.3 1.3 0 0.7 0.1 1.1 0.2 1.2 0.1 0.1 2.3 0.1 7.3 0.1 6.9 0.1 7.2 0.1 7.5 0.3 0.3 0.3 0.3 1 0 1.3-0.2 0.2-0.8 0.2-6.3 0.2h-6l0.1 0.5c0 0.3 0.2 2.3 0.5 4.5l0.4 4h0.4c0.6 0 1.5-0.3 2-0.7 0.3-0.3 0.7-0.8 0.9-1.3 0.6-1.1 1.3-2 2.1-2.7 1.1-0.9 2.8-1.5 4-1.5h0.6l0.7-1.1c0.6-1 0.8-1.2 1.3-1.5 0.4-0.2 0.6-0.2 0.9-0.2 0.4 0.1 0.5 0.1 0.5-0.1 0.1-0.1 0.3-1.1 0.6-2.1 0.3-1.1 0.6-2.1 0.6-2.2 0.1-0.2-0.4-0.2-8.8-0.2zm16.2 0h-1.5l-0.4 1.3c-0.2 0.8-0.4 1.4-0.4 1.5 0 0 0.9 0 2 0 2.3 0 2.3 0.1 2.3-1.4 0-0.9-0.1-1-0.3-1.2-0.2-0.2-0.6-0.2-1.7-0.2zm-2.8 4.7c0 0.1-0.2 0.8-0.5 1.6-0.2 1-0.3 1.4-0.2 1.5 0 0 0.3 0.2 0.6 0.4 0.4 0.4 0.4 0.5 0.5 1.2 0 0.6 0 0.7-0.8 2-0.7 1.1-0.8 1.3-1.3 1.6l-0.5 0.2v1.8c0 1.3-0.1 2-0.2 2.5-0.1 0.4-0.2 0.8-0.2 0.8 0 0 0.7 0.1 1.5 0.1 1.2 0 1.6-0.1 1.6-0.2 0-0.1 0.4-3.1 0.8-6.8 0.4-3.6 0.7-6.7 0.7-6.7-0.1-0.2-1.9-0.1-2 0zm-6.3 1.8c-0.2-0.1-0.3 0-0.9 1-0.2 0.4-0.4 0.8-0.3 0.8 0 0.1 1.1 0.7 2.3 1.5 1.3 0.7 2.4 1.4 2.5 1.5 0.3 0.1 0.3 0.1 0.8-0.8 0.3-0.6 0.6-1 0.5-1 0 0-1.1-0.7-2.4-1.5-1.3-0.8-2.4-1.4-2.5-1.5zm-4.5 2.8c-1.6 0.5-2.7 1.5-3.5 3.1-0.6 1.2-1.3 2-2.4 2.5-0.9 0.4-0.9 0.4-2.9 0.5-2.8 0.1-3.9 0.6-5.4 2.1-0.8 0.8-1 1.1-1.4 1.9-1 2.2-0.9 4 0.2 4.4 0.7 0.3 0.8 0.3 1-0.5 0.8-2.4 2.7-4.5 5.1-5.5 1.1-0.4 1.6-0.5 3.2-0.6 2-0.2 2.8-0.7 3.4-2.2 0.3-0.5 0.6-1.2 0.8-1.6 0.8-1.3 2.4-2.5 3.8-2.9 0.4-0.1 0.8-0.2 0.8-0.2q0.2-0.1-0.3-0.4c-0.3-0.2-0.6-0.4-0.6-0.5-0.1-0.3-1.1-0.3-1.8-0.1zm3.2 2.7c-0.9 0.2-2 0.8-2.8 1.5-0.7 0.6-0.8 0.9-1.6 2.6-0.7 1.5-2.2 2.5-3.9 2.7-3.4 0.4-4.3 0.8-5.8 2.2-0.7 0.8-1 1.2-1.4 1.9l-0.5 1 0.9 0.1c0.9 0 0.9 0 1.2-0.4q2.7-3.2 7.3-3.2c2.2 0 2.9-0.5 3.9-2.3 0.3-0.5 0.7-1.2 0.9-1.5 1-1.2 3-2.3 4.6-2.4l0.8-0.1-0.1-0.5c-0.1-0.8-0.3-1.2-0.9-1.4-0.7-0.2-1.9-0.3-2.6-0.2zm3.6 3.9h-0.4c-0.5 0-1.6 0.3-2.3 0.7-0.7 0.5-1.6 1.5-2.2 2.6-1.1 2.1-2.5 2.9-5.2 2.9-0.6 0-1.6 0.1-2 0.2-1 0.2-2.3 0.8-2.9 1.3l-0.4 0.4h4.1c4.6-0.1 4.7-0.1 6.5-1 0.9-0.5 1.3-0.7 2.2-1.6 1.4-1.4 2.2-3 2.5-4.9zm4.3 4.2h-1.9-1.8l-0.5 0.8c-0.6 0.9-1.5 1.9-2.4 2.6l-0.6 0.5h3.4c2.6 0 3.4 0 3.4-0.1 0-0.1 0.1-1 0.2-2z"/></g></svg>',
  2108. // - new window icon
  2109. iconNewWindow: '<svg width="16" height="16" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-external-link"><title>Open post in a new window</title><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>'
  2110. };
  2111.  
  2112. // -- which language is the FB page in?
  2113. function setLanguageAndOptions() {
  2114. // - run this function when HEAD is available.
  2115. // - language (default to EN)
  2116. // - also run getUserOptions().
  2117. if (document.head) {
  2118. let lang = document.head.parentNode.lang || 'en';
  2119. VARS.language = (KeyWords.LANGUAGES.indexOf(lang) >= 0) ? lang : 'en';
  2120.  
  2121. // ...
  2122. let result = getUserOptions().then(() => {
  2123. return true;
  2124. });
  2125. }
  2126. else {
  2127. setTimeout(setLanguageAndOptions, 5);
  2128. }
  2129. }
  2130.  
  2131. function generateRandomString() {
  2132. // - generate random text (first letter must be an alphabet)
  2133. // -- used for css classes
  2134. // -- used for postAttCPID
  2135. // -- used for tagging items
  2136. const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
  2137. const strArray = [chars.charAt(Math.floor(Math.random() * 52))]; // First letter must be an alphabet
  2138.  
  2139. for (let i = 0; i < 12; i++) {
  2140. strArray.push(chars.charAt(Math.floor(Math.random() * 62)));
  2141. }
  2142.  
  2143. return strArray.join('');
  2144. }
  2145.  
  2146. // -- stylesheet builder
  2147. VARS.tempStyleSheetCode = ''; // holds the SS code while it is being built.
  2148. function addToSS(classes, styles) {
  2149. // -- formats and builds the StyleSheet code
  2150. // -- parameters: classes (separated by comma), styles (separated by semicolon)
  2151. // -- array actions: .filter - remove empties, .map - trim (or pad + trim)
  2152. const listOfClasses = classes.split(',').filter(function (e) { return e.trim() }).map(e => e.trim());
  2153. let styleLines = styles.split(';').filter(function (e) { return e.trim() });
  2154. styleLines = styleLines.map(function (e) { let temp = e.split(':'); return ' ' + temp[0].trim() + ':' + temp[1].trim() });
  2155.  
  2156. let temp = listOfClasses.join(',\n') + ' {\n';
  2157. temp += styleLines.join(';\n') + ';\n';
  2158. temp += '}\n';
  2159. VARS.tempStyleSheetCode += temp;
  2160. }
  2161.  
  2162. // -- various CSS
  2163. function addCSS() {
  2164. // - CSS styles for hiding or highlighting the selected posts / element
  2165. // - CSS styles for dialog panel
  2166. let head, styleEl, classes, styles;
  2167. let isNewCSS = true;
  2168.  
  2169. if (VARS.cssID !== '') {
  2170. // - Reset the existing Stylesheet
  2171. styleEl = document.getElementById(VARS.cssID);
  2172. if (styleEl) {
  2173. styleEl.replaceChildren();
  2174. isNewCSS = false;
  2175. }
  2176. }
  2177. if (isNewCSS) {
  2178. // - Create the new Stylesheet head + classnames
  2179. VARS.cssID = generateRandomString().toUpperCase();
  2180. styleEl = document.createElement('style');
  2181. styleEl.setAttribute('type', 'text/css');
  2182. styleEl.setAttribute('id', VARS.cssID);
  2183. head = document.getElementsByTagName('head')[0];
  2184. head.appendChild(styleEl);
  2185.  
  2186. // - remember <element> attribute names (for other functions to use)
  2187. VARS.cssHide = generateRandomString(); // - the parent element - hides the nth level down element
  2188. VARS.cssHideEl = generateRandomString(); // - the element to hide - where there's no child element
  2189. VARS.cssHideNumberOfShares = generateRandomString(); // - hide "# shares" on posts.
  2190. VARS.cssShow = generateRandomString(); // - for revealing hidden elements.
  2191. }
  2192. VARS.tempStyleSheetCode = ''; // reset temp CSS code.
  2193.  
  2194. // -- override random class names - for testing purposes only.
  2195. // VARS.cssHide = 'cmfr-hide';
  2196. // VARS.cssHideEl = 'cmfr-hide-element';
  2197. // VARS.cssHideNumberOfShares = 'cmfr-hide-shares';
  2198.  
  2199. // -- **** fix fb's bug in not "hiding" certain elements properly when scrolling
  2200. addToSS('body > div[style*="position: absolute"], ' +
  2201. 'body > div[style*="position:absolute"]',
  2202. 'top: -1000000px !important;'
  2203. );
  2204.  
  2205. // - insert Styles (as classes)
  2206. // - NF/GF/VF
  2207. // -- remove margins
  2208. addToSS(
  2209. `[${VARS.cssHide}],` +
  2210. `[${VARS.cssHideEl}]`,
  2211. 'margin:0 !important;'
  2212. );
  2213.  
  2214. // -- post wrapper (mainly for news, groups and video feeds posts)
  2215. classes = `[${VARS.cssHide}] > div:not([${postAttTab}]) > div,`;
  2216. classes += `[${VARS.cssHide}] > span,`;
  2217. // -- non n/f & g/f wrappers (mainly for marketplace posts + some aside boxes)
  2218. classes += `[${VARS.cssHideEl}]`;
  2219. // -- which styles to apply?
  2220. // --- (display:block is for those span tags being a nth-of-child element.)
  2221. styles = 'display:none !important;';
  2222. addToSS(classes, styles);
  2223.  
  2224. // -- # shares
  2225. addToSS(
  2226. `[${VARS.cssHideNumberOfShares}]`,
  2227. 'display:none !important;'
  2228. );
  2229.  
  2230. // - toggle post state :: <toggle button> x posts hidden
  2231. addToSS(
  2232. `div[${postAttTab}]`,
  2233. 'display:flex; margin:1.5rem auto; padding:0.5rem 1rem 0.5rem 0; border-radius:0.55rem; width:85%; font-style:italic; cursor:pointer;' +
  2234. ((VARS.Options.VERBOSITY_MESSAGE_COLOUR === '') ? '' : ` color: ${VARS.Options.VERBOSITY_MESSAGE_COLOUR}; `) +
  2235. `background-color:${(VARS.Options.VERBOSITY_MESSSAGE_BG_COLOUR === '') ? KeyWords.VERBOSITY_MESSAGE_BG_COLOUR.defaultValue : VARS.Options.VERBOSITY_MESSAGE_BG_COLOUR};`
  2236. );
  2237. // - echo msg flex boxes
  2238. addToSS(
  2239. `div[${postAttTab}] > div`,
  2240. 'display:flex; align-items: center;'
  2241. );
  2242. // - echo msg's button
  2243. addToSS(
  2244. `div[${postAttTab}] > div.wbtn`,
  2245. 'flex:0 0 3rem; justify-content: center;'
  2246. );
  2247. // - echo msg's text
  2248. addToSS(
  2249. `div[${postAttTab}] > div.wtxt`,
  2250. 'flex:1;'
  2251. );
  2252. // - echo msg hover
  2253. addToSS(
  2254. `div[${postAttTab}]:hover`,
  2255. 'text-decoration: underline; background-color:white; color:black;'
  2256. );
  2257. addToSS(
  2258. `div[${postAttTab}] button:hover`,
  2259. 'cursor:pointer;'
  2260. );
  2261. // - echo msg's button's default state
  2262. addToSS(
  2263. `div[${postAttTab}] > div.wbtn > button`,
  2264. 'transform: rotate(180deg);transition: transform 0.15s linear;'
  2265. );
  2266. // - flagged post's mini-tab
  2267. addToSS(
  2268. `h6[${postAttTab}]`,
  2269. 'border-radius: 0.55rem 0.55rem 0 0; width:75%; margin:0 auto; padding: 0.45rem 0.25rem; font-style:italic; text-align:center; font-weight:normal;' +
  2270. ((VARS.Options.VERBOSITY_MESSAGE_COLOUR === '') ? '' : ` color: ${VARS.Options.VERBOSITY_MESSAGE_COLOUR}; `) +
  2271. `background-color:${(VARS.Options.VERBOSITY_MESSSAGE_BG_COLOUR === '') ? KeyWords.VERBOSITY_MESSAGE_BG_COLOUR.defaultValue : VARS.Options.VERBOSITY_MESSAGE_BG_COLOUR}; `
  2272. );
  2273.  
  2274. // - 'show' - reveal a hidden post (except for mp)
  2275. addToSS(
  2276. `[${VARS.cssShow}]:not([${VARS.cssHideEl}]) > div:not([${postAttTab}]) > div, ` +
  2277. `[${VARS.cssHideNumberOfShares}][${VARS.cssShow}]`,
  2278. 'display:block !important; ' +
  2279. `border:3px dotted ${VARS.Options.CMF_BORDER_COLOUR} !important; border-radius:8px; padding:0.2rem 0.1rem 0.1rem 0.1rem;` // 4px
  2280. );
  2281. // - echo msg show state
  2282. addToSS(
  2283. `[${VARS.cssShow}] > div[${postAttTab}]`,
  2284. 'margin-top:0.5rem; margin-bottom:0.5rem;'
  2285. );
  2286. // - echo msg's button show state
  2287. addToSS(
  2288. `[${VARS.cssShow}] > div[${postAttTab}] > div.wbtn > button`,
  2289. 'transform: rotate(360deg);transition: transform 0.15s linear;'
  2290. );
  2291. // - non-standard post's show state (mp)
  2292. addToSS(
  2293. `[${VARS.cssHideEl}][${VARS.cssShow}] `,
  2294. `display: block !important; border:3px dotted ${VARS.Options.CMF_BORDER_COLOUR} !important; border-radius:8px; padding:0.1rem;` // 4px
  2295. );
  2296. // - dailog box CSS
  2297. // --- dialog box; position + flex
  2298. let bColour = (VARS.Options.CMF_BORDER_COLOUR === '') ? KeyWords.CMF_BORDER_COLOUR.defaultValue : VARS.Options.CMF_BORDER_COLOUR;
  2299. let tColour = ((VARS.Options.CMF_DIALOG_COLOUR === '') || (VARS.Options.CMF_DIALOG_COLOUR === undefined)) ? 'var(--primary-text)' : VARS.Options.CMF_DIALOG_COLOUR;
  2300. // - left / right done in fn addExtraCSS()
  2301. addToSS(
  2302. '.fb-cmf ',
  2303. 'position:fixed; top:0.15rem; bottom:0.15rem; display:flex; flex-direction:column; max-width:30rem; padding:0 1rem; z-index:5;' +
  2304. `border:2px solid ${bColour}; border-radius:1rem; opacity:0; color:${tColour}; visibility:hidden;`
  2305. );
  2306. if ((VARS.Options.CMF_DIALOG_BG_COLOUR === '') || (VARS.Options.CMF_DIALOG_BG_COLOUR === undefined)) {
  2307. addToSS('.__fb-light-mode .fb-cmf', 'background-color:#fefefa;');
  2308. addToSS('.__fb-dark-mode .fb-cmf', 'background-color:var(--web-wash);');
  2309. addToSS('.fb-cmf', 'background-color:floralwhite;'); // -- fall back colour.
  2310. }
  2311. else {
  2312. addToSS('.fb-cmf', `background-color:${VARS.Options.CMF_DIALOG_BG_COLOUR};`);
  2313. }
  2314. // -- header
  2315. addToSS(
  2316. '.fb-cmf header',
  2317. 'display:flex; justify-content:space-between; direction:ltr;'
  2318. );
  2319. addToSS(
  2320. '.fb-cmf header .fb-cmf-icon',
  2321. 'flex-grow:0; align-self:auto; width:75px; text-align:left; order:1;'
  2322. );
  2323. addToSS(
  2324. '.fb-cmf header .fb-cmf-icon svg',
  2325. 'width:64px; height:64px; margin:2px 0;'
  2326. );
  2327. addToSS(
  2328. '.fb-cmf header .fb-cmf-title',
  2329. 'flex-grow:2; align-self:auto; order:2;'
  2330. );
  2331. addToSS(
  2332. '.fb-cmf header .fb-cmf-title .script-version',
  2333. 'font-size: 0.75rem; font-weight: normal;'
  2334. );
  2335. addToSS(
  2336. '.fb-cmf header .fb-cmf-lang-1',
  2337. 'padding-top:1.25rem;'
  2338. );
  2339. addToSS(
  2340. '.fb-cmf header .fb-cmf-lang-2',
  2341. 'padding-top:0.75rem;'
  2342. );
  2343. addToSS(
  2344. '.fb-cmf header .fb-cmf-title > div',
  2345. 'font-size:1.35rem; font-weight: 700; text-align:center;'
  2346. );
  2347. addToSS(
  2348. '.fb-cmf header .fb-cmf-title > small',
  2349. 'display:block; font-size:0.8rem; text-align:center;'
  2350. );
  2351. addToSS(
  2352. '.fb-cmf header .fb-cmf-close',
  2353. 'flex-grow:0; align-self:auto; width:75px; text-align:right; padding: 1.5rem 0 0 0; order:3;'
  2354. );
  2355. addToSS(
  2356. '.fb-cmf header .fb-cmf-close button',
  2357. 'width:1.75rem; height:1.5rem; font-family: monospace;'
  2358. );
  2359.  
  2360. // -- content
  2361. addToSS(
  2362. '.fb-cmf div.content',
  2363. ` flex:1; overflow:auto; border:2px double ${bColour}; border-radius:0.5rem; color: var(--primary-text);`
  2364. );
  2365. addToSS(
  2366. '.fb-cmf fieldset',
  2367. 'margin:0.5rem; padding:0.5rem; border-color:LightGrey;'
  2368. );
  2369. addToSS(
  2370. '.fb-cmf fieldset legend',
  2371. 'font-weight:700;'
  2372. );
  2373. addToSS(
  2374. '.fb-cmf fieldset label',
  2375. 'display:inline-block; padding:0.125rem 0; color: var(--primary-text); font-weight: normal;'
  2376. );
  2377. addToSS(
  2378. '.fb-cmf fieldset label input',
  2379. 'margin: 0 0.5rem 0 0.5rem; vertical-align:baseline;' // left & right margins for RTL & LTR text
  2380. );
  2381. addToSS(
  2382. '.fb-cmf fieldset label[disabled]',
  2383. 'color:darkgrey;'
  2384. )
  2385. addToSS(
  2386. '.fb-cmf fieldset textarea',
  2387. 'width:100%; height:12rem;'
  2388. );
  2389. addToSS(
  2390. '.__fb-dark-mode .fb-cmf fieldset textarea,' +
  2391. '.__fb-dark-mode .fb-cmf fieldset input[type="input"]',
  2392. 'background-color:var(--comment-background); color:var(--primary-text);'
  2393. );
  2394. // -- footer - buttons + results
  2395. addToSS(
  2396. '.fb-cmf footer',
  2397. 'display: grid; justify-content: space-evenly; padding:1rem 0.25rem; text-align:center;'
  2398. );
  2399. addToSS(
  2400. '.fb-cmf .buttons button',
  2401. // 'margin-left: 1rem; margin-right:1rem;'
  2402. 'margin-left: 0.25rem; margin-right: 0.25rem;'
  2403. );
  2404. // -- footer - file input
  2405. addToSS(
  2406. '.fb-cmf .fileInput',
  2407. 'display:none;'
  2408. );
  2409. // -- footer - import results
  2410. addToSS(
  2411. '.fb-cmf .fileResults',
  2412. 'grid-column-start: 1; grid-column-end: 6; font-style:italic; margin-top: 1rem;'
  2413. );
  2414. // -- show dialog box (default is not to show)
  2415. addToSS(
  2416. `.fb-cmf[${VARS.cssShow}]`,
  2417. 'opacity:1; transform:scale(1); visibility:visible;'
  2418. );
  2419. // -- new window icon
  2420. addToSS(
  2421. '.link-new',
  2422. 'width: 1rem; height: 1rem;'
  2423. );
  2424. // 'width: 1rem; height: 1rem; margin-left: 0.2rem; margin-right: 0.2rem;'
  2425. addToSS(
  2426. '.link-new a',
  2427. 'width: 1rem; position: relative; display: inline-block;'
  2428. );
  2429. addToSS(
  2430. '.link-new svg',
  2431. 'position: absolute; top: -13.5px; stroke: rgb(101, 103, 107);'
  2432. );
  2433.  
  2434. // - save & apply the CSS
  2435. styleEl.appendChild(document.createTextNode(VARS.tempStyleSheetCode));
  2436. VARS.tempStyleSheetCode = '';
  2437. }
  2438.  
  2439. function addExtraCSS() {
  2440. // - extra CSS styles
  2441. // - fb can sometimes be a bit slow in loading certain parts of the site ...
  2442. // - ... this function is called several ms later ...
  2443. // - ... and when saving the options (via save button)
  2444. let cmfBtnLocation = KeyWords.CMF_BTN_OPTION.defaultValue;
  2445. let cmfDlgLocation = KeyWords.CMF_DIALOG_OPTION.defaultValue
  2446. if (VARS.Options.hasOwnProperty('CMF_BTN_OPTION')) {
  2447. if (VARS.Options.CMF_BTN_OPTION.toString() !== '') {
  2448. cmfBtnLocation = VARS.Options.CMF_BTN_OPTION;
  2449. }
  2450. }
  2451. if (VARS.Options.hasOwnProperty('CMF_DIALOG_OPTION')) {
  2452. if (VARS.Options.CMF_DIALOG_OPTION.toString() !== '') {
  2453. cmfDlgLocation = VARS.Options.CMF_DIALOG_OPTION;
  2454. }
  2455. }
  2456. cmfBtnLocation = cmfBtnLocation.toString();
  2457. cmfDlgLocation = cmfDlgLocation.toString();
  2458.  
  2459. // Grab the existing Stylesheet and amend it
  2460. let styleEl = document.getElementById(VARS.cssID);
  2461. let styles;
  2462.  
  2463. VARS.tempStyleSheetCode = ''; // reset
  2464.  
  2465. // - button's location.
  2466. if (cmfBtnLocation === '1') {
  2467. // - top right - has the buttons running across the top of the page (pre May 2022).
  2468. if (document.querySelector('[role="banner"]')) {
  2469. // - oldish FB structure has menu buttons across the top (changed for some users in Apr/May 2022)
  2470. addToSS(
  2471. 'div[role="banner"] > div:last-of-type div[role="navigation"]',
  2472. 'margin-right: 42px;'
  2473. );
  2474. }
  2475. styles = 'position:fixed; top:0.5rem; right:0.5rem; display:none;';
  2476. }
  2477. else if (cmfBtnLocation === '2') {
  2478. // - disabled, use "Settings" in the user script menu.
  2479. // - no css
  2480. styles = '';
  2481. }
  2482. else {
  2483. // - bottom left - has the buttons running down the side of the page (May 2022 ->).
  2484. // - cmfBtnLocation === "0"
  2485. styles = 'position:fixed; bottom:4.25rem; left:1.1rem; display:none;';
  2486. }
  2487. if (styles.length > 0) {
  2488. addToSS(
  2489. '.fb-cmf-toggle',
  2490. styles
  2491. );
  2492. // - btn - basic styling.
  2493. addToSS('.fb-cmf-toggle', 'border-radius:0.3rem;');
  2494. addToSS('.fb-cmf-toggle svg', 'height:32px; width:32px;');
  2495. addToSS('.fb-cmf-toggle:hover', 'cursor:pointer;');
  2496. // - dialog box's display
  2497. addToSS(`.fb-cmf-toggle[${VARS.cssShow}]`, 'display:block;');
  2498. }
  2499. // - dialog box's left/right + animated open/close behaviour
  2500. if (cmfDlgLocation === '1') {
  2501. // - right
  2502. styles = 'right:0.35rem; margin-left:1rem; transform:scale(0);transform-origin:top right;';
  2503. }
  2504. else {
  2505. // - left (cmfDlgLocation === '0')
  2506. styles = 'left:4.25rem; margin-right:1rem; transform:scale(0);transform-origin:center center;';
  2507. }
  2508. addToSS(
  2509. '.fb-cmf',
  2510. styles +
  2511. 'transition:transform .45s ease, opacity .25s ease, visibility 1s ease;'
  2512. );
  2513. if (VARS.tempStyleSheetCode.length > 0) {
  2514. styleEl.appendChild(document.createTextNode(VARS.tempStyleSheetCode));
  2515. VARS.tempStyleSheetCode = '';
  2516. }
  2517. }
  2518.  
  2519. // -- get the user's settings ...
  2520. async function getUserOptions() {
  2521. // -- read in the saved data, else set defaults.
  2522. let changed = false;
  2523. // - reset Options
  2524. VARS.Options = new Object();
  2525. VARS.optionsReady = false;
  2526.  
  2527. // - has the user previously saved options?
  2528. // -- if yes, the update Options
  2529. let result = await get(DBVARS.DBKey, DBVARS.ostore).then((values) => {
  2530. if (values) {
  2531. // -- has data
  2532. VARS.Options = JSON.parse(values);
  2533. return 1;
  2534. }
  2535. else {
  2536. // -- no data (first time)
  2537. return 0;
  2538. }
  2539. }).catch((err) => {
  2540. console.info(`${log}getuserOptions() > get() - Error:`, err);
  2541. });
  2542.  
  2543. // -- check that all variables exists ... if not, assign them default values..
  2544. // -- Sponsored (always enabled)
  2545. if (!VARS.Options.hasOwnProperty('NF_SPONSORED')) {
  2546. VARS.Options.NF_SPONSORED = KeyWords['SPONSORED'].defaultEnabled;
  2547. changed = true;
  2548. }
  2549. if (!VARS.Options.hasOwnProperty('GF_SPONSORED')) {
  2550. VARS.Options.GF_SPONSORED = KeyWords['SPONSORED'].defaultEnabled;
  2551. changed = true;
  2552. }
  2553. if (!VARS.Options.hasOwnProperty('VF_SPONSORED')) {
  2554. VARS.Options.VF_SPONSORED = KeyWords['SPONSORED'].defaultEnabled;
  2555. changed = true;
  2556. }
  2557. if (!VARS.Options.hasOwnProperty('MP_SPONSORED')) {
  2558. VARS.Options.MP_SPONSORED = KeyWords['SPONSORED'].defaultEnabled;
  2559. changed = true;
  2560. }
  2561.  
  2562. // -- which option has been enabled / disabled?
  2563. VARS.hideAnInfoBox = false;
  2564. for (const key in KeyWords) {
  2565. if (key.slice(0, 3) === 'NF_' && key.slice(0, 10) !== 'NF_BLOCKED') {
  2566. if (!VARS.Options.hasOwnProperty(key)) {
  2567. VARS.Options[key] = KeyWords[key].defaultEnabled;
  2568. changed = true;
  2569. }
  2570. }
  2571. else if (key.slice(0, 3) === 'GF_' && key.slice(0, 10) !== 'GF_BLOCKED') {
  2572. if (!VARS.Options.hasOwnProperty(key)) {
  2573. VARS.Options[key] = KeyWords[key].defaultEnabled;
  2574. changed = true;
  2575. }
  2576. }
  2577. else if (key.slice(0, 3) === 'VF_' && key.slice(0, 10) !== 'VF_BLOCKED') {
  2578. if (!VARS.Options.hasOwnProperty(key)) {
  2579. VARS.Options[key] = KeyWords[key].defaultEnabled;
  2580. changed = true;
  2581. }
  2582. }
  2583. else if (key.slice(0, 3) === 'MP_' && key.slice(0, 10) !== 'MP_BLOCKED') {
  2584. if (!VARS.Options.hasOwnProperty(key)) {
  2585. VARS.Options[key] = KeyWords[key].defaultEnabled;
  2586. changed = true;
  2587. }
  2588. }
  2589. else if (key.slice(0, 10) === 'OTHER_INFO') {
  2590. if (!VARS.Options.hasOwnProperty(key)) {
  2591. VARS.Options[key] = KeyWords[key].defaultEnabled;
  2592. changed = true;
  2593. }
  2594. if (VARS.Options[key]) {
  2595. VARS.hideAnInfoBox = true;
  2596. }
  2597. }
  2598. }
  2599.  
  2600. // -- all other options.
  2601. if (!VARS.Options.hasOwnProperty('NF_BLOCKED_ENABLED')) {
  2602. VARS.Options.NF_BLOCKED_ENABLED = KeyWords.NF_BLOCKED_ENABLED.defaultEnabled;
  2603. changed = true;
  2604. }
  2605. if (!VARS.Options.hasOwnProperty('NF_BLOCKED_FEED')) {
  2606. VARS.Options.NF_BLOCKED_FEED = KeyWords.NF_BLOCKED_FEED.defaultEnabled;
  2607. changed = true;
  2608. }
  2609. if (!VARS.Options.hasOwnProperty('NF_BLOCKED_TEXT')) {
  2610. VARS.Options.NF_BLOCKED_TEXT = '';
  2611. changed = true;
  2612. }
  2613.  
  2614. if (!VARS.Options.hasOwnProperty('GF_BLOCKED_ENABLED')) {
  2615. VARS.Options.GF_BLOCKED_ENABLED = KeyWords.GF_BLOCKED_ENABLED.defaultEnabled;
  2616. changed = true;
  2617. }
  2618. if (!VARS.Options.hasOwnProperty('GF_BLOCKED_FEED')) {
  2619. VARS.Options.GF_BLOCKED_FEED = KeyWords.GF_BLOCKED_FEED.defaultEnabled;
  2620. changed = true;
  2621. }
  2622. if (!VARS.Options.hasOwnProperty('GF_BLOCKED_TEXT')) {
  2623. VARS.Options.GF_BLOCKED_TEXT = '';
  2624. changed = true;
  2625. }
  2626.  
  2627. if (!VARS.Options.hasOwnProperty('VF_BLOCKED_ENABLED')) {
  2628. VARS.Options.VF_BLOCKED_ENABLED = KeyWords.VF_BLOCKED_ENABLED.defaultEnabled;
  2629. changed = true;
  2630. }
  2631. if (!VARS.Options.hasOwnProperty('VF_BLOCKED_FEED')) {
  2632. VARS.Options.VF_BLOCKED_FEED = KeyWords.VF_BLOCKED_FEED.defaultEnabled;
  2633. changed = true;
  2634. }
  2635. if (!VARS.Options.hasOwnProperty('VF_BLOCKED_TEXT')) {
  2636. VARS.Options.VF_BLOCKED_TEXT = '';
  2637. changed = true;
  2638. }
  2639.  
  2640. if (!VARS.Options.hasOwnProperty('MP_BLOCKED_ENABLED')) {
  2641. VARS.Options.MP_BLOCKED_ENABLED = KeyWords.MP_BLOCKED_ENABLED.defaultEnabled;
  2642. changed = true;
  2643. }
  2644. if (!VARS.Options.hasOwnProperty('MP_BLOCKED_FEED')) {
  2645. VARS.Options.MP_BLOCKED_FEED = KeyWords.MP_BLOCKED_FEED.defaultEnabled;
  2646. changed = true;
  2647. }
  2648. if (!VARS.Options.hasOwnProperty('MP_BLOCKED_TEXT')) {
  2649. VARS.Options.MP_BLOCKED_TEXT = '';
  2650. changed = true;
  2651. }
  2652. if (!VARS.Options.hasOwnProperty('MP_BLOCKED_TEXT_DESCRIPTION')) {
  2653. VARS.Options.MP_BLOCKED_TEXT_DESCRIPTION = '';
  2654. changed = true;
  2655. }
  2656. if (!VARS.Options.hasOwnProperty('VERBOSITY_LEVEL')) {
  2657. VARS.Options.VERBOSITY_LEVEL = KeyWords.DLG_VERBOSITY.defaultValue;
  2658. changed = true;
  2659. }
  2660. if (!VARS.Options.hasOwnProperty('VERBOSITY_MESSAGE_COLOUR')) {
  2661. VARS.Options.VERBOSITY_MESSAGE_COLOUR = '';
  2662. changed = true;
  2663. }
  2664. // - nb: test conditions, undefined needs to be tested before using .toString(), otherwise JS complains...
  2665. if (
  2666. (!VARS.Options.hasOwnProperty('VERBOSITY_MESSAGE_BG_COLOUR')) ||
  2667. (VARS.Options.VERBOSITY_MESSAGE_BG_COLOUR === undefined) ||
  2668. (VARS.Options.VERBOSITY_MESSAGE_BG_COLOUR.toString() === '')
  2669. ) {
  2670. VARS.Options.VERBOSITY_MESSAGE_BG_COLOUR = KeyWords.VERBOSITY_MESSAGE_BG_COLOUR.defaultValue;
  2671. changed = true;
  2672. }
  2673. if (
  2674. (!VARS.Options.hasOwnProperty('VERBOSITY_DEBUG')) ||
  2675. (VARS.Options.VERBOSITY_DEBUG === undefined) ||
  2676. (VARS.Options.VERBOSITY_DEBUG.toString() === '')
  2677. ) {
  2678. VARS.Options.VERBOSITY_DEBUG = KeyWords.VERBOSITY_DEBUG.defaultValue;
  2679. changed = true;
  2680. }
  2681.  
  2682. if (!VARS.Options.hasOwnProperty('CMF_BTN_OPTION')) {
  2683. VARS.Options.CMF_BTN_OPTION = KeyWords.CMF_BTN_OPTION.defaultValue;
  2684. changed = true;
  2685. }
  2686. if (!VARS.Options.hasOwnProperty('CMF_DIALOG_OPTION')) {
  2687. VARS.Options.CMF_DIALOG_OPTION = KeyWords.CMF_DIALOG_OPTION.defaultValue;
  2688. changed = true;
  2689. }
  2690. if (
  2691. (!VARS.Options.hasOwnProperty('CMF_BORDER_COLOUR')) ||
  2692. (VARS.Options.CMF_BORDER_COLOUR.toString() === undefined) ||
  2693. (VARS.Options.CMF_BORDER_COLOUR.toString() === '')
  2694. ) {
  2695. VARS.Options.CMF_BORDER_COLOUR = KeyWords.CMF_BORDER_COLOUR.defaultValue;
  2696. changed = true;
  2697. }
  2698. if (
  2699. (!VARS.Options.hasOwnProperty('CMF_DIALOG_COLOUR')) ||
  2700. (VARS.Options.CMF_DIALOG_COLOUR.toString() === undefined)
  2701. ) {
  2702. VARS.Options.CMF_DIALOG_COLOUR = KeyWords.CMF_DIALOG_COLOUR.defaultValue;
  2703. changed = true;
  2704. }
  2705. if (
  2706. (!VARS.Options.hasOwnProperty('CMF_DIALOG_BG_COLOUR')) ||
  2707. (VARS.Options.CMF_DIALOG_BG_COLOUR.toString() === undefined)
  2708. ) {
  2709. VARS.Options.CMF_DIALOG_BG_COLOUR = KeyWords.CMF_DIALOG_BG_COLOUR.defaultValue;
  2710. changed = true;
  2711. }
  2712. if (!VARS.Options.hasOwnProperty('NF_LIKES_MAXIMUM_COUNT')) {
  2713. VARS.Options.NF_LIKES_MAXIMUM_COUNT = '';
  2714. changed = true;
  2715. }
  2716.  
  2717. if (changed) {
  2718. // - save the changes ...
  2719. // -- usually happen if first time setup or change in Options' variables.
  2720. let result = await set(DBVARS.DBKey, JSON.stringify(VARS.Options), DBVARS.ostore).then(() => {
  2721. return true;
  2722. }).catch((err) => {
  2723. console.info(`${log}getUserOptions() > changed > saving - failed, Error: ${err}`);
  2724. return false;
  2725. });
  2726. if (VARS.Options.VERBOSITY_DEBUG) {
  2727. if (result) {
  2728. console.info(`${log}Changed - success`);
  2729. }
  2730. else {
  2731. console.info(`${log}Changed - failed`);
  2732. }
  2733. }
  2734. }
  2735.  
  2736. // split the blocks of texts entries into arrays and translate to lowercase.
  2737. VARS.Filters = new Object();
  2738.  
  2739. // -- original list of text for each feed
  2740. let nfBlockedText = '';
  2741. let gfBlockedText = '';
  2742. let vfBlockedText = '';
  2743. let mpBlockedText = '';
  2744. let mpBlockedTextDesc = '';
  2745. if (VARS.Options.NF_BLOCKED_ENABLED === true) {
  2746. nfBlockedText = VARS.Options.NF_BLOCKED_TEXT;
  2747. }
  2748. if (VARS.Options.GF_BLOCKED_ENABLED === true) {
  2749. gfBlockedText = VARS.Options.GF_BLOCKED_TEXT;
  2750. }
  2751. if (VARS.Options.VF_BLOCKED_ENABLED === true) {
  2752. vfBlockedText = VARS.Options.VF_BLOCKED_TEXT;
  2753. }
  2754. if (VARS.Options.MP_BLOCKED_ENABLED === true) {
  2755. mpBlockedText = VARS.Options.MP_BLOCKED_TEXT;
  2756. mpBlockedTextDesc = VARS.Options.MP_BLOCKED_TEXT_DESCRIPTION;
  2757. }
  2758.  
  2759. // -- final list of text for each feed
  2760. let nfBlockedTextList = '';
  2761. let gfBlockedTextList = '';
  2762. let vfBlockedTextList = '';
  2763. let mpBlockedTextList = '';
  2764. let mpBlockedTextDescList = '';
  2765.  
  2766. // -- ##_BLOCKED_FEED[X] : 0 = NF, 1 = GF, 2 = VF.
  2767. // -- rule: both feeds must be enabled before appending text list from one feed to another text list
  2768. // -- news feed:
  2769. if (VARS.Options.NF_BLOCKED_ENABLED) {
  2770. nfBlockedTextList = nfBlockedText; // final list
  2771. // -- add gf to nf
  2772. if (VARS.Options.GF_BLOCKED_ENABLED && VARS.Options.GF_BLOCKED_FEED[0] === '1') {
  2773. if (gfBlockedText.length > 0) {
  2774. nfBlockedTextList += ((nfBlockedTextList.length > 0) ? VARS.SEP : '') + gfBlockedText;
  2775. }
  2776. }
  2777. // -- add vf to nf
  2778. if (VARS.Options.VF_BLOCKED_ENABLED && VARS.Options.VF_BLOCKED_FEED[0] === '1') {
  2779. if (vfBlockedText.length > 0) {
  2780. nfBlockedTextList += ((nfBlockedTextList.length > 0) ? VARS.SEP : '') + vfBlockedText;
  2781. }
  2782. }
  2783. }
  2784. // -- groups feed:
  2785. if (VARS.Options.GF_BLOCKED_ENABLED) {
  2786. gfBlockedTextList = gfBlockedText; // final list
  2787. // -- add nf to gf
  2788. if (VARS.Options.NF_BLOCKED_ENABLED && VARS.Options.NF_BLOCKED_FEED[1] === '1') {
  2789. if (nfBlockedText.length > 0) {
  2790. gfBlockedTextList += ((gfBlockedTextList.length > 0) ? VARS.SEP : '') + nfBlockedText;
  2791. }
  2792. }
  2793. // -- add vf to gf
  2794. if (VARS.Options.VF_BLOCKED_ENABLED && VARS.Options.VF_BLOCKED_FEED[1] === '1') {
  2795. if (vfBlockedText.length > 0) {
  2796. gfBlockedTextList += ((gfBlockedTextList.length > 0) ? VARS.SEP : '') + vfBlockedText;
  2797. }
  2798. }
  2799. }
  2800. // -- videos feed:
  2801. if (VARS.Options.VF_BLOCKED_ENABLED) {
  2802. vfBlockedTextList = vfBlockedText; // final list
  2803. // -- add nf to vf
  2804. if (VARS.Options.NF_BLOCKED_ENABLED && VARS.Options.NF_BLOCKED_FEED[2] === '1') {
  2805. if (nfBlockedText.length > 0) {
  2806. vfBlockedTextList += ((vfBlockedTextList.length > 0) ? VARS.SEP : '') + nfBlockedText;
  2807. }
  2808. }
  2809. // -- add gf to vf
  2810. if (VARS.Options.GF_BLOCKED_ENABLED && VARS.Options.GF_BLOCKED_FEED[2] === '1') {
  2811. if (gfBlockedText.length > 0) {
  2812. vfBlockedTextList += ((vfBlockedTextList.length > 0) ? VARS.SEP : '') + gfBlockedText;
  2813. }
  2814. }
  2815. }
  2816.  
  2817. // -- market place (stand-alone)
  2818. if (VARS.Options.MP_BLOCKED_ENABLED) {
  2819. mpBlockedTextList = mpBlockedText;
  2820. mpBlockedTextDescList = mpBlockedTextDesc;
  2821. }
  2822.  
  2823. // -- populate the VARS.Filters.###...
  2824. // -- news feed:
  2825. VARS.Filters.NF_BLOCKED_TEXT = [];
  2826. VARS.Filters.NF_BLOCKED_TEXT_LC = [];
  2827. VARS.Filters.NF_BLOCKED_ENABLED = false;
  2828. if (VARS.Options.NF_BLOCKED_ENABLED && nfBlockedTextList.length > 0) {
  2829. VARS.Filters.NF_BLOCKED_ENABLED = true;
  2830. VARS.Filters.NF_BLOCKED_TEXT = nfBlockedTextList.split(VARS.SEP);
  2831. VARS.Filters.NF_BLOCKED_TEXT_LC = VARS.Filters.NF_BLOCKED_TEXT.map(btext => btext.toLowerCase());
  2832. }
  2833. // -- groups feed:
  2834. VARS.Filters.GF_BLOCKED_TEXT = [];
  2835. VARS.Filters.GF_BLOCKED_TEXT_LC = [];
  2836. VARS.Filters.GF_BLOCKED_ENABLED = false;
  2837. if (VARS.Options.GF_BLOCKED_ENABLED && gfBlockedTextList.length > 0) {
  2838. VARS.Filters.GF_BLOCKED_ENABLED = true;
  2839. VARS.Filters.GF_BLOCKED_TEXT = gfBlockedTextList.split(VARS.SEP);
  2840. VARS.Filters.GF_BLOCKED_TEXT_LC = VARS.Filters.GF_BLOCKED_TEXT.map(btext => btext.toLowerCase());
  2841. }
  2842. // -- watch videos feed
  2843. VARS.Filters.VF_BLOCKED_TEXT = [];
  2844. VARS.Filters.VF_BLOCKED_TEXT_LC = [];
  2845. VARS.Filters.VF_BLOCKED_ENABLED = false;
  2846. if (VARS.Options.VF_BLOCKED_ENABLED && vfBlockedTextList.length > 0) {
  2847. VARS.Filters.VF_BLOCKED_ENABLED = true;
  2848. VARS.Filters.VF_BLOCKED_TEXT = vfBlockedTextList.split(VARS.SEP);
  2849. VARS.Filters.VF_BLOCKED_TEXT_LC = VARS.Filters.VF_BLOCKED_TEXT.map(btext => btext.toLowerCase());
  2850. }
  2851. // -- marketplace feed
  2852. VARS.Filters.MP_BLOCKED_TEXT = [];
  2853. VARS.Filters.MP_BLOCKED_TEXT_LC = [];
  2854. VARS.Filters.MP_BLOCKED_TEXT_DESCRIPTION = [];
  2855. VARS.Filters.MP_BLOCKED_TEXT_DESCRIPTION_LC = [];
  2856. VARS.Filters.MP_BLOCKED_ENABLED = false;
  2857. if (VARS.Options.MP_BLOCKED_ENABLED && ((mpBlockedTextList.length > 0) || (mpBlockedTextDescList.length > 0))) {
  2858. VARS.Filters.MP_BLOCKED_ENABLED = true;
  2859. // -- prices ::
  2860. VARS.Filters.MP_BLOCKED_TEXT = mpBlockedTextList.split(VARS.SEP);
  2861. VARS.Filters.MP_BLOCKED_TEXT_LC = VARS.Filters.MP_BLOCKED_TEXT.map(btext => btext.toLowerCase());
  2862. // -- description ::
  2863. VARS.Filters.MP_BLOCKED_TEXT_DESCRIPTION = mpBlockedTextDescList.split(VARS.SEP);
  2864. VARS.Filters.MP_BLOCKED_TEXT_DESCRIPTION_LC = VARS.Filters.MP_BLOCKED_TEXT_DESCRIPTION.map(btext => btext.toLowerCase());
  2865. }
  2866.  
  2867. // console.info(log + 'getUserOptions() - Options:', VARS.Options);
  2868. // console.info(log + 'getUserOptions() - Filters:', VARS.Filters);
  2869.  
  2870. VARS.optionsReady = true;
  2871. }
  2872.  
  2873. // -- run some functions now - not dependent on HEAD being available.
  2874. // (includes getUserOptions())
  2875. setLanguageAndOptions();
  2876.  
  2877. // -- dailog box for displaying options (called in runMO)
  2878. function buildMoppingDialog() {
  2879. // build the dialog box component ...
  2880. // -- BODY must be available for use.
  2881. // -- used for displaying/getting/setting the various options
  2882.  
  2883. function createSingleCB(cbName, cbReadOnly = false) {
  2884. // -- create toggle style checkboxes
  2885. const CBTYPE = 'T'; // checkbox, single value, Toggle style
  2886. let cb = document.createElement('input');
  2887. cb.type = 'checkbox';
  2888. cb.setAttribute('cbType', CBTYPE);
  2889. cb.name = cbName;
  2890. cb.value = cbName;
  2891. cb.checked = VARS.Options[cbName];
  2892. let label = document.createElement('label');
  2893. if (cbReadOnly) {
  2894. cb.checked = true;
  2895. cb.disabled = true;
  2896. label.setAttribute('disabled', 'disabled');
  2897. }
  2898. label.appendChild(cb);
  2899. if (KeyWords[cbName]) {
  2900. if (Array.isArray(KeyWords[cbName][VARS.language]) === false) {
  2901. label.appendChild(document.createTextNode(KeyWords[cbName][VARS.language]));
  2902. }
  2903. else {
  2904. label.appendChild(document.createTextNode(Array.from(KeyWords[cbName][VARS.language]).join(', ')));
  2905. }
  2906. }
  2907. else if (['NF_SPONSORED', 'GF_SPONSORED', 'VF_SPONSORED', 'MP_SPONSORED'].indexOf(cbName) >= 0) {
  2908. label.appendChild(document.createTextNode(KeyWords.SPONSORED[VARS.language]));
  2909. }
  2910. else {
  2911. label.appendChild(document.createTextNode(cbName));
  2912. }
  2913. let div = document.createElement('div');
  2914. div.appendChild(label);
  2915. return div;
  2916. }
  2917.  
  2918. function createMultipeCBs(cbName, cbReadOnlyIdx = -1) {
  2919. // -- create multiple values checkboxes
  2920. const CBTYPE = 'M'; // checkbox, Multiple values
  2921. let arrElements = [];
  2922. for (let i = 0; i < KeyWords[cbName][VARS.language].length; i++) {
  2923. let div = document.createElement('div');
  2924. let cbKeyWord = KeyWords[cbName][VARS.language][i];
  2925. let cb = document.createElement('input');
  2926. cb.type = 'checkbox';
  2927. cb.setAttribute('cbType', CBTYPE);
  2928. cb.name = cbName;
  2929. cb.value = i;
  2930. cb.checked = VARS.Options[cbName][i] === '1';
  2931. let label = document.createElement('label');
  2932. if (i === cbReadOnlyIdx) {
  2933. cb.checked = true;
  2934. cb.disabled = true;
  2935. label.setAttribute('disabled', 'disabled');
  2936. }
  2937. label.appendChild(cb);
  2938. label.appendChild(document.createTextNode(cbKeyWord));
  2939. div.appendChild(label);
  2940. arrElements.push(div);
  2941. };
  2942. let br = document.createElement('br');
  2943. arrElements.push(br);
  2944. return arrElements;
  2945. }
  2946.  
  2947. function createRB(rbName, rbValue, rbLabelText) {
  2948. let div = document.createElement('div');
  2949. let rb = document.createElement('input');
  2950. rb.type = 'radio';
  2951. rb.name = rbName;
  2952. rb.value = rbValue;
  2953. rb.checked = (VARS.Options[rbName] === rbValue);
  2954. let label = document.createElement('label');
  2955. label.appendChild(rb);
  2956. label.appendChild(document.createTextNode(rbLabelText));
  2957. div.appendChild(label);
  2958. return div;
  2959. }
  2960.  
  2961. function createInput(iName, iLabel) {
  2962. let div = document.createElement('div');
  2963. let input = document.createElement('input');
  2964. input.type = 'text';
  2965. input.name = iName;
  2966. input.value = VARS.Options[iName];
  2967. let label = document.createElement('label');
  2968. label.appendChild(document.createTextNode(iLabel));
  2969. label.appendChild(document.createElement('br'));
  2970. label.appendChild(input);
  2971. div.appendChild(label);
  2972. return div;
  2973. }
  2974.  
  2975. function createCheckboxAndInput(cbName, iName) {
  2976. // -- checkbox with input box.
  2977. // -- no read-only attributes
  2978. // -- no multiple keyword values.
  2979.  
  2980. // -- create checkbox first.
  2981. const CBTYPE = 'T';
  2982. let cb = document.createElement('input');
  2983. cb.type = 'checkbox';
  2984. cb.setAttribute('cbType', CBTYPE);
  2985. cb.name = cbName;
  2986. cb.value = cbName;
  2987. cb.checked = VARS.Options[cbName];
  2988.  
  2989. // -- create input box
  2990. let input = document.createElement('input');
  2991. input.type = 'text';
  2992. input.name = iName;
  2993. input.value = VARS.Options[iName];
  2994. input.placeholder = '1000';
  2995. input.size = 6;
  2996. input.addEventListener('input', checkInputNumber, false);
  2997.  
  2998. // -- wrap checkbox and input inside a label
  2999. let label = document.createElement('label');
  3000. label.appendChild(cb);
  3001. label.appendChild(document.createTextNode(KeyWords[cbName][VARS.language] + ': '));
  3002. label.appendChild(input);
  3003.  
  3004. // -- wrap inside a div container ..
  3005. let div = document.createElement('div');
  3006. div.appendChild(label);
  3007. return div;
  3008. }
  3009.  
  3010. function checkInputNumber(event) {
  3011. // -- accept numbers/digits only.
  3012. const el = event.target;
  3013. if (el.value === '') {
  3014. return true;
  3015. }
  3016. const digitsValues = el.value.replace(/\D/g, '');
  3017. el.value = digitsValues.length > 0 ? parseInt(digitsValues) : '';
  3018. }
  3019.  
  3020. function createDialog() {
  3021. let dlg, hdr, hdr1, hdr2, hdr3, htxt, stxt, btn, cnt, fs, l, s, ta, div, footer;
  3022.  
  3023. // -- wrapper
  3024. dlg = document.createElement('div');
  3025. dlg.id = 'fbcmf';
  3026. dlg.className = 'fb-cmf';
  3027. // class "show" reveals the dialog.
  3028. // -- header (logo + title + close button)
  3029. hdr = document.createElement('header');
  3030. hdr1 = document.createElement('div');
  3031. hdr1.className = 'fb-cmf-icon';
  3032. hdr1.innerHTML = VARS.logoHTML;
  3033.  
  3034. hdr2 = document.createElement('div');
  3035. hdr2.className = 'fb-cmf-title';
  3036. htxt = document.createElement('div');
  3037. htxt.textContent = KeyWords.DLG_TITLE['en'];
  3038. s = document.createElement('small');
  3039. s.className = 'script-version';
  3040. s.appendChild(document.createTextNode(` (${SCRIPT_VERSION})`));
  3041. htxt.appendChild(s);
  3042. hdr2.appendChild(htxt);
  3043. if (VARS.language !== 'en') {
  3044. stxt = document.createElement('small');
  3045. stxt.textContent = `(${KeyWords.DLG_TITLE[VARS.language]})`;
  3046. hdr2.appendChild(stxt);
  3047. hdr2.classList.add('fb-cmf-lang-2');
  3048. }
  3049. else {
  3050. hdr2.classList.add('fb-cmf-lang-1')
  3051. }
  3052. hdr3 = document.createElement('div');
  3053. hdr3.className = 'fb-cmf-close';
  3054. btn = document.createElement('button');
  3055. btn.textContent = 'X';
  3056. btn.addEventListener('click', toggleDialog, false);
  3057. hdr3.appendChild(btn);
  3058.  
  3059. hdr.appendChild(hdr1);
  3060. hdr.appendChild(hdr2);
  3061. hdr.appendChild(hdr3);
  3062. dlg.appendChild(hdr);
  3063.  
  3064. // content container
  3065. cnt = document.createElement('div');
  3066. cnt.classList.add('content');
  3067.  
  3068. // -- News Feed options
  3069. fs = document.createElement('fieldset');
  3070. l = document.createElement('legend');
  3071. l.textContent = KeyWords.DLG_NF[VARS.language];
  3072. fs.appendChild(l);
  3073. fs.appendChild(createSingleCB('NF_SPONSORED', false)); // -- changed to false (Dec 2023)
  3074. for (const key in KeyWords) {
  3075. if (key.slice(0, 3) === 'NF_') {
  3076. if (key.slice(0, 8) === 'NF_BLOCK') {
  3077. continue;
  3078. }
  3079. if (key.slice(0, 8) === 'NF_LIKES') {
  3080. if (key === 'NF_LIKES_MAXIMUM') {
  3081. fs.appendChild(createCheckboxAndInput(key, 'NF_LIKES_MAXIMUM_COUNT'));
  3082. }
  3083. }
  3084. else {
  3085. fs.appendChild(createSingleCB(key));
  3086. }
  3087. }
  3088. }
  3089.  
  3090. // -- Keywords to block - News Feed
  3091. fs.appendChild(document.createElement('br'));
  3092. l = document.createElement('strong');
  3093. l.textContent = KeyWords.DLG_BLOCK_TEXT_FILTER_TITLE[VARS.language] + ":";
  3094. fs.appendChild(l);
  3095.  
  3096. createMultipeCBs('NF_BLOCKED_FEED', 0).forEach(el => {
  3097. fs.appendChild(el);
  3098. });
  3099.  
  3100. fs.appendChild(createSingleCB('NF_BLOCKED_ENABLED'));
  3101. s = document.createElement('small');
  3102. s.appendChild(document.createTextNode(KeyWords.DLG_BLOCK_NEW_LINE[VARS.language]));
  3103. fs.appendChild(s);
  3104. ta = document.createElement('textarea');
  3105. ta.name = 'NF_BLOCKED_TEXT';
  3106. ta.textContent = VARS.Options.NF_BLOCKED_TEXT.split(VARS.SEP).join('\n');
  3107. fs.appendChild(ta);
  3108. cnt.appendChild(fs);
  3109.  
  3110. // -- Groups Feed options
  3111. fs = document.createElement('fieldset');
  3112. l = document.createElement('legend');
  3113. l.textContent = KeyWords.DLG_GF[VARS.language];
  3114. fs.appendChild(l);
  3115. fs.appendChild(createSingleCB('GF_SPONSORED', false)); // -- changed to false (Dec 2023)
  3116. for (const key in KeyWords) {
  3117. if (key.slice(0, 3) === 'GF_' && key.slice(0, 8) !== 'GF_BLOCK') {
  3118. fs.appendChild(createSingleCB(key));
  3119. }
  3120. }
  3121.  
  3122. // -- Keywords to block - Groups Feed
  3123. fs.appendChild(document.createElement('br'));
  3124. l = document.createElement('strong');
  3125. l.textContent = KeyWords.DLG_BLOCK_TEXT_FILTER_TITLE[VARS.language] + ':';
  3126. fs.appendChild(l);
  3127.  
  3128. createMultipeCBs('GF_BLOCKED_FEED', 1).forEach(el => {
  3129. fs.appendChild(el);
  3130. });
  3131.  
  3132. fs.appendChild(createSingleCB('GF_BLOCKED_ENABLED'));
  3133. s = document.createElement('small');
  3134. s.appendChild(document.createTextNode(KeyWords.DLG_BLOCK_NEW_LINE[VARS.language]));
  3135. fs.appendChild(s);
  3136. ta = document.createElement('textarea');
  3137. ta.name = 'GF_BLOCKED_TEXT';
  3138. ta.textContent = VARS.Options.GF_BLOCKED_TEXT.split(VARS.SEP).join('\n');
  3139. fs.appendChild(ta);
  3140. cnt.appendChild(fs);
  3141.  
  3142. // -- Watch Videos Feed options
  3143. fs = document.createElement('fieldset');
  3144. l = document.createElement('legend');
  3145. l.textContent = KeyWords.DLG_VF[VARS.language];
  3146. fs.appendChild(l);
  3147. fs.appendChild(createSingleCB('VF_SPONSORED', false)); // -- changed to false (Dec 2023)
  3148. for (const key in KeyWords) {
  3149. if (key.slice(0, 3) === 'VF_' && key.slice(0, 8) !== 'VF_BLOCK') {
  3150. fs.appendChild(createSingleCB(key));
  3151. }
  3152. }
  3153.  
  3154. // -- Keywords to block - Watch Videos Feed
  3155. fs.appendChild(document.createElement('br'));
  3156. l = document.createElement('strong');
  3157. l.textContent = KeyWords.DLG_BLOCK_TEXT_FILTER_TITLE[VARS.language] + ':';
  3158. fs.appendChild(l);
  3159.  
  3160. createMultipeCBs('VF_BLOCKED_FEED', 2).forEach(el => {
  3161. fs.appendChild(el);
  3162. });
  3163.  
  3164. fs.appendChild(createSingleCB('VF_BLOCKED_ENABLED'));
  3165. s = document.createElement('small');
  3166. s.appendChild(document.createTextNode(KeyWords.DLG_BLOCK_NEW_LINE[VARS.language]));
  3167. fs.appendChild(s);
  3168. ta = document.createElement('textarea');
  3169. ta.name = 'VF_BLOCKED_TEXT';
  3170. ta.textContent = VARS.Options.VF_BLOCKED_TEXT.split(VARS.SEP).join('\n');
  3171. fs.appendChild(ta);
  3172. cnt.appendChild(fs);
  3173.  
  3174. // -- MarketPlace option(s)
  3175. fs = document.createElement('fieldset');
  3176. l = document.createElement('legend');
  3177. l.textContent = KeyWords.DLG_MP[VARS.language];
  3178. fs.appendChild(l);
  3179. fs.appendChild(createSingleCB('MP_SPONSORED', false)); // -- changed to false (Dec 2023)
  3180.  
  3181. // -- Keywords to block - Marketplace Feed
  3182. fs.appendChild(document.createElement('br'));
  3183. l = document.createElement('strong');
  3184. l.textContent = KeyWords.DLG_BLOCK_TEXT_FILTER_TITLE[VARS.language] + ':';
  3185. fs.appendChild(l);
  3186.  
  3187. createMultipeCBs('MP_BLOCKED_FEED', 0).forEach(el => {
  3188. fs.appendChild(el);
  3189. });
  3190. // -- 2 x textarea boxes; one for prices and one for description
  3191. fs.appendChild(createSingleCB('MP_BLOCKED_ENABLED'));
  3192. l = document.createElement('strong');
  3193. l.textContent = 'Prices: ';
  3194. fs.appendChild(l);
  3195. fs.appendChild(document.createElement('br'));
  3196. s = document.createElement('small');
  3197. s.appendChild(document.createTextNode(KeyWords.DLG_BLOCK_NEW_LINE[VARS.language]));
  3198. fs.appendChild(s);
  3199. ta = document.createElement('textarea');
  3200. ta.name = 'MP_BLOCKED_TEXT';
  3201. ta.textContent = VARS.Options.MP_BLOCKED_TEXT.split(VARS.SEP).join('\n');
  3202. fs.appendChild(ta);
  3203. fs.appendChild(document.createElement('br'));
  3204. fs.appendChild(document.createElement('br'));
  3205.  
  3206. l = document.createElement('strong');
  3207. l.textContent = 'Description: ';
  3208. fs.appendChild(l);
  3209. fs.appendChild(document.createElement('br'));
  3210. s = document.createElement('small');
  3211. s.appendChild(document.createTextNode(KeyWords.DLG_BLOCK_NEW_LINE[VARS.language]));
  3212. fs.appendChild(s);
  3213. ta = document.createElement('textarea');
  3214. ta.name = 'MP_BLOCKED_TEXT_DESCRIPTION';
  3215. ta.textContent = VARS.Options.MP_BLOCKED_TEXT_DESCRIPTION.split(VARS.SEP).join('\n');
  3216. fs.appendChild(ta);
  3217.  
  3218. cnt.appendChild(fs);
  3219.  
  3220. // -- Other items options
  3221. fs = document.createElement('fieldset');
  3222. l = document.createElement('legend');
  3223. l.textContent = KeyWords.DLG_OTHER[VARS.language];
  3224. fs.appendChild(l);
  3225. for (const key in KeyWords) {
  3226. if (key.slice(0, 10) === 'OTHER_INFO') {
  3227. fs.appendChild(createSingleCB(key));
  3228. }
  3229. }
  3230. cnt.appendChild(fs);
  3231.  
  3232. // -- Reels
  3233. fs = document.createElement('fieldset');
  3234. l = document.createElement('legend');
  3235. l.textContent = KeyWords.REELS_TITLE[VARS.language];
  3236. fs.appendChild(l);
  3237. fs.appendChild(createSingleCB('REELS_CONTROLS'), false);
  3238. cnt.appendChild(fs);
  3239.  
  3240. // -- Verbosity
  3241. fs = document.createElement('fieldset');
  3242. l = document.createElement('legend');
  3243. l.textContent = KeyWords.DLG_VERBOSITY[VARS.language];
  3244. fs.appendChild(l);
  3245. s = document.createElement('span');
  3246. s.appendChild(document.createTextNode(`${KeyWords.DLG_VERBOSITY_MESSAGE[VARS.language]}:`));
  3247. fs.appendChild(s);
  3248. fs.appendChild(createRB('VERBOSITY_LEVEL', '0', `<${KeyWords.VERBOSITY_NO_MESSAGE[VARS.language]}>`));
  3249. fs.appendChild(createRB('VERBOSITY_LEVEL', '1', `${KeyWords.VERBOSITY_MESSAGE[VARS.language][0]}______`));
  3250. fs.appendChild(createRB('VERBOSITY_LEVEL', '2', `7${KeyWords.VERBOSITY_MESSAGE[VARS.language][1]}`));
  3251. fs.appendChild(document.createElement('br'));
  3252. fs.appendChild(createInput('VERBOSITY_MESSAGE_COLOUR', `${KeyWords.VERBOSITY_MESSAGE_COLOUR[VARS.language]}:`));
  3253. fs.appendChild(createInput('VERBOSITY_MESSAGE_BG_COLOUR', `${KeyWords.VERBOSITY_MESSAGE_BG_COLOUR[VARS.language]}:`));
  3254. fs.appendChild(document.createElement('br'));
  3255. fs.appendChild(createSingleCB('VERBOSITY_DEBUG'));
  3256. cnt.appendChild(fs);
  3257.  
  3258. // -- cmf customisations
  3259. fs = document.createElement('fieldset');
  3260. l = document.createElement('legend');
  3261. l.textContent = KeyWords.CMF_CUSTOMISATIONS[VARS.language];
  3262. fs.appendChild(l);
  3263. fs.appendChild(document.createTextNode(`${KeyWords.CMF_BTN_LOCATION[VARS.language]}:`));
  3264. let len = KeyWords.CMF_BTN_OPTION[VARS.language].length;
  3265. for (let i = 0; i < len; i++) {
  3266. fs.appendChild(createRB('CMF_BTN_OPTION', i.toString(), KeyWords.CMF_BTN_OPTION[VARS.language][i]));
  3267. };
  3268. fs.appendChild(document.createElement('br'));
  3269. fs.appendChild(document.createTextNode(`${KeyWords.CMF_DIALOG_LOCATION[VARS.language]}:`));
  3270. fs.appendChild(createRB('CMF_DIALOG_OPTION', '0', KeyWords.CMF_DIALOG_OPTION[VARS.language][0]));
  3271. fs.appendChild(createRB('CMF_DIALOG_OPTION', '1', KeyWords.CMF_DIALOG_OPTION[VARS.language][1]));
  3272. fs.appendChild(document.createElement('br'));
  3273. fs.appendChild(createInput('CMF_BORDER_COLOUR', `${KeyWords.CMF_BORDER_COLOUR[VARS.language]}:`));
  3274. cnt.appendChild(fs);
  3275.  
  3276. // -- tips
  3277. fs = document.createElement('fieldset');
  3278. l = document.createElement('legend');
  3279. l.textContent = KeyWords.DLG_TIPS[VARS.language];
  3280. fs.appendChild(l);
  3281. s = document.createElement('span');
  3282. s.appendChild(document.createTextNode(KeyWords.DLG_TIPS_CONTENT[VARS.language]));
  3283. fs.appendChild(s);
  3284. cnt.appendChild(fs);
  3285.  
  3286. dlg.appendChild(cnt);
  3287.  
  3288. // -- Actions (buttons) + status
  3289. footer = document.createElement('footer');
  3290. // footer.classList.add('buttons');
  3291. btn = document.createElement('button');
  3292. btn.textContent = KeyWords.DLG_BUTTONS[VARS.language][0]; // save
  3293. btn.addEventListener('click', saveUserOptions, false);
  3294. footer.appendChild(btn);
  3295. btn = document.createElement('button');
  3296. btn.textContent = KeyWords.DLG_BUTTONS[VARS.language][1]; // close
  3297. btn.addEventListener('click', toggleDialog, false);
  3298. footer.appendChild(btn);
  3299. btn = document.createElement('button');
  3300. btn.textContent = KeyWords.DLG_BUTTONS[VARS.language][2]; // export
  3301. btn.addEventListener('click', exportUserOptions, false);
  3302. footer.appendChild(btn);
  3303. btn = document.createElement('button');
  3304. btn.textContent = KeyWords.DLG_BUTTONS[VARS.language][3]; // import
  3305. btn.setAttribute('id', 'BTNImport');
  3306. footer.appendChild(btn);
  3307. btn = document.createElement('button');
  3308. btn.textContent = KeyWords.DLG_BUTTONS[VARS.language][4]; // reset
  3309. btn.addEventListener('click', resetUserOptions, false);
  3310. footer.appendChild(btn);
  3311. // -- file input field is hidden, but triggered by the Import button.
  3312. let fileImport = document.createElement('input');
  3313. fileImport.setAttribute('type', 'file');
  3314. fileImport.setAttribute('id', `FI${postAtt}`);
  3315. fileImport.classList.add('fileInput');
  3316. footer.appendChild(fileImport);
  3317. // -- save/export/import/reset status/results
  3318. div = document.createElement('div');
  3319. div.classList.add('fileResults');
  3320. footer.appendChild(div);
  3321.  
  3322. dlg.appendChild(footer);
  3323.  
  3324. document.body.appendChild(dlg);
  3325.  
  3326. // -- add event listeners to the import button and file input field
  3327. let fileInput = document.getElementById(`FI${postAtt}`);
  3328. fileInput.addEventListener('change', importUserOptions, false);
  3329. // -- make the btn Import trigger file input ...
  3330. let btnImport = document.getElementById('BTNImport');
  3331. btnImport.addEventListener('click', function () {
  3332. fileInput.click()
  3333. }, false);
  3334. }
  3335.  
  3336. function updateDialog() {
  3337. let content = document.getElementById('fbcmf').querySelector('.content');
  3338. if (content) {
  3339. // -- toggle checkboxes
  3340. let cbs = Array.from(content.querySelectorAll('input[type="checkbox"][cbtype="T"]'));
  3341. cbs.forEach(cb => {
  3342. if (VARS.Options.hasOwnProperty(cb.name)) {
  3343. cb.checked = VARS.Options[cb.name];
  3344. }
  3345. });
  3346. // -- multiple values checkboxes
  3347. cbs = Array.from(content.querySelectorAll('input[type="checkbox"][cbtype="M"]'));
  3348. cbs.forEach(cb => {
  3349. if (VARS.Options.hasOwnProperty(cb.name)) {
  3350. cb.checked = VARS.Options[cb.name][parseInt(cb.value)] === '1';
  3351. }
  3352. });
  3353. // -- radios
  3354. let rbs = content.querySelectorAll('input[type="radio"]');
  3355. rbs.forEach(rb => {
  3356. if (VARS.Options.hasOwnProperty(rb.name) && (rb.value === VARS.Options[rb.name])) {
  3357. rb.checked = VARS.Options[rb.name];
  3358. }
  3359. });
  3360. // -- textareas
  3361. let tas = Array.from(content.querySelectorAll('textarea'));
  3362. tas.forEach(ta => {
  3363. if (VARS.Options.hasOwnProperty(ta.name)) {
  3364. ta.value = VARS.Options[ta.name].replaceAll(VARS.SEP, '\n');
  3365. }
  3366. });
  3367. // -- plain inputs
  3368. let inputs = Array.from(content.querySelectorAll('input[type="text"]'));
  3369. inputs.forEach(inp => {
  3370. if (VARS.Options.hasOwnProperty(inp.name)) {
  3371. inp.value = VARS.Options[inp.name];
  3372. }
  3373. });
  3374. }
  3375. }
  3376.  
  3377. async function saveUserOptions(event, source = 'dialog') {
  3378. // -- save Options in indexeddb as JSON.
  3379. if (source === 'dialog') {
  3380. let md, cbs, rbs, tas, inputs;
  3381.  
  3382. // -- grab the dialog box and get the various options.
  3383. md = document.getElementById('fbcmf');
  3384.  
  3385. // -- input validation for NF_LIKES_MAXIMUM_COUNT
  3386. const elLikesMaximum = md.querySelector('input[name="NF_LIKES_MAXIMUM"]');
  3387. if (elLikesMaximum.checked) {
  3388. const elLikesMaximumCount = md.querySelector('input[name="NF_LIKES_MAXIMUM_COUNT"]');
  3389. if (elLikesMaximumCount.value.length === 0) {
  3390. alert(KeyWords.NF_LIKES_MAXIMUM[VARS.language] + '?');
  3391. elLikesMaximumCount.focus();
  3392. return;
  3393. }
  3394. }
  3395.  
  3396. // -- checkboxes (toggle variations)
  3397. cbs = Array.from(md.querySelectorAll('input[type="checkbox"][cbtype="T"]'));
  3398. cbs.forEach(cb => {
  3399. VARS.Options[cb.name] = cb.checked;
  3400. });
  3401. // -- checkboxes (multipe values variations)
  3402. let cbName = 'NF_BLOCKED_FEED';
  3403. cbs = Array.from(md.querySelectorAll(`input[type="checkbox"][name="${cbName}"]`));
  3404. cbs.forEach(cb => {
  3405. VARS.Options[cbName][parseInt(cb.value)] = (cb.checked) ? '1' : '0';
  3406. });
  3407. cbName = 'GF_BLOCKED_FEED';
  3408. cbs = Array.from(md.querySelectorAll(`input[type="checkbox"][name="${cbName}"]`));
  3409. cbs.forEach(cb => {
  3410. VARS.Options[cbName][parseInt(cb.value)] = (cb.checked) ? '1' : '0';
  3411. });
  3412. cbName = 'VF_BLOCKED_FEED';
  3413. cbs = Array.from(md.querySelectorAll(`input[type="checkbox"][name="${cbName}"]`));
  3414. cbs.forEach(cb => {
  3415. VARS.Options[cbName][parseInt(cb.value)] = (cb.checked) ? '1' : '0';
  3416. });
  3417. cbName = 'MP_BLOCKED_FEED';
  3418. cbs = Array.from(md.querySelectorAll(`input[type="checkbox"][name="${cbName}"]`));
  3419. cbs.forEach(cb => {
  3420. VARS.Options[cbName][parseInt(cb.value)] = (cb.checked) ? '1' : '0';
  3421. });
  3422.  
  3423. // -- radios
  3424. rbs = md.querySelectorAll('input[type="radio"]:checked');
  3425. rbs.forEach(rb => {
  3426. VARS.Options[rb.name] = rb.value;
  3427. });
  3428. // -- text input
  3429. inputs = Array.from(md.querySelectorAll('input[type="text"]'));
  3430. inputs.forEach(inp => {
  3431. VARS.Options[inp.name] = inp.value;
  3432. });
  3433. // -- Blocked text (textareas)
  3434. tas = md.querySelectorAll('textarea');
  3435. tas.forEach(ta => {
  3436. let txtn = ta.value.split('\n');
  3437. let txts = [];
  3438. txtn.forEach(txt => {
  3439. if (txt.trim().length > 0) {
  3440. txts.push(txt); // -- do not trim - retain entry as is.
  3441. }
  3442. });
  3443. VARS.Options[ta.name] = txts.join(VARS.SEP);
  3444. });
  3445. }
  3446.  
  3447. // -- clear out items that are not valid.
  3448. let md = document.getElementById('fbcmf');
  3449. let inputs = Array.from(md.querySelectorAll('input:not([type="file"]), textarea'));
  3450. let validNames = [];
  3451. inputs.forEach(inp => {
  3452. if (validNames.indexOf(inp.name) < 0) {
  3453. validNames.push(inp.name);
  3454. }
  3455. });
  3456. for (let key in VARS.Options) {
  3457. if (validNames.indexOf(key) < 0) {
  3458. if (VARS.Options.VERBOSITY_DEBUG) {
  3459. console.info(log + 'saveUserOptions(); Deleting key:', key);
  3460. }
  3461. delete VARS.Options[key];
  3462. }
  3463. }
  3464.  
  3465. // -- save options
  3466. let result = await set(DBVARS.DBKey, JSON.stringify(VARS.Options), DBVARS.ostore).then(() => {
  3467. // -- refresh options and split blocks of texts
  3468. let result2 = getUserOptions().then(() => {
  3469. return true;
  3470. });
  3471. return result2;
  3472. }).catch((err) => {
  3473. console.info(`${log}saveUserOptions() > set() -> Error:`, err);
  3474. return false;
  3475. });
  3476. if (VARS.Options.VERBOSITY_DEBUG) {
  3477. console.info(`${log}saveUserOptions() > set() -> Saved:`, result);
  3478. }
  3479. // - update some variables.
  3480. if (result) {
  3481. setFeedSettings(true);
  3482. // - rebuild css - need user's preferences to take effect
  3483. addCSS();
  3484. addExtraCSS();
  3485. // - check if toggling debugging mode.
  3486. toggleHiddenElements();
  3487. }
  3488. document.querySelector('#fbcmf .fileResults').textContent = `Last Saved @ ${(new Date).toTimeString().slice(0, 8)}`;
  3489.  
  3490. // -- reset the posts and do the cleaning/mopping up again ...
  3491. if (VARS.isAF) {
  3492. // -- "reset" scan counts
  3493. VARS.scanCountStart += 100;
  3494. VARS.scanCountMaxLoop += 100;
  3495. // -- "purge" toggle post state bar + post-tab
  3496. let elements = document.querySelectorAll(`[${postAttTab}]`);
  3497. for (const element of elements) {
  3498. const elParent = element.parentElement;
  3499. elParent.removeChild(element);
  3500. }
  3501. // -- remove attribute
  3502. elements = document.querySelectorAll(`[${postAtt}]`);
  3503. for (const element of elements) {
  3504. element.removeAttribute(postAtt);
  3505. element.removeAttribute(VARS.cssHide);
  3506. element.removeAttribute(VARS.cssHideEl);
  3507. element.removeAttribute(VARS.cssHideNumberOfShares);
  3508. element.removeAttribute(VARS.cssShow);
  3509.  
  3510. // -- February 2024 - hot fix !!! - remove the collapse post completely hack
  3511. const elWithMargin = climbUpTheTree(element, 4);
  3512. if (elWithMargin && elWithMargin.hasAttribute('style')) {
  3513. elWithMargin.removeAttribute('style');
  3514. }
  3515. }
  3516. // -- remove other attributes
  3517. elements = document.querySelectorAll(`[${postAttCPID}], [${postAttChildFlag}]`);
  3518. for (const element of elements) {
  3519. if (element.hasAttribute(postAttCPID)) {
  3520. element.removeAttribute(postAttCPID);
  3521. }
  3522. if (element.hasAttribute(postAttChildFlag)) {
  3523. element.removeAttribute(postAttChildFlag);
  3524. }
  3525. }
  3526. // -- remove some more attributes
  3527. // -- (don't add cssShow to query, the button needs it ...)
  3528. elements = document.querySelectorAll(`[${VARS.cssHide}], [${VARS.cssHideEl}], [${VARS.cssHideNumberOfShares}]`);
  3529. for (const element of elements) {
  3530. element.removeAttribute(VARS.cssHide);
  3531. element.removeAttribute(VARS.cssHideEl);
  3532. element.removeAttribute(VARS.cssHideNumberOfShares);
  3533. element.removeAttribute(VARS.cssShow);
  3534. }
  3535.  
  3536. if (VARS.isNF) {
  3537. mopUpTheNewsFeed();
  3538. }
  3539. else if (VARS.isGF) {
  3540. mopUpTheGroupsFeed();
  3541. }
  3542. else if (VARS.isVF) {
  3543. mopUpTheWatchVideosFeed();
  3544. }
  3545. else if (VARS.isMF) {
  3546. mopUpTheMarketplaceFeed();
  3547. }
  3548. else if (VARS.isSF) {
  3549. mopUpTheSearchFeed();
  3550. }
  3551. else if (VARS.isRF) {
  3552. mopUpTheReelFeed('saveUserOptions');
  3553. }
  3554. }
  3555. // console.info(log + 'saveUserOptions(); OPTIONS:', VARS.Options);
  3556. }
  3557.  
  3558. function exportUserOptions() {
  3559. // -- export user's options into a text file.
  3560. let exportOptions = document.createElement("a");
  3561. exportOptions.href = window.URL.createObjectURL(new Blob([JSON.stringify(VARS.Options)], { type: "text/plain" }));
  3562. exportOptions.download = 'fb - clean my feeds - settings.json';
  3563. exportOptions.click();
  3564. exportOptions.remove();
  3565. document.querySelector('#fbcmf .fileResults').textContent = 'Exported: fb - clean my feeds - settings.json';
  3566. }
  3567.  
  3568. function importUserOptions(event) {
  3569. // -- import user's options from a text file.
  3570. let fileResults = document.querySelector('#fbcmf .fileResults');
  3571. let file = event.target.files[0];
  3572. let fileN = event.target.files[0].name;
  3573. // -- setup reader for reading in the file
  3574. let reader = new FileReader();
  3575. // -- what to do when reader is called.
  3576. reader.onload = (file) => {
  3577. try {
  3578. let fileContent = JSON.parse(file.target.result);
  3579. if (
  3580. fileContent.hasOwnProperty('NF_SPONSORED') &&
  3581. fileContent.hasOwnProperty('GF_SPONSORED') &&
  3582. fileContent.hasOwnProperty('VF_SPONSORED') &&
  3583. fileContent.hasOwnProperty('MP_SPONSORED')
  3584. ) {
  3585. VARS.Options = fileContent;
  3586. // console.info(log + 'importUserOptions() > reader.onload: Options:', VARS.Options);
  3587. // -- save the file to the db
  3588. // -- save will run getUserOptions();
  3589. let result = saveUserOptions(null, 'file').then(() => {
  3590. updateDialog();
  3591. fileResults.textContent = `File imported: ${fileN}`;
  3592. return true;
  3593. });
  3594. }
  3595. else {
  3596. fileResults.textContent = `File NOT imported: ${fileN}`;
  3597. }
  3598. }
  3599. catch (e) {
  3600. fileResults.textContent = `File NOT imported: ${fileN}`;
  3601. }
  3602. }
  3603. // -- call reader to read in the file ...
  3604. reader.readAsText(file);
  3605. }
  3606.  
  3607. function resetUserOptions() {
  3608. // -- reset the options to original state (before customisations)
  3609. del(DBVARS.DBKey, DBVARS.ostore)
  3610. .then(() => {
  3611. // console.info(log + 'resetUserOptions();', 'Data deleted successfully');
  3612. setLanguageAndOptions();
  3613. let result = saveUserOptions(null, 'reset').then(() => {
  3614. updateDialog();
  3615. return true;
  3616. });
  3617. })
  3618. .catch((error) => {
  3619. console.info(log + 'resetUserOptions(); Error - unable to delete Data.', error);
  3620. });
  3621. }
  3622.  
  3623. function createToggleButton() {
  3624. let btn = document.createElement('button');
  3625. btn.innerHTML = VARS.logoHTML;
  3626. btn.id = 'fbcmfToggle';
  3627. btn.title = KeyWords.DLG_TITLE[VARS.language];
  3628. btn.className = 'fb-cmf-toggle fb-cmf-icon';
  3629. document.body.appendChild(btn);
  3630. btn.addEventListener('click', toggleDialog, false);
  3631. VARS.btnToggleEl = btn;
  3632. }
  3633.  
  3634. createToggleButton();
  3635. createDialog();
  3636. }
  3637. // --- end of dailog code.
  3638.  
  3639. // -- toggleDialog() function placed here to allow a GM.registerMenuCommand(...) to call it.
  3640. function toggleDialog() {
  3641. const elDialog = document.getElementById('fbcmf');
  3642. if (elDialog.hasAttribute(VARS.cssShow)) {
  3643. elDialog.removeAttribute(VARS.cssShow);
  3644. }
  3645. else {
  3646. elDialog.setAttribute(VARS.cssShow, '');
  3647. }
  3648. }
  3649.  
  3650. // adjust some settings - if URL has changed.
  3651. function setFeedSettings(forceUpdate = false) {
  3652. if ((VARS.prevURL !== window.location.href) || forceUpdate) {
  3653. // - remember current page's URL
  3654. VARS.prevURL = window.location.href;
  3655. // -- pathname pattern: /marketplace...
  3656. VARS.prevPathname = window.location.pathname;
  3657. // -- search pattern: ?query= ...
  3658. VARS.prevQuery = window.location.search;
  3659. // - reset feeds flags
  3660. VARS.isNF = false;
  3661. VARS.isGF = false;
  3662. VARS.isVF = false;
  3663. VARS.isMF = false;
  3664. VARS.isSF = false;
  3665. VARS.isRF = false;
  3666. if ((VARS.prevPathname === '/') || (VARS.prevPathname === '/home.php')) {
  3667. // -- news feed
  3668. // -- nb: "Feeds (most recent)" combines a few feeds into one ... apply NF rules to all, except Groups.
  3669. if (VARS.prevQuery.indexOf('?filter=groups') < 0) {
  3670. VARS.isNF = true;
  3671. }
  3672. else {
  3673. VARS.isGF = true;
  3674. VARS.gfType = 'groups-recent';
  3675. }
  3676. }
  3677. else if (VARS.prevPathname.indexOf('/groups/') >= 0) {
  3678. // -- groups feed
  3679. VARS.isGF = true;
  3680. if (VARS.prevPathname.indexOf('/groups/feed') >= 0) {
  3681. VARS.gfType = 'groups'
  3682. }
  3683. else if (VARS.prevPathname.indexOf('/groups/search') >= 0) {
  3684. VARS.gfType = 'search';
  3685. }
  3686. else if (VARS.prevPathname.indexOf('?filter=groups&sk=h_chr') >= 0) {
  3687. VARS.gfType = 'groups-recent';
  3688. }
  3689. else {
  3690. VARS.gfType = 'group';
  3691. }
  3692. }
  3693. else if (VARS.prevPathname.indexOf('/watch') >= 0) {
  3694. // -- watch videos feed
  3695. VARS.isVF = true;
  3696. if (VARS.prevPathname.indexOf('/watch/search') >= 0) {
  3697. VARS.vfType = 'search';
  3698. }
  3699. else if (VARS.prevQuery.indexOf('?ref=seach') >= 0) {
  3700. VARS.vfType = 'item';
  3701. }
  3702. else if (VARS.prevQuery.indexOf('?v=') >= 0) {
  3703. VARS.vfType = 'item';
  3704. }
  3705. else {
  3706. VARS.vfType = 'videos';
  3707. }
  3708. }
  3709. else if (VARS.prevPathname.indexOf('/marketplace') >= 0) {
  3710. // -- marketplace
  3711. VARS.isMF = true;
  3712. mp_stopTrackingDirtIntoMyHouse();
  3713. if (VARS.isMF && VARS.prevPathname.indexOf('/item/') >= 0) {
  3714. // - viewing an item
  3715. VARS.mpType = 'item';
  3716. }
  3717. else if (VARS.prevPathname.indexOf('/search') >= 0) {
  3718. // - searching within marketplace ... (has similar layout to category feed)
  3719. VARS.mpType = 'search';
  3720. }
  3721. else if (VARS.prevPathname.indexOf('/category/') >= 0) {
  3722. // - category feed
  3723. VARS.mpType = 'category';
  3724. }
  3725. else {
  3726. // -- check again for category - may have a location in the pathName ...
  3727. // -- pattern: :: https://www.facebook.com/marketplace/<location>/sports
  3728. const urlBits = VARS.prevPathname.split('/');
  3729. if (urlBits.length > 3) {
  3730. VARS.mpType = 'category';
  3731. }
  3732. else {
  3733. VARS.mpType = 'marketplace';
  3734. }
  3735. }
  3736. }
  3737. else if (VARS.prevPathname.indexOf('/commerce/listing/') >= 0) {
  3738. // - a group's for sale post - redirected to marketplace ...
  3739. // - same layout as a marketplace item.
  3740. VARS.isMF = true;
  3741. VARS.mpType = 'item';
  3742. }
  3743. else if (['/search/top/', '/search/top', '/search/posts/', '/search/posts', '/search/pages/'].indexOf(VARS.prevPathname) >= 0) {
  3744. // -- search results page : "All" and "Posts"
  3745. VARS.isSF = true;
  3746. }
  3747. else if (VARS.prevPathname.indexOf('/reel/') >= 0) {
  3748. // -- reel(s) page
  3749. // VARS.isRF = true;
  3750. VARS.isRF = (VARS.Options.REELS_CONTROLS === true);
  3751. }
  3752.  
  3753. VARS.isAF = (VARS.isNF || VARS.isGF || VARS.isVF || VARS.isMF || VARS.isSF || VARS.isRF);
  3754.  
  3755. // when to display the cmf button
  3756. if (VARS.isAF) {
  3757. if (VARS.btnToggleEl) {
  3758. VARS.btnToggleEl.setAttribute(VARS.cssShow, '');
  3759. }
  3760. }
  3761. else {
  3762. if (VARS.btnToggleEl) {
  3763. VARS.btnToggleEl.removeAttribute(VARS.cssShow);
  3764. }
  3765. }
  3766.  
  3767. // - reset consecutive count of hidden posts
  3768. VARS.echoCount = 0;
  3769.  
  3770. // console.info(`${log}setFeedSettings() :: isAF: ${VARS.isAF}; isNF: ${VARS.isNF}; isGF: ${VARS.isGF}; isVF: ${VARS.isVF}; isMF: ${VARS.isMF}; isSF: ${VARS.isSF}; isRF: ${VARS.isRF};`);
  3771.  
  3772. return true;
  3773. }
  3774. else {
  3775. return false;
  3776. }
  3777. }
  3778.  
  3779. function climbUpTheTree(element, numberOfBranches = 1) {
  3780. while (element && numberOfBranches > 0) {
  3781. element = element.parentNode;
  3782. numberOfBranches--;
  3783. }
  3784. return element || null;
  3785. }
  3786.  
  3787. function doLightDusting(post) {
  3788. // - remove 'dusty' elements that interfere with querySelectorAll, nth-of-type, :not() queries.
  3789. // -- needs to run a few times to be effective.
  3790. let scanCount = VARS.scanCountStart;
  3791. if (post[postPropDS] !== undefined) {
  3792. scanCount = parseInt(post[postPropDS]);
  3793. scanCount = (scanCount < VARS.scanCountStart) ? VARS.scanCountStart : scanCount;
  3794. }
  3795. if (scanCount < VARS.scanCountMaxLoop) {
  3796. const dustySpots = post.querySelectorAll('[data-0="0"]');
  3797. if (dustySpots) {
  3798. dustySpots.forEach((element) => {
  3799. element.remove();
  3800. });
  3801. }
  3802. scanCount++;
  3803. post[postPropDS] = scanCount;
  3804. }
  3805. }
  3806.  
  3807. function scanTreeForText(theNode) {
  3808. const arrayTextValues = [];
  3809. const elements = theNode.querySelectorAll(':scope > div, :scope > blockquote, :scope > span');
  3810.  
  3811. for (const element of elements) {
  3812. if (element.hasAttribute('aria-hidden') && element.getAttribute('aria-hidden') === "false") {
  3813. // -- skip this branch (hidden)
  3814. continue;
  3815. }
  3816.  
  3817. // -- scan this branch
  3818. const walk = document.createTreeWalker(element, NodeFilter.SHOW_TEXT, null);
  3819. let currentNode;
  3820. while ((currentNode = walk.nextNode())) {
  3821. const elParent = currentNode.parentElement;
  3822. const elParentTN = elParent.tagName.toLowerCase();
  3823. const val = cleanText(currentNode.textContent).trim();
  3824.  
  3825. // console.info(log + '---> scanTreeForText(); currentNode:', currentNode, elParent, elParentTN, val);
  3826.  
  3827. if (val === '' || val.toLowerCase() === 'facebook') {
  3828. // -- skip this node
  3829. continue;
  3830. }
  3831.  
  3832. if (elParent.hasAttribute('aria-hidden') && elParent.getAttribute('aria-hidden') === 'true') {
  3833. // -- skip this node
  3834. continue;
  3835. }
  3836.  
  3837. // if (elParentTN === 'div' && elParent.hasAttribute('role') && elParent.getAttribute('role') === 'button') {
  3838. // // -- skip this node
  3839. // continue;
  3840. // }
  3841. if (elParentTN === 'div' && elParent.hasAttribute('role') && elParent.getAttribute('role') === 'button') {
  3842. // -- February 2024 - issue with "Anonymous participant" not being detected properly
  3843. // -- when viewing a post in a group (not groups feed), "Anonymous participant" is inside a div:button wrapped inside an object.
  3844. if (elParent.parentElement && elParent.parentElement.tagName.toLowerCase() !== 'object') {
  3845. // -- skip this node
  3846. continue;
  3847. }
  3848. }
  3849.  
  3850. if (elParentTN === 'title') {
  3851. // -- skip this node
  3852. continue;
  3853. }
  3854.  
  3855. // const elGeneric = elParent.closest('div[role="button"]');
  3856. // if (elGeneric === null && val.length > 1) {
  3857. // // - keep 2+ char strings.
  3858. // arrayTextValues.push(...val.split('\n'));
  3859. // }
  3860. // else {
  3861. // // -- skip this node (hidden / meta info)
  3862. // }
  3863.  
  3864. // -- February 2024 - issue with "Anonymous participant" not being detected properly
  3865. // --- usually has a div with role of button, and that div only has 1 descendant.
  3866. // --- previously, we skipped when a div has a button role.
  3867. const elGeneric = elParent.closest('div[role="button"]');
  3868. const elGenericDescendantsCount = elGeneric ? countDescendants(elGeneric) : 0;
  3869. // console.info(log + 'scanTreeForText(); final test:', elGeneric, elParent, currentNode, elGenericDescendantsCount, val);
  3870. if (elGenericDescendantsCount < 2 && val.length > 1) {
  3871. // - keep 2+ char strings.
  3872. arrayTextValues.push(...val.split('\n'));
  3873. }
  3874. else {
  3875. // -- skip this node (hidden / meta info)
  3876. }
  3877. }
  3878. }
  3879.  
  3880. // -- remove duplicates and return results.
  3881. // console.info(log + 'scanTreeForText(); returning::', theNode, arrayTextValues);
  3882. return [...new Set(arrayTextValues)];
  3883. }
  3884.  
  3885. function mp_scanTreeForText(theNode) {
  3886. const arrayTextValues = [];
  3887. let n;
  3888. const walk = document.createTreeWalker(theNode, NodeFilter.SHOW_TEXT, null);
  3889. while ((n = walk.nextNode())) {
  3890. let val = cleanText(n.textContent).trim();
  3891. if ((val !== '') && (val.length > 1) && (val.toLowerCase() !== 'facebook')) {
  3892. // - keep 2+ char strings.
  3893. // arrayTextValues.push(val);
  3894. arrayTextValues.push(val.toLowerCase());
  3895. }
  3896. }
  3897. return arrayTextValues;
  3898. }
  3899.  
  3900. function scanImagesForAltText(theNode) {
  3901. const arrayAltTextValues = [];
  3902. const images = theNode.querySelectorAll('img[alt]');
  3903. for (let i = 0; i < images.length; i++) {
  3904. const img = images[i];
  3905. if (img.alt.length > 0 && img.naturalWidth > 32) {
  3906. // -- (emojis usually have widths < 33 ... skip them)
  3907. const sAlt = cleanText(img.alt);
  3908. if (!arrayAltTextValues.includes(sAlt)) {
  3909. arrayAltTextValues.push(sAlt);
  3910. }
  3911. }
  3912. }
  3913. return arrayAltTextValues;
  3914. }
  3915.  
  3916. function countDescendants(element) {
  3917. return element.querySelectorAll('div, span').length;
  3918. }
  3919.  
  3920. function extractTextContent(post, selector, maxBlocks) {
  3921. // - get the text node values of the regular feed posts
  3922. // - get the alt-text values of any images in the feed posts
  3923. // -- scan the top portion of the posts (first maxBlocks blocks)
  3924. // -- parameters:
  3925. // post: post to scan
  3926. // selector: querySelector's query
  3927. // maxBlocks: max number of blocks to scan
  3928. const blocks = post.querySelectorAll(selector);
  3929. const arrayTextValues = [];
  3930.  
  3931. // - process first maxBlocks blocks
  3932. // - block 0 = Suggested headings, block 1 = title/heading, block 2 = content, block 3 = info box / comments, block 4 = comments
  3933. // - nb: some suggested posts only have one block ...
  3934. for (let b = 0; b < Math.min(maxBlocks, blocks.length); b++) {
  3935. const block = blocks[b];
  3936. if (countDescendants(block) > 0) {
  3937. arrayTextValues.push(...scanTreeForText(block));
  3938. arrayTextValues.push(...scanImagesForAltText(block));
  3939. }
  3940. }
  3941.  
  3942. return arrayTextValues.filter(item => item !== '');
  3943. }
  3944.  
  3945. function extractTextContentVF(post, selector, whichBlock) {
  3946. // - get the text node values of the regular feed posts
  3947. // -- scan a certain block in the posts
  3948. // -- parameters:
  3949. // post: post to scan
  3950. // selector: querySelector's query
  3951. // whichBlock: the block to scan for text (0 = first block ...)
  3952. const blocks = post.querySelectorAll(selector);
  3953. const arrayTextValues = [];
  3954. if ((blocks.length - 1) >= whichBlock) {
  3955. // - block 0 = Suggested headings, block 1 = title/heading, block 2 = content, block 3 = info box / comments, block 4 = comments
  3956. // - nb: some suggested posts only have one block ...
  3957. let blockToScan = blocks[whichBlock];
  3958. if (blockToScan.innerHTML.length > 0) {
  3959. arrayTextValues = arrayTextValues.concat(scanTreeForText(blockToScan));
  3960. }
  3961. }
  3962. return arrayTextValues;
  3963. }
  3964.  
  3965. function createTogglePostStateBar(reason) {
  3966. // :: <toggle button> <reason for hiding post(s)>
  3967. const elToggleBar = document.createElement('div');
  3968. elToggleBar.setAttribute(postAttTab, '0');
  3969.  
  3970. const elButtonBox = document.createElement('div');
  3971. elButtonBox.className = 'wbtn';
  3972.  
  3973. const elButton = document.createElement('button');
  3974. elButton.textContent = '___';
  3975. elButton.addEventListener('click', togglePost, false);
  3976. elButtonBox.appendChild(elButton);
  3977.  
  3978. const elTextReason = document.createElement('div');
  3979. elTextReason.className = 'wtxt';
  3980. elTextReason.textContent = KeyWords.VERBOSITY_MESSAGE[VARS.language][0] + reason;
  3981.  
  3982. elToggleBar.appendChild(elButtonBox);
  3983. elToggleBar.appendChild(elTextReason);
  3984.  
  3985. elToggleBar.addEventListener('click', togglePost, false);
  3986. return elToggleBar;
  3987. }
  3988.  
  3989. function createPostTab(reason) {
  3990. const elTab = document.createElement('h6');
  3991. elTab.setAttribute(postAttTab, '0');
  3992. elTab.textContent = reason;
  3993. return elTab;
  3994. }
  3995.  
  3996. function sanitizeReason(reason) {
  3997. // -- setting an attribute, so remove double quotes from reason's text.
  3998. return reason.replaceAll('"', '');
  3999. }
  4000.  
  4001. function hideFeature(post, reason, addPostTab = false) {
  4002. // -- hide something - keep it out of the regular feed stuff.
  4003. // -- no counter
  4004.  
  4005. if ((parseInt(VARS.Options.VERBOSITY_LEVEL, 10) > 0) && (reason !== '')) {
  4006. // -- add info tab
  4007. const elPostToggleStateBar = createTogglePostStateBar(reason);
  4008. let postFirstChild = post.querySelector(':scope > :first-child');
  4009. if (postFirstChild) {
  4010. postFirstChild.before(elPostToggleStateBar);
  4011. }
  4012. }
  4013.  
  4014. post.setAttribute(VARS.cssHide, '');
  4015. post.setAttribute(postAtt, sanitizeReason(reason));
  4016.  
  4017. if (addPostTab === true) {
  4018. // - add mini-tab to indicate why post is hidden
  4019. const elTabSpot = post.querySelector(`:scope > div:not([${postAttTab}]) > div > div > div:first-child`);
  4020. if (elTabSpot) {
  4021. elTabSpot.before(createPostTab(reason));
  4022. }
  4023. }
  4024.  
  4025. // - in debugging mode?
  4026. if (VARS.Options.VERBOSITY_DEBUG) {
  4027. post.setAttribute(VARS.cssShow, '');
  4028. }
  4029. }
  4030.  
  4031. function toggleHiddenElements() {
  4032. const containers = Array.from(document.querySelectorAll('[' + VARS.cssHide + ']'));
  4033. const blocks = Array.from(document.querySelectorAll('[' + VARS.cssHideEl + ']'));
  4034. const shares = Array.from(document.querySelectorAll('[' + VARS.cssHideNumberOfShares + ']'));
  4035.  
  4036. const elements = [...containers, ...blocks, ...shares];
  4037.  
  4038. if (VARS.Options.VERBOSITY_DEBUG) {
  4039. for (const element of elements) {
  4040. element.setAttribute(VARS.cssShow, '');
  4041. }
  4042. }
  4043. else {
  4044. for (const element of elements) {
  4045. element.removeAttribute(VARS.cssShow);
  4046. }
  4047. }
  4048. }
  4049.  
  4050. function togglePost(ev) {
  4051. ev.stopPropagation();
  4052. // -- grab the toggle post state bar container
  4053. const elToggleBarContainer = ev.target.closest(`div[${postAttTab}]`);
  4054. // -- grab the post
  4055. const elPost = elToggleBarContainer.parentElement;
  4056. // -- then toggle the VARS.cssShow attribute on the post.
  4057. if (!elToggleBarContainer.hasAttribute(postAttCPID)) {
  4058. // -- single post being hidden
  4059. elPost.hasAttribute(VARS.cssShow) ? elPost.removeAttribute(VARS.cssShow) : elPost.setAttribute(VARS.cssShow, '');
  4060. }
  4061. else {
  4062. // -- multiple consecutive posts being hidden
  4063. const cpid = elToggleBarContainer.getAttribute(postAttCPID);
  4064. const flaggedPosts = document.querySelectorAll(`[${postAtt}][${postAttCPID}=${cpid}]`);
  4065. if (flaggedPosts.length > 0) {
  4066. // -- cannot use classList.toggle() while posts are still being loaded ...
  4067. if (elPost.hasAttribute(VARS.cssShow)) {
  4068. for (const flaggedPost of flaggedPosts) {
  4069. flaggedPost.removeAttribute(VARS.cssShow);
  4070. }
  4071. }
  4072. else {
  4073. for (const flaggedPost of flaggedPosts) {
  4074. flaggedPost.setAttribute(VARS.cssShow, '');
  4075. }
  4076. }
  4077. }
  4078. }
  4079. }
  4080.  
  4081. function gvf_hidePost(post, reason) {
  4082. // -- hide something ..
  4083. // -- group feed
  4084. // -- video feed
  4085. // -- Verbosity_Level: 0 = hide; 1 = single info note; 2 = consecutive info notes
  4086.  
  4087. // console.info(log + 'gvf_hidePost(); v_L:', VARS.Options.VERBOSITY_LEVEL, VARS.echoEl, VARS.echoCount, reason, post);
  4088.  
  4089. if ((VARS.Options.VERBOSITY_LEVEL !== '0') && (reason !== '')) {
  4090. // -- in info tab mode
  4091. // -- nb: calling function will either zap or increment VARS.echoCount
  4092. // -- they don't look at VARS.Options.VERBOSITY_LEVEL's value
  4093.  
  4094. if ((VARS.Options.VERBOSITY_LEVEL === '1') || (VARS.isNF === true)) {
  4095. // - single post level
  4096. VARS.echoCount = 1;
  4097. }
  4098.  
  4099. if (VARS.echoCount < 2) {
  4100. // - 1 post to be hidden (includes first of consecutive group)
  4101.  
  4102. const postFirstChildEl = post.querySelector(':scope > :first-child');
  4103. if (postFirstChildEl) {
  4104. VARS.echoEl = createTogglePostStateBar(reason);
  4105. postFirstChildEl.before(VARS.echoEl);
  4106. }
  4107. else {
  4108. // post has been changed while being processed (very rare)
  4109. }
  4110. }
  4111.  
  4112. if ((VARS.Options.VERBOSITY_LEVEL === '2') && (VARS.isNF === false)) {
  4113.  
  4114. if (VARS.echoCount < 2) {
  4115. // - first post in a possible consecutive collection.
  4116. // - CPID = consecutive post id
  4117. VARS.echoCPID = generateRandomString();
  4118. VARS.echoEl.setAttribute(postAttCPID, VARS.echoCPID);
  4119. }
  4120. else {
  4121. // - 2+ consecutive posts hidden
  4122. VARS.echoEl.querySelector('.wtxt').textContent = VARS.echoCount + KeyWords.VERBOSITY_MESSAGE[VARS.language][1];
  4123. }
  4124.  
  4125. // - consecutive posts level - flag it as part of a consecutive group
  4126. post.setAttribute(postAttCPID, VARS.echoCPID);
  4127.  
  4128. // - add a tab (indicates why post is hidden)
  4129. const elTabSpot = post.querySelector(`:scope > div:not([${postAttTab}]) > div > div > div:first-child`);
  4130. if (elTabSpot) {
  4131. elTabSpot.before(createPostTab(reason));
  4132. }
  4133. }
  4134. }
  4135.  
  4136. // - flag & hide the post
  4137. post.setAttribute(VARS.cssHide, '');
  4138. post.setAttribute(postAtt, sanitizeReason(reason));
  4139.  
  4140. // - in debugging mode?
  4141. if (VARS.Options.VERBOSITY_DEBUG) {
  4142. post.setAttribute(VARS.cssShow, '');
  4143. }
  4144.  
  4145. //console.info(log+'gvf_hidePost():', VARS.echoElFirst);
  4146. }
  4147.  
  4148. function nf_hidePost(post, reason) {
  4149. // -- hide something ..
  4150. // -- news feed + search feed
  4151. // -- no consecutive counts.
  4152. // -- Verbosity_Level: 0 = hide; 1|2 = single info note; (no consecutive mode)
  4153.  
  4154. // console.info(log + 'nf_hidePost(); v_L:', VARS.Options.VERBOSITY_LEVEL, VARS.echoEl, VARS.echoCount, reason, post);
  4155.  
  4156. // -- February 2024 - hit fix !!! - disabled.
  4157. /*
  4158. if ((VARS.Options.VERBOSITY_LEVEL !== '0') && (reason !== '')) {
  4159. // -- in message/info tab mode
  4160. // -- code 2 is switched to code 1.
  4161. // -- VARS.echoCount is ignored.
  4162.  
  4163. const postFirstChildEl = post.querySelector(':scope > :first-child');
  4164. if (postFirstChildEl) {
  4165. const elMessageTab = createTogglePostStateBar(reason);
  4166. postFirstChildEl.before(elMessageTab);
  4167. }
  4168. else {
  4169. // post has been changed while being processed (very rare)
  4170. }
  4171. }
  4172. */
  4173.  
  4174. // - flag & hide the post
  4175. post.setAttribute(VARS.cssHide, '');
  4176. post.setAttribute(postAtt, sanitizeReason(reason));
  4177.  
  4178. // -- February 2024 - hot fix !!! - collapse post completely
  4179. const elWithMargin = climbUpTheTree(post, 4);
  4180. elWithMargin.setAttribute('style', 'margin:0 !important;');
  4181.  
  4182. // -- February 2024 - hot fix !!! - disabled
  4183. /*
  4184. // - in debugging mode?
  4185. if (VARS.Options.VERBOSITY_DEBUG) {
  4186. post.setAttribute(VARS.cssShow, '');
  4187. }
  4188. */
  4189.  
  4190. //console.info(log+'nf_hidePost():', VARS.echoElFirst);
  4191. }
  4192.  
  4193.  
  4194. function nf_dropTags(post) {
  4195. // -- remove cmf's attributes/classes from empty posts.
  4196. // -- including tabs (if any)
  4197. post.removeAttribute(postAtt);
  4198. post.removeAttribute(VARS.cssHide);
  4199. post.removeAttribute(VARS.cssHideEl);
  4200. post.removeAttribute(VARS.cssShow);
  4201. // -- other attribute(s)
  4202. post.removeAttribute(postAttCPID);
  4203. // -- remove the notification tab.
  4204. if (post.querySelectorAll('div, h6').length > 0) {
  4205. post.removeChild(post.firstElementChild);
  4206. }
  4207.  
  4208. // -- February 2024 - hot fix !!! - remove the collapse post completely hack
  4209. const elWithMargin = climbUpTheTree(post, 4);
  4210. if (elWithMargin && elWithMargin.hasAttribute('style')) {
  4211. elWithMargin.removeAttribute('style');
  4212. }
  4213.  
  4214. post[postPropDS] = 1; // -- reset scanning count
  4215. }
  4216.  
  4217. function hideBlock(block, link, reason) {
  4218. block.setAttribute(VARS.cssHideEl, '');
  4219. link.setAttribute(postAtt, sanitizeReason(reason));
  4220. // - in debugging mode?
  4221. if (VARS.Options.VERBOSITY_DEBUG) {
  4222. block.setAttribute(VARS.cssShow, '');
  4223. }
  4224. }
  4225.  
  4226. function cleanText(text) {
  4227. // - fb is using ASCII code 160 for whitespace ...
  4228. // -- also "normalise" the text (i.e. convert unicode magic to normal ascii code)
  4229. // -- (unicode magic used to bold/italic/etc characters without html/css/style)
  4230. // return text.replaceAll(String.fromCharCode(160), String.fromCharCode(32)).normalize('NFKC');
  4231. // -- normalise(NKFC) will convert 160(00A0) to 32(0020)
  4232. // -- https://www.unicode.org/charts/normalization/index.html
  4233. return text.normalize('NFKC');
  4234. }
  4235.  
  4236. function isSponsored(post) {
  4237. // Is it a sponsored post?
  4238. // -- applies to News feed, Groups feed, Videos Feed
  4239. // -- mopUpTheMarketplaceFeed() looks after marketplace feed sponsored posts/items.
  4240.  
  4241. let isSponsoredPost = false;
  4242. const PARAM_FIND = '__cft__[0]=';
  4243. const PARAM_MIN_SIZE = (VARS.isSF) ? 254 : 299;
  4244.  
  4245. let elLinks = [];
  4246. if (VARS.isNF || VARS.isGF) {
  4247. // -- news feed
  4248. // -- and possibly groups feed (haven't seen a sponsored post in groups for ages!)
  4249. // -- May 2023 update (#3) - works with the introduced "Feeds (most recent)" feature
  4250. elLinks = Array.from(post.querySelectorAll(`div[aria-posinset] span > a[href*="${PARAM_FIND}"]:not([href^="/groups/"]):not([href*="section_header_type"])`));
  4251. if (elLinks.length === 0) {
  4252. // -- try again, some users don't have the aria-posinet attribute.
  4253. elLinks = Array.from(post.querySelectorAll(`div[aria-describedby] span > a[href*="${PARAM_FIND}"]:not([href^="/groups/"]):not([href*="section_header_type"])`));
  4254. }
  4255.  
  4256. // -- May 2023 update (disabled - May 2023 #3 takes care of this fix)
  4257. // elLinks = Array.from(post.querySelectorAll(`div[aria-posinset] h4 span > a[href*="${PARAM_FIND}"]:not([href^="/groups/"]):not([href*="section_header_type"])`));
  4258. // if (elLinks.length === 0) {
  4259. // // -- try again, some users don't have the aria-posinet attribute.
  4260. // elLinks = Array.from(post.querySelectorAll(`div[aria-describedby] h4 span > a[href*="${PARAM_FIND}"]:not([href^="/groups/"]):not([href*="section_header_type"])`));
  4261. // }
  4262.  
  4263. // -- March 2023 udpate (disabled - May 2023 takes care of March's fix.)
  4264. // elLinks = Array.from(post.querySelectorAll(`div[aria-posinset] h4 > span > a[href*="${PARAM_FIND}"]:not([href^="/groups/"]):not([href*="section_header_type"])`));
  4265. // if (elLinks.length === 0) {
  4266. // // -- try again, some users don't have the aria-posinet attribute.
  4267. // elLinks = post.querySelectorAll(`div[aria-describedby] h4 > span > a[href*="${PARAM_FIND}"]:not([href^="/groups/"]):not([href*="section_header_type"])`);
  4268. // }
  4269.  
  4270. // -- April 2023, possible sponsored video post in News Feed ("LIVE")
  4271. // if (elLinks.length === 0) {
  4272. // elLinks = Array.from(post.querySelectorAll(`div[aria-posinset] h4 > span > strong > span > a[href*="${PARAM_FIND}"]:not([href^="/groups/"]):not([href*="section_header_type"])`));
  4273. // if (elLinks.length === 0) {
  4274. // // -- try again, some users don't have the aria-posinet attribute.
  4275. // elLinks = post.querySelectorAll(`div[aria-describedby] h4 > span > strong > span > a[href*="${PARAM_FIND}"]:not([href^="/groups/"]):not([href*="section_header_type"])`);
  4276. // }
  4277. // }
  4278. }
  4279. else if (VARS.isVF) {
  4280. // -- watch videos feed has a slightly different html structure for sponsored posts.
  4281. elLinks = Array.from(post.querySelectorAll(`div > div > div > div > span > span > div > a[href*="${PARAM_FIND}"]`));
  4282. }
  4283. else if (VARS.isSF) {
  4284. // -- search feed - has a slightly different html structure for sponsored posts.
  4285. elLinks = Array.from(post.querySelectorAll(`div[role="article"] span > a[href*="${PARAM_FIND}"]`));
  4286. }
  4287. if (elLinks.length > 0) {
  4288. for (let i = 0; i < elLinks.length; i++) {
  4289. let el = elLinks[i];
  4290. let pos = el.href.indexOf(PARAM_FIND);
  4291. if (pos >= 0) {
  4292. if (el.href.slice(pos).length > PARAM_MIN_SIZE) {
  4293. isSponsoredPost = true;
  4294. break;
  4295. };
  4296. }
  4297. }
  4298. }
  4299. // if (isSponsoredPost) console.info(log + 'isSponsored(); isSponsoredPost:', isSponsoredPost, post);
  4300. return isSponsoredPost;
  4301. }
  4302.  
  4303. function querySelectorAllNoChildren(container = document, queries = [], minText = 0, executeAllQueries = false) {
  4304. // -- nb: .querySelectorAll(..) can have multiple queries and will execute them all (regardless of results)
  4305. if (!Array.isArray(queries)) {
  4306. queries = [queries];
  4307. }
  4308.  
  4309. if (queries.length === 0) {
  4310. return [];
  4311. };
  4312.  
  4313. if (executeAllQueries) {
  4314. return Array.from(container.querySelectorAll(queries)).filter((el) => {
  4315. return el.children.length === 0 && el.textContent.length >= minText;
  4316. });
  4317. }
  4318.  
  4319. for (const query of queries) {
  4320. const elements = container.querySelectorAll(query);
  4321. for (const element of elements) {
  4322. if (element.children.length === 0 && element.textContent.length >= minText) {
  4323. return [element];
  4324. }
  4325. }
  4326. }
  4327.  
  4328. return [];
  4329. }
  4330.  
  4331. function nf_isSuggested(post) {
  4332. // - check if any of the suggestions / recommendations type post
  4333. // -- nb: "<name> commented / <name> replied to a commment" posts have similar structure - but have extra elements ...
  4334. // -- nb: "x people recently commented" posts have similar structure - suggested/recommended posts don't start with a number ...
  4335.  
  4336. const queries = [
  4337. // -- May 2023
  4338. 'div[aria-posinset] > div > div > div > div > div > div:nth-of-type(2) > div > div > div:nth-of-type(1) > div > div > span',
  4339. 'div[aria-describedby] > div > div > div > div > div > div:nth-of-type(2) > div > div > div:nth-of-type(1) > div > div > span',
  4340. // -- February 2023 (no need for light dusting ...)
  4341. ':scope div[aria-posinset] > div > div > div > div > div > div:not([data-0]) > div > div > div:nth-of-type(1) > div > div > div > div > span',
  4342. ':scope div[aria-describedby] > div > div > div > div > div > div:not([data-0]) > div > div > div:nth-of-type(1) > div > div > div > div > span',
  4343.  
  4344. // -- Oct/Nov 2023 (provisional - not tested by zbluebugz)
  4345. 'div[aria-posinset] > div > div > div > div > div > div:nth-of-type(2) > div > div > div:nth-of-type(2) > div > div:nth-of-type(2) > div > div:nth-of-type(2) > span > span > span:nth-of-type(2)',
  4346. 'div[aria-describedby] > div > div > div > div > div > div:nth-of-type(2) > div > div > div:nth-of-type(2) > div > div:nth-of-type(2) > div > div:nth-of-type(2) > span > span > span:nth-of-type(2)',
  4347.  
  4348. // -- December 2022 - #2
  4349. ':scope div[aria-posinset] > div > div > div > div > div > div:nth-of-type(2) > div > div > div:nth-of-type(1) > div > div > div > div > span',
  4350. ':scope div[aria-describedby] > div > div > div > div > div > div:nth-of-type(2) > div > div > div:nth-of-type(1) > div > div > div > div > span',
  4351. // -- December 2022 - #1
  4352. ':scope > div > div > div > div > div > div > div > div > div > div > div > div:nth-of-type(2) > div > div > div:nth-of-type(1) > div > div > div > div > span',
  4353. // -- < December 2022
  4354. ':scope > div > div > div > div > div > div > div > div > div > div > div > div:nth-of-type(2) > div > div:nth-of-type(1) > div > div > div > div > span',
  4355. ':scope > div > div > div > div > div > div > div > div > div > div > div:nth-of-type(2) > div > div:nth-of-type(1) > div > div > div > div > span'
  4356. ];
  4357.  
  4358. const elSuggestion = querySelectorAllNoChildren(post, queries, 1);
  4359. if (elSuggestion.length > 0) {
  4360. if (nf_isReelsAndShortVideos(post).length > 0) {
  4361. // -- false-positive hit.
  4362. return '';
  4363. }
  4364. // -- pattern: a digit from 0 to 9 or any number in the unicode space
  4365. // --- Basic Latin: \u0030-\u0039 (Range: 0-9)
  4366. // --- Arabic-Indic Digits: \u0660-\u0669 (Range: ٠-٩)
  4367. // --- Eastern Arabic-Indic Digits: \u06F0-\u06F9 (Range: ۰-۹)
  4368. // --- Devanagari Digits: \u0966-\u096F (Range: ०-९)
  4369. // --- Bengali Digits: \u09E6-\u09EF (Range: ০-৯)
  4370. // --- Myanmar Digits: \u1040-\u1049 (Range: ၀-၉)
  4371. // --- Thai Digits: \u0E50-\u0E59 (Range: ๐-๙)
  4372. // --- Tibetan Digits: \u0F20-\u0F29 (Range: ༠-༩)
  4373. // const pattern = /([0-9]|[\u0660-\u0669])/;
  4374. const pattern = /([0-9]|[\u0660-\u0669]|[\u06F0-\u06F9]|[\u0966-\u096F]|[\u09E6-\u09EF]|[\u1040-\u1049]|[\u0E50-\u0E59]|[\u0F20-\u0F29])/;
  4375. // -- if text starts with a number, return nothing, else the trigger word.
  4376. const firstCharacter = cleanText(elSuggestion[0].textContent).trim().slice(0, 1);
  4377. // console.info(log+'isSuggested - match test:', firstCharacter, pattern.test(firstCharacter), pattern.test(firstCharacter) ? 'No': 'Yes' );
  4378. return (pattern.test(firstCharacter)) ? '' : KeyWords.NF_SUGGESTIONS[VARS.language];
  4379. }
  4380. return '';
  4381. }
  4382.  
  4383. function gf_isSuggested(post) {
  4384. // - check if any of the suggestions / recommendations type post
  4385. // -- get the blocks/sections, then have a look for <i> in 1st block (providing there's more than 1 block)
  4386. // -- (query bypasses the dusty elements)
  4387. // -- some users don't have [aria-posinset], hence [aria-describedby]
  4388. let results = '';
  4389. let blocksQuery = 'div[aria-posinset] > div > div > div > div > div > div > div > div, div[aria-describedby] > div > div > div > div > div > div > div > div';
  4390. let blocks = post.querySelectorAll(blocksQuery);
  4391. if (blocks.length <= 1) {
  4392. // try again .. (December 2022 change)
  4393. blocksQuery = 'div[aria-posinset] > div > div > div > div > div > div > div > div > div, div[aria-describedby] > div > div > div > div > div > div > div > div > div';
  4394. blocks = post.querySelectorAll(blocksQuery);
  4395. }
  4396. if (blocks.length > 1) {
  4397. let suggIcon = blocks[0].querySelector('i[data-visualcompletion="css-img"][style]');
  4398. if (suggIcon) {
  4399. results = KeyWords.GF_SUGGESTIONS[VARS.language];
  4400. }
  4401. else {
  4402. // -- a sneaky group post without the standard suggestion/recommendation header
  4403. let query = 'h3 > div > span ~ span > span > div > div';
  4404. let sneakyGroupPost = blocks[1].querySelector(query);
  4405. if (sneakyGroupPost) {
  4406. results = KeyWords.GF_SUGGESTIONS[VARS.language];
  4407. }
  4408. }
  4409. }
  4410. return results;
  4411. }
  4412.  
  4413. function nf_isPeopleYouMayKnow(post) {
  4414. const queryPYMK = 'a[href*="/friends/suggestions/"][role="link"]';
  4415. const linksPYMK = post.querySelectorAll(queryPYMK);
  4416. return (linksPYMK.length === 0) ? '' : KeyWords.NF_PEOPLE_YOU_MAY_KNOW[VARS.language];
  4417. }
  4418.  
  4419. function nf_isPaidPartnership(post) {
  4420. const queryPP = 'span[dir] > span[id] a[href^="/business/help/"]';
  4421. const elPaidPartnership = post.querySelector(queryPP);
  4422. return (elPaidPartnership === null) ? '' : KeyWords.NF_PAID_PARTNERSHIP[VARS.language];
  4423. }
  4424.  
  4425. function nf_isSponsoredPaidBy(post) {
  4426. const querySPB = 'div:nth-child(2) > div > div:nth-child(2) > span[class] > span[id] > div:nth-child(2)';
  4427. const sponsoredPaidBy = querySelectorAllNoChildren(post, querySPB, 1);
  4428. return (sponsoredPaidBy.length === 0) ? '' : KeyWords.NF_SPONSORED_PAID[VARS.language];
  4429. }
  4430.  
  4431. function nf_isReelsAndShortVideos(post) {
  4432. // -- reels and short videos (multiple)
  4433. const queryRaSV = 'a[href="/reel/?s=ifu_see_more"]';
  4434. const elRaSV = post.querySelector(queryRaSV);
  4435. return (elRaSV === null) ? '' : KeyWords.NF_REELS_SHORT_VIDEOS[VARS.language];
  4436. }
  4437.  
  4438. function nf_isShortReelVideo(post) {
  4439. // -- reel/short video post (single)
  4440. // -- post must have only one reel link
  4441. const querySRV = 'a[href*="/reel/"]';
  4442. const elementsSRV = Array.from(post.querySelectorAll(querySRV));
  4443. return (elementsSRV.length !== 1) ? '' : KeyWords.NF_SHORT_REEL_VIDEO[VARS.language];
  4444. }
  4445.  
  4446. function gf_isShortReelVideo(post) {
  4447. // -- reel/short video post (single)
  4448. // -- post must have only one reel link
  4449. const querySRV = 'a[href*="/reel/"]';
  4450. const elementsSRV = Array.from(post.querySelectorAll(querySRV));
  4451. return (elementsSRV.length !== 1) ? '' : KeyWords.GF_SHORT_REEL_VIDEO[VARS.language];
  4452. }
  4453.  
  4454. function nf_isEventsYouMayLike(post) {
  4455. // -- events you may like posts
  4456. const query = (':scope div > div:nth-of-type(2) > div > div > h3 > span');
  4457. const events = querySelectorAllNoChildren(post, query, 0);
  4458. return (events.length === 0) ? '' : KeyWords.NF_EVENTS_YOU_MAY_LIKE[VARS.language];
  4459. }
  4460.  
  4461. function nf_isFollow(post) {
  4462. // -- follow someone/something post
  4463. const queryFollow = ':scope h4[id] > span > div > span';
  4464. const elementsFollow = querySelectorAllNoChildren(post, queryFollow, 0);
  4465. return (elementsFollow.length !== 1) ? '' : KeyWords.NF_FOLLOW[VARS.language];
  4466. }
  4467.  
  4468. function nf_isParticipate(post) {
  4469. // -- participate in a post ...
  4470. const queryParticipate = ':scope h4[id] > div[class] > span[dir] > span[class] > div[class] > span[class]';
  4471. const elementsParticipate = querySelectorAllNoChildren(post, queryParticipate, 0);
  4472. return (elementsParticipate.length !== 1) ? '' : KeyWords.NF_PARTICIPATE[VARS.language];
  4473. }
  4474.  
  4475. function findFirstMatch(longText, valuesToFind) {
  4476. // for (const value of valuesToFind) {
  4477. // if (longText.includes(value)) {
  4478. // return value;
  4479. // }
  4480. // }
  4481. // return '';
  4482. const foundWord = valuesToFind.find(word => longText.includes(word));
  4483. return foundWord !== undefined ? foundWord : '';
  4484. }
  4485.  
  4486. function findFirstMatchRE(longText, patterns) {
  4487. // -- using Regular Expressions
  4488. // -- user supplied the RE patterns
  4489. for (const pattern of patterns) {
  4490. // -- do not use 'g' - want to reset lastindex to 0 for each test.
  4491. // --'i' flag for case-insensitive matching;
  4492. const regex = new RegExp(pattern, 'i');
  4493. if (regex.test(longText)) {
  4494. return pattern;
  4495. }
  4496. }
  4497. return '';
  4498. }
  4499.  
  4500. function nf_isBlockedText(post) {
  4501. // - check for blocked text - partial text match
  4502. // -- news feed post's blocks (have 1-4 blocks)
  4503. // -- scan 1st & 3rd blocks
  4504. // -- used by the fn extractTextContent() and fn doMoppingInfoBox()
  4505. // -- some users don't have [aria-posinset], hence [aria-describedby]
  4506. let blocksQuery = 'div[aria-posinset] > div > div > div > div > div > div > div > div, div[aria-describedby] > div > div > div > div > div > div > div > div';
  4507. let blocks = post.querySelectorAll(blocksQuery);
  4508. if (blocks.length <= 1) {
  4509. // -- try again .. (December 2022 change)
  4510. // -- no need to do another querySelectorAll(..) - extractTextContent will do this.
  4511. blocksQuery = 'div[aria-posinset] > div > div > div > div > div > div > div > div > div, div[aria-describedby] > div > div > div > div > div > div > div > div > div';
  4512. }
  4513. const postTexts = (extractTextContent(post, blocksQuery, 3)).join(' ').toLowerCase();
  4514. const blockedText = findFirstMatch(postTexts, VARS.Filters.NF_BLOCKED_TEXT_LC);
  4515. return blockedText;
  4516. }
  4517.  
  4518. function gf_isBlockedText(post) {
  4519. // - check for blocked text - partial text match
  4520. // -- groups feed post's blocks (have 1-4 blocks)
  4521. // -- scan first 3 blocks
  4522. // -- some users don't have [aria-posinset], hence [aria-describedby]
  4523. let blocksQuery = 'div[aria-posinset] > div > div > div > div > div > div > div > div, div[aria-describedby] > div > div > div > div > div > div > div > div';
  4524. let blocks = post.querySelectorAll(blocksQuery);
  4525. if (blocks.length <= 1) {
  4526. // try again .. (Dec 2022 change)
  4527. // -- no need to do another querySelectorAll(..) - extractTextContent will do this.
  4528. blocksQuery = 'div[aria-posinset] > div > div > div > div > div > div > div > div > div, div[aria-describedby] > div > div > div > div > div > div > div > div > div';
  4529. }
  4530. const postTexts = (extractTextContent(post, blocksQuery, 3)).join(' ').toLowerCase();
  4531. const blockedText = findFirstMatch(postTexts, VARS.Filters.GF_BLOCKED_TEXT_LC);
  4532. return blockedText;
  4533. }
  4534.  
  4535. function vf_isBlockedText(post, queryBlocks) {
  4536. // - check for blocked text - partial text match
  4537. // -- regular videos feed post's blocks (have 1-3 blocks)
  4538. // -- scan 1st block only
  4539. const postTexts = (extractTextContent(post, queryBlocks, 1)).join(' ').toLowerCase();
  4540. const blockedText = findFirstMatch(postTexts, VARS.Filters.VF_BLOCKED_TEXT_LC);
  4541. return blockedText;
  4542. }
  4543.  
  4544. function vf_isVideoLive(post) {
  4545. // - check for "LIVE" indicator on videos
  4546. const liveRule = 'div[role="presentation"] ~ div > div:nth-of-type(1) > span';
  4547. const elLive = post.querySelectorAll(liveRule);
  4548. return (elLive.length > 0) ? KeyWords.VF_LIVE[VARS.language] : '';
  4549. }
  4550.  
  4551. function mp_getBlockedPrices(elBlockOfText) {
  4552. // -- scan the first price listed in itemPrices for a match.
  4553. // -- (second price is the old one (with strike-through))
  4554. // -- needs to be an extact match.
  4555. // :: return : blocked text or ''.
  4556. if (VARS.Filters.MP_BLOCKED_TEXT.length > 0) {
  4557. const itemPrices = mp_scanTreeForText(elBlockOfText);
  4558. const blockedPrices = findFirstMatch(itemPrices, VARS.Filters.MP_BLOCKED_TEXT_LC);
  4559. return blockedPrices;
  4560. }
  4561. return '';
  4562. }
  4563.  
  4564. function mp_getBlockedTextDescription(collectionBlocksOfText, skipFirstBlock = true) {
  4565. // -- scan the various blocks of text for blocked text.
  4566. // -- partial match.
  4567. // :: return : blocked text or ''.
  4568. if (VARS.Filters.MP_BLOCKED_TEXT_DESCRIPTION.length > 0) {
  4569. const startIndex = skipFirstBlock ? 1 : 0;
  4570. for (let i = startIndex; i < collectionBlocksOfText.length; i++) {
  4571. const descriptionTextList = mp_scanTreeForText(collectionBlocksOfText[i]);
  4572. const descriptionText = descriptionTextList.join(' ').toLowerCase();
  4573. const blockedText = findFirstMatch(descriptionText, VARS.Filters.MP_BLOCKED_TEXT_DESCRIPTION_LC);
  4574. if (blockedText.length > 0) {
  4575. return blockedText
  4576. }
  4577. }
  4578. }
  4579. return '';
  4580. }
  4581.  
  4582. function mp_doBlockingByBlockedText() {
  4583. // -- scan the marketplace for items
  4584. // -- hide an item if the price is listed in the list of blocked text
  4585. // -- hide an item if the descriptinis listed in the list of blocked description text
  4586. // :: return <nothing>
  4587.  
  4588. // -- March 2024 (fb changed code - personalised and non-personalised)
  4589. const queries = [
  4590. // -- landing page listing
  4591. `div[style]:not([${postAtt}]) > div > div > span > div > div > a[href*="/marketplace/item/"]`,
  4592. `div[style]:not([${postAtt}]) > div > div > span > div > div > a[href*="/marketplace/np/item/"]`,
  4593. // -- category page listing
  4594. `div[style]:not([${postAtt}]) > div > span > div > div > a[href*="/marketplace/item/"]`,
  4595. `div[style]:not([${postAtt}]) > div > span > div > div > a[href*="/marketplace/np/item/"]`
  4596. ];
  4597. let items = [];
  4598. for (const query of queries) {
  4599. items = document.querySelectorAll(query);
  4600. if (items.length > 0) {
  4601. break;
  4602. }
  4603. }
  4604.  
  4605. for (const item of items) {
  4606. // - item's container
  4607. const box = item.closest('div[style]');
  4608. if (box.hasAttribute(postAttMPSkip)) {
  4609. if (box.innerHTML.length == box.getAttribute(postAttMPSkip)) {
  4610. continue;
  4611. }
  4612. }
  4613. // - blocks of text to scan
  4614. const queryTextBlock = ':scope > div > div:nth-of-type(2) > div'
  4615. const blocksOfText = item.querySelectorAll(queryTextBlock);
  4616. if (blocksOfText.length > 0) {
  4617. // -- price(s) is in first block
  4618. const blockedTextPrices = mp_getBlockedPrices(blocksOfText[0]);
  4619. // -- description is in other blocks
  4620. const blockedTextDescription = mp_getBlockedTextDescription(blocksOfText, true);
  4621.  
  4622. if (blockedTextPrices.length > 0) {
  4623. // -- hide the item
  4624. mp_hideBox(box, blockedTextPrices);
  4625. }
  4626. else if (blockedTextDescription.length > 0) {
  4627. // -- hide the item
  4628. mp_hideBox(box, blockedTextDescription);
  4629. }
  4630. else {
  4631. // -- flag the item not to be scanned again
  4632. box.setAttribute(postAtt, '');
  4633. // box.setAttribute(postAttMPSkip, box.innerHTML.length);
  4634. }
  4635. }
  4636. };
  4637. }
  4638.  
  4639. function vf_scrubSponsoredBlock(post) {
  4640. // - some videos have a sponsored block beneath the video block/section
  4641. // - includes "watch more ___ videos by ___"
  4642. // :: return <nothing>
  4643. const queryForContainer = ':scope > div > div > div > div > div > div:nth-of-type(2)';
  4644. const blocksContainer = post.querySelector(queryForContainer);
  4645. if (blocksContainer && blocksContainer.childElementCount > 0) {
  4646. const adBlock = blocksContainer.querySelector(':scope > a');
  4647. if (adBlock && !adBlock.hasAttribute(postAtt)) {
  4648. hideBlock(adBlock, adBlock, KeyWords.SPONSORED[VARS.language]);
  4649. }
  4650. }
  4651. // const query = `:scope > div > div > div > div > div:nth-of-type(2) > div`;
  4652. // const blocks = post.querySelectorAll(query);
  4653. // if (blocks.length > 3) {
  4654. // const block = blocks[2]; // -- 3rd block
  4655. // const isJunk = block.querySelector(`:scope > div > div > div > div > div > div > span > a:not([${postAtt}])`);
  4656. // if (isJunk !== null) {
  4657. // hideBlock(block, isJunk, KeyWords.SPONSORED[VARS.language]);
  4658. // }
  4659. // }
  4660. }
  4661.  
  4662. function swatTheMosquitos(post) {
  4663. // - scan the post for any gifs that is animating (pausing them once)
  4664. // :: return <nothing>
  4665. const query = `div[role="button"][aria-label*="GIF"]:not([${postAtt}]) > i:not([data-visualcompletion])`;
  4666. const animatedGIFs = post.querySelectorAll(query);
  4667. // console.info('pausing, animatedGIFs::', animatedGIFs);
  4668. for (const gif of animatedGIFs) {
  4669. // mimic user clicking on animating gif
  4670. // - which will trigger fb's click event.
  4671. // - grab the A tag that is displayed when paused (uses Opacity)
  4672. const parent = climbUpTheTree(gif, 3);
  4673. const sibling = parent.querySelector(':scope > a');
  4674. if (sibling) {
  4675. const sibingCS = window.getComputedStyle(sibling);
  4676. if (sibingCS.opacity === '0') {
  4677. // 0 = animating; 1 = paused;
  4678. gif.parentElement.click();
  4679. // console.info(log + 'swatTheMosquitos() - paused', gif);
  4680. }
  4681. gif.parentElement.setAttribute(postAtt, '1');
  4682. }
  4683. }
  4684. }
  4685.  
  4686. function nf_scrubTheTabbiesAndOrSurvey(doScrubTheTabbies = false, doScrubTheSurvey = false) {
  4687. // -- Tablist : stories | reels | rooms
  4688. // -- Stories
  4689. // -- both appear at top of NF
  4690. // -- FB Survey
  4691. // -- appears after Tablist / Stories
  4692. const queryTabList = 'div[role="main"] > div > div > div > div > div > div > div > div[role="tablist"]';
  4693. const elTabList = document.querySelector(queryTabList);
  4694. if (elTabList) {
  4695. if (doScrubTheSurvey === true) {
  4696. const elParent = climbUpTheTree(elTabList, 4);
  4697. if (elParent !== null) {
  4698. nf_scrubTheSurvey(elParent);
  4699. }
  4700. }
  4701. if (doScrubTheTabbies === true) {
  4702. if (elTabList.hasAttribute(postAttChildFlag)) {
  4703. return;
  4704. }
  4705. // -- parent is 4 levels up.
  4706. const elParent = climbUpTheTree(elTabList, 4);
  4707. if (elParent) {
  4708. hideFeature(elParent, (KeyWords.NF_TABLIST_STORIES_REELS_ROOMS[VARS.language]).replaceAll('"', ''), false);
  4709. elTabList.setAttribute(postAttChildFlag, 'tablist');
  4710. return;
  4711. }
  4712. }
  4713. }
  4714. else {
  4715. // - Stories only
  4716. // -- two patterns
  4717. // -- - one with listing of stories
  4718. // -- - one with no listing of stories
  4719.  
  4720. function getStoriesParent(element) {
  4721. const elAFewBranchesUp = climbUpTheTree(element, 4);
  4722. const moreStories = elAFewBranchesUp.querySelectorAll('a[href*="/stories/"]');
  4723. let elParent = null;
  4724. if (moreStories.length > 1) {
  4725. // -- query results has create and at least 1 story link
  4726. elParent = climbUpTheTree(elCreateStory.closest('div[aria-label][role="region"]'), 4);
  4727. }
  4728. else {
  4729. // -- query results has one link - create story
  4730. elParent = climbUpTheTree(elCreateStory, 7);
  4731. }
  4732. return elParent;
  4733. }
  4734.  
  4735. // const queryForCreateStory = 'a[href*="/stories/create"]'; - too loose, grabs the FB menu's entries as well ...
  4736. const queryForCreateStory = 'div[role="main"] > div > div > div > div > div > div > div > div a[href*="/stories/create"]';
  4737. const elCreateStory = document.querySelector(queryForCreateStory);
  4738. if (doScrubTheSurvey === true && elCreateStory) {
  4739. const elParent = getStoriesParent(elCreateStory);
  4740. if (elParent !== null) {
  4741. nf_scrubTheSurvey(elParent);
  4742. }
  4743. }
  4744. if (doScrubTheTabbies && elCreateStory && !elCreateStory.hasAttribute(postAttChildFlag)) {
  4745. const elParent = getStoriesParent(elCreateStory);
  4746. if (elParent !== null) {
  4747. hideFeature(elParent, KeyWords.NF_TABLIST_STORIES_REELS_ROOMS[VARS.language], false);
  4748. elCreateStory.setAttribute(postAttChildFlag, '1');
  4749. }
  4750. }
  4751. }
  4752. }
  4753.  
  4754. function nf_isStoriesPost(post) {
  4755. // - Stories posts
  4756. // -- appears in News-Feed stream
  4757. const queryForStory = '[href^="/stories/"][href*="source=from_feed"]';
  4758. const elStory = post.querySelector(queryForStory);
  4759. return (elStory) ? KeyWords.NF_STORIES[VARS.language] : '';
  4760. }
  4761.  
  4762. function nf_cleanTheConsoleTable(findItem = 'Sponsored') {
  4763. // -- mopping up the news feed aside panel. findItem values: Sponosored | Suggestions
  4764. // :: return <nothing>
  4765. const query = 'div[role="complementary"] > div > div > div > div > div:not([data-visualcompletion])';
  4766. const asideBoxes = document.querySelectorAll(query);
  4767. if (asideBoxes.length === 0) {
  4768. return;
  4769. }
  4770. // -- only interested in the first container.
  4771. const asideContainer = asideBoxes[0];
  4772. if (asideContainer.childElementCount === 0) {
  4773. return;
  4774. }
  4775.  
  4776. let elItem = null;
  4777. let reason = '';
  4778. if (findItem === 'Sponsored') {
  4779. elItem = asideContainer.querySelector(`:scope > span:not([${postAtt}])`);
  4780. if (elItem && elItem.innerHTML.length > 0) {
  4781. reason = KeyWords.SPONSORED[VARS.language];
  4782. }
  4783. }
  4784. else if (findItem === 'Suggestions') {
  4785. elItem = asideContainer.querySelector(`:scope > div:not([${postAtt}])`);
  4786. if (elItem && elItem.innerHTML.length > 0) {
  4787. // -- check for birthdays
  4788. const birthdays = elItem.querySelectorAll('a[href="/events/birthdays/"]').length > 0;
  4789. // -- check for "your pages and profiles"
  4790. // -- suggested groups only have 1 i[..] attribute
  4791. const pagesAndProfiles = elItem.querySelectorAll('div > i[data-visualcompletion="css-img"]').length > 1;
  4792.  
  4793. if (birthdays === false && pagesAndProfiles === false) {
  4794. reason = KeyWords.NF_SUGGESTIONS[VARS.language];
  4795. }
  4796. }
  4797. }
  4798. if (reason.length > 0) {
  4799. hideFeature(elItem, reason, true);
  4800. }
  4801. }
  4802.  
  4803. function gf_cleanTheConsoleTable(findItem = 'Suggestions') {
  4804. // -- mopping up the groups feed aside panel - suggested
  4805. // :: return <nothing>
  4806. if (findItem !== 'Suggestions') {
  4807. return;
  4808. }
  4809.  
  4810. const query = `a[href*="/groups/discover"]:not([${postAtt}]) > span > span`;
  4811. const asideBoxes = querySelectorAllNoChildren(document, query, 1);
  4812. if (asideBoxes.length === 0) {
  4813. return;
  4814. }
  4815.  
  4816. for (const asideBox of asideBoxes) {
  4817. // parent is 21 levels up ...
  4818. const elParent = climbUpTheTree(asideBox, 21);
  4819. asideBox.closest('a').setAttribute(postAtt, KeyWords.GF_SUGGESTIONS[VARS.language]);
  4820. hideFeature(elParent, KeyWords.GF_SUGGESTIONS[VARS.language], true);
  4821. }
  4822. }
  4823.  
  4824. function gf_setPostLinkToOpenInNewTab(post) {
  4825. // -- from the groups feed, open a group post in a new window
  4826. // -- add an icon next to the other icons at the top of the group post.
  4827. // -- (there's no equivalent function for news feed posts - no quick way of getting the post's URL)
  4828. // :: return <nothing>
  4829.  
  4830. try {
  4831. if (post.hasAttribute('class')) {
  4832. // -- not a group post.
  4833. return;
  4834. }
  4835. // - parts of the post's link can be found in the first link
  4836. const postLinks = post.querySelectorAll('div > div > a[href*="/groups/"][role="link"]');
  4837. if (postLinks.length > 0) {
  4838. const postLink = postLinks[0];
  4839. // -- get the container for the lower part of the header block.
  4840. const elHeader = climbUpTheTree(postLink, 4);
  4841. const blockOfIcons = elHeader.querySelector(':scope > div:nth-of-type(2) > div > div:nth-of-type(2) > span > span');
  4842. let newLink = '';
  4843.  
  4844. if (blockOfIcons && blockOfIcons.querySelector('.cmf-link-new') === null) {
  4845. // -- need to create the group post's link
  4846. // -- nb: last post may not be a post - it could be the "You've completely caught up. Check again later for more updates" post.
  4847. // -- it doesn't have a set of icons ...
  4848. const postId = new URLSearchParams(postLink.href).get('multi_permalinks');
  4849. if (postId !== null) {
  4850. // -- sample link: https://www.facebook.com/groups/424532172574012/?hoisted_section_header_type=recently_seen&multi_permalinks=720886619605231&__cft__[0]=AZV1vpwA0h21cVRZoS_GM3Q7H_Ul77iObEbYu2EA4oL7XyM-C78sQp5KIEpPooBCQZ2dmAMTvpCi1qYt5VxSTiCQCBkTmv8_Ra77OyacW2l685TVbttwb4qwKUm6AVr0zIapBxKODmLHgnNcYaSkXeCEOMEMdxQajQX8NTcniWYUA7OuVNY5C4F-ETSuab37Azw&__tn__=%3C%3C%2CP-R
  4851. // -- .. converted to: https://www.facebook.com/groups/424532172574012/posts/720886619605231/
  4852. // -- post link structure: https://www.facebook.com/groups/<group id>/posts/<post id>/
  4853. newLink = postLink.href.split('?')[0] + 'posts/' + postId + '/';
  4854. }
  4855. else {
  4856. return;
  4857. }
  4858. }
  4859. else {
  4860. // -- hmm, we don't have the info to reconstruct a group post link.
  4861. return;
  4862. }
  4863.  
  4864. // -- put in fb's spacer between icons.
  4865. const spanSpacer = document.createElement('span');
  4866. spanSpacer.innerHTML = '<span><span style="position:absolute;width:1px;height:1px;">&nbsp;</span><span aria-hidden="true"> · </span></span>'
  4867. blockOfIcons.appendChild(spanSpacer);
  4868.  
  4869. const container = document.createElement('span');
  4870. container.className = 'link-new';
  4871. const span2 = document.createElement('span');
  4872. const linkNew = document.createElement('a');
  4873. linkNew.setAttribute('href', newLink);
  4874. linkNew.innerHTML = VARS.iconNewWindow;
  4875. linkNew.setAttribute('target', '_blank');
  4876. span2.appendChild(linkNew);
  4877. container.appendChild(span2);
  4878.  
  4879. blockOfIcons.appendChild(container);
  4880. }
  4881. }
  4882. catch (error) {
  4883. console.error(log + 'gf_setPostLinkToOpenInNewTab(); Error:', post, error);
  4884. }
  4885. }
  4886.  
  4887. function scrubInfoBoxes(post) {
  4888. // -- hide the "truth" info boxes that appear in posts having a certain topic.
  4889. // :: return <nothing>
  4890. let hiding = false;
  4891.  
  4892. if (VARS.Options.OTHER_INFO_BOX_CLIMATE_SCIENCE) {
  4893. const elLink = post.querySelector(`a[href*="${KeyWords.OTHER_INFO_BOX_CLIMATE_SCIENCE.pathMatch}"]:not([${postAtt}])`);
  4894. if (elLink !== null) {
  4895. // - block @ 5 levels up.
  4896. const block = climbUpTheTree(elLink, 5);
  4897. hideBlock(block, elLink, KeyWords.OTHER_INFO_BOX_CLIMATE_SCIENCE[VARS.language]);
  4898. hiding = true;
  4899. }
  4900. }
  4901. //console.info(log+'scrubInfoBoxes():', hiding, VARS.Options.OTHER_INFO_BOX_CORONAVIRUS, KeyWords.OTHER_INFO_BOX_CORONAVIRUS.pathMatch, post);
  4902. if (!hiding && VARS.Options.OTHER_INFO_BOX_CORONAVIRUS) {
  4903. const elLink = post.querySelector(`a[href*="${KeyWords.OTHER_INFO_BOX_CORONAVIRUS.pathMatch}"]:not([${postAtt}])`);
  4904. if (elLink !== null) {
  4905. // - block @ 5 levels up.
  4906. const block = climbUpTheTree(elLink, 5);
  4907. hideBlock(block, elLink, KeyWords.OTHER_INFO_BOX_CORONAVIRUS[VARS.language]);
  4908. hiding = true;
  4909. }
  4910. }
  4911. if (!hiding && VARS.Options.OTHER_INFO_BOX_SUBSCRIBE) {
  4912. const elLink = post.querySelector(`a[href*="${KeyWords.OTHER_INFO_BOX_SUBSCRIBE.pathMatch}"]:not([${postAtt}])`);
  4913. if (elLink !== null) {
  4914. // - block @ 5 levels up.
  4915. const block = climbUpTheTree(elLink, 5);
  4916. hideBlock(block, elLink, KeyWords.OTHER_INFO_BOX_SUBSCRIBE[VARS.language]);
  4917. hiding = true;
  4918. }
  4919. }
  4920. }
  4921.  
  4922. function nf_hideNumberOfShares(post) {
  4923. // -- hide the number of shares component
  4924. // :: return <nothing>
  4925. const query = `div[data-visualcompletion="ignore-dynamic"] > div:not([class]) > div:not([class]) > div:not([class]) > div[class] > div:nth-of-type(1) > div > div > span > div:not([id]) > span[dir]:not(${postAtt})`;
  4926. const shares = post.querySelectorAll(query);
  4927. for (const share of shares) {
  4928. share.setAttribute(VARS.cssHideNumberOfShares, '');
  4929. if (VARS.Options.VERBOSITY_DEBUG) {
  4930. share.setAttribute(VARS.cssShow, '');
  4931. }
  4932. share.setAttribute(postAtt, 'Shares');
  4933. }
  4934. }
  4935.  
  4936. function gf_hideNumberOfShares(post) {
  4937. // -- groups feed posts have same '# shares' html structure as news feed posts.
  4938. // -- .. hence calling nf_hideNumberOfShares(...)
  4939. // :: return <nothing>
  4940. nf_hideNumberOfShares(post);
  4941. }
  4942.  
  4943. function nf_postExceedsLikeCount(post) {
  4944. // -- hide posts having Like counts over a certain number
  4945. // const query = 'div[data-visualcompletion="ignore-dynamic"] > div:not([class]) > div:not([class]) > div:not([class]) > div[class] > div:nth-of-type(1) > div > div[class] > span > div[role="button"] > span[class][aria-hidden] > span:not([class]) > span[class]';
  4946. const queryLikes = 'span[role="toolbar"] ~ div div[role="button"] > span[class][aria-hidden] > span:not([class]) > span[class]';
  4947. const elLikes = post.querySelectorAll(queryLikes);
  4948. if (elLikes.length > 0) {
  4949. const maxLikes = parseInt(VARS.Options.NF_LIKES_MAXIMUM_COUNT);
  4950. const postLikesCount = getFullNumber(elLikes[0].textContent.trim());
  4951. // const postLikesCount = parseInt(elLikes[0].textContent);
  4952. const results = postLikesCount >= maxLikes ? KeyWords.NF_LIKES_MAXIMUM[VARS.language] : '';
  4953. // console.info(log + 'nf_postExceedsLikeCount(); results:', results, maxLikes, postLikesCount, post);
  4954. return results;
  4955. }
  4956. return false;
  4957. }
  4958.  
  4959. function getFullNumber(value) {
  4960. // -- convert shortened numbers into full numbers
  4961. // -- e.g 323 to 323; 1.2K to 1200; 1.4M to 1400000;
  4962. // :: returns a whole number.
  4963. let nvalue = 0;
  4964. if (value !== '') {
  4965. value = value.toUpperCase();
  4966. if (value.endsWith('K') || value.endsWith('M')) {
  4967. let multiplier = 1;
  4968. let pow_Y = 0;
  4969. if (value.endsWith('K')) {
  4970. // -- thousands
  4971. multiplier = 1000;
  4972. pow_Y = 3;
  4973. }
  4974. else if (value.endsWith('M')) {
  4975. // -- millions
  4976. multiplier = 1000000;
  4977. pow_Y = 6;
  4978. }
  4979.  
  4980. let bits = value.replace(/[KM]/g, '').replace(',', '.').split('.');
  4981.  
  4982. nvalue = parseInt(bits[0], 10) * multiplier;
  4983.  
  4984. if (bits.length > 1) {
  4985. nvalue += (parseInt(bits[1], 10) * Math.pow(10, (pow_Y - bits[1].length)));
  4986. }
  4987. }
  4988. else {
  4989. // -- less than 1000.
  4990. nvalue = parseInt(value, 10);
  4991. }
  4992. }
  4993. // console.info('results:', value, nvalue);
  4994. return nvalue;
  4995. }
  4996.  
  4997.  
  4998. function nf_scrubTheSurvey(containerTablist) {
  4999. // -- fb survey
  5000. // - located in the container next to Stories / Reels / Rooms tablist
  5001.  
  5002. const elParent = containerTablist.parentElement;
  5003. if (!elParent.nextElementSibling) {
  5004. return;
  5005. }
  5006.  
  5007. const elContainer = elParent.nextElementSibling.querySelector(':scope > div > div > div');
  5008.  
  5009. if (elContainer.hasAttribute(postAtt)) {
  5010. return;
  5011. }
  5012.  
  5013. const surveyLink = elContainer.querySelector('a[href^="https://www.facebook.com/survey/"]');
  5014.  
  5015. if (surveyLink) {
  5016. // const surveyContainer = climbUpTheTree(surveyLink, 8);
  5017. // const surveyContainer = climbUpTheTree(surveyLink, 7);
  5018. // if (surveyContainer) {
  5019. // hideFeature(surveyContainer, 'Survey', false);
  5020. // }
  5021. hideFeature(elContainer, 'Survey', false);
  5022. // console.info('fbcmf - survey:', elContainer, surveyLink)
  5023. }
  5024. // <element>.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement
  5025. }
  5026.  
  5027. function nf_getCollectionOfPosts() {
  5028. // -- get a collection of posts
  5029. // -- fb serves a mixture of html structures
  5030. // -- so, we have a set of queries to try until we have found something...
  5031. // :: return : collection of posts.
  5032.  
  5033. let posts = [];
  5034. // -- various news feed queries
  5035. const queries = [
  5036. // -- February 2024 - hot fix !!! (no "extra" spaces in the feeds)
  5037. // 'h3[dir="auto"] ~ div:not([class]) > div[class] > div > div > div > div',
  5038. // 'h2[dir="auto"] ~ div:not([class]) > div[class] > div > div > div > div',
  5039.  
  5040. // -- February 2024 - hot fix !!! (test)
  5041. 'h3[dir="auto"] ~ div:not([class]) > div[class] :is([aria-posinset],[aria-describedby]:not([aria-posinset]))',
  5042. 'h2[dir="auto"] ~ div:not([class]) > div[class] :is([aria-posinset],[aria-describedby]:not([aria-posinset]))',
  5043.  
  5044.  
  5045. // -- February 2023 (promoted above Sept/August due to no hard-coded class names.
  5046. 'h3[dir="auto"] ~ div:not([class]) > div[class]',
  5047. 'h2[dir="auto"] ~ div:not([class]) > div[class]',
  5048. // -- September 2023
  5049. // -- - home news feed
  5050. 'h3[dir="auto"] + div > div.x1lliihq',
  5051. // -- - recent news feed
  5052. 'h2[dir="auto"] + div > div.x1lliihq',
  5053. // -- July 2023 - fb tweaked the structure - random div levels.
  5054. // -- - home news feed
  5055. 'h3[dir="auto"] ~ div > div > div div.x1yztbdb:not([role])',
  5056. // -- - recent news feed
  5057. 'h2[dir="auto"] ~ div > div > div div.x1yztbdb:not([role])',
  5058. ]
  5059.  
  5060. for (const query of queries) {
  5061. const nodeList = document.querySelectorAll(query);
  5062. if (nodeList.length > 0) {
  5063. posts = Array.from(nodeList);
  5064. break;
  5065. }
  5066. }
  5067.  
  5068. return posts;
  5069. }
  5070.  
  5071. function mopUpTheNewsFeed() {
  5072. // -- mopping up the news feed page
  5073.  
  5074. // -- Tablist - not part of the general news feed stream
  5075. // -- Includes Stories (standalone tab)
  5076. // -- Includes FB' survey
  5077. if (VARS.Options.NF_TABLIST_STORIES_REELS_ROOMS || VARS.Options.NF_SURVEY) {
  5078. nf_scrubTheTabbiesAndOrSurvey(VARS.Options.NF_TABLIST_STORIES_REELS_ROOMS, VARS.Options.NF_SURVEY);
  5079. }
  5080.  
  5081. // -- aside's sponsored
  5082. nf_cleanTheConsoleTable('Sponsored');
  5083.  
  5084. // -- aside's suggestions
  5085. if (VARS.Options.NF_SUGGESTIONS) {
  5086. nf_cleanTheConsoleTable('Suggestions');
  5087. }
  5088.  
  5089. // -- news feed stream ...
  5090. const posts = nf_getCollectionOfPosts();
  5091.  
  5092. // console.info(log + 'mopUpTheNewsFeed(); posts:', posts);
  5093.  
  5094. if (posts.length > 0) {
  5095. // console.info(log+'---> mopUpTheNewsFeed()');
  5096. // -- fb clears out "older" posts as the user scrolls ... so, only process the last X posts.
  5097. const count = posts.length;
  5098. const start = (count < 50) ? 0 : (count - 50);
  5099.  
  5100. // for (let post of posts) {
  5101. for (let i = start; i < count; i++) {
  5102.  
  5103. const post = posts[i];
  5104.  
  5105. if (post.innerHTML.length === 0) {
  5106. if (post.hasAttribute(postAtt)) {
  5107. // -- fb is clearing out the posts as the user scrolls ...
  5108. nf_dropTags(post);
  5109. }
  5110. }
  5111. else {
  5112.  
  5113. let hideReason = '';
  5114.  
  5115. if (post.hasAttribute(postAtt)) {
  5116. // -- already flagged ...
  5117. hideReason = 'hidden';
  5118. // -- however, fb is clearing out the posts as the user scrolls ...
  5119. if (post.querySelector('a') === null) {
  5120. nf_dropTags(post);
  5121. }
  5122. }
  5123. else if ((post[postPropDS] !== undefined) && (parseInt(post[postPropDS]) >= VARS.scanCountMaxLoop)) {
  5124. // -- skip these - already been scanned a few times
  5125. }
  5126. else {
  5127. doLightDusting(post);
  5128.  
  5129. if (hideReason === '' && VARS.Options.NF_REELS_SHORT_VIDEOS) {
  5130. hideReason = nf_isReelsAndShortVideos(post);
  5131. }
  5132. if (hideReason === '' && VARS.Options.NF_SHORT_REEL_VIDEO) {
  5133. hideReason = nf_isShortReelVideo(post);
  5134. }
  5135. if (hideReason === '' && VARS.Options.NF_PAID_PARTNERSHIP) {
  5136. hideReason = nf_isPaidPartnership(post);
  5137. }
  5138. if (hideReason === '' && VARS.Options.NF_PEOPLE_YOU_MAY_KNOW) {
  5139. hideReason = nf_isPeopleYouMayKnow(post);
  5140. }
  5141. if (hideReason === '' && VARS.Options.NF_SUGGESTIONS) {
  5142. hideReason = nf_isSuggested(post);
  5143. }
  5144. if (hideReason === '' && VARS.Options.NF_FOLLOW) {
  5145. hideReason = nf_isFollow(post);
  5146. }
  5147. if (hideReason === '' && VARS.Options.NF_PARTICIPATE) {
  5148. hideReason = nf_isParticipate(post);
  5149. }
  5150. if (hideReason === '' && VARS.Options.NF_SPONSORED_PAID) {
  5151. hideReason = nf_isSponsoredPaidBy(post);
  5152. }
  5153. if (hideReason === '' && VARS.Options.NF_EVENTS_YOU_MAY_LIKE) {
  5154. hideReason = nf_isEventsYouMayLike(post);
  5155. }
  5156. if (hideReason === '' && VARS.Options.NF_BLOCKED_ENABLED) {
  5157. hideReason = nf_isBlockedText(post);
  5158. }
  5159. if (hideReason === '' && VARS.Options.NF_STORIES) {
  5160. hideReason = nf_isStoriesPost(post);
  5161. }
  5162. // -- placed here due to "overlaps" between this rule and at least 1 of the above rule.
  5163. if (hideReason === '' && VARS.Options.NF_SPONSORED && isSponsored(post)) {
  5164. hideReason = KeyWords.SPONSORED[VARS.language];
  5165. }
  5166. if (hideReason === '' && VARS.Options.NF_LIKES_MAXIMUM && VARS.Options.NF_LIKES_MAXIMUM !== '') {
  5167. hideReason = nf_postExceedsLikeCount(post);
  5168. }
  5169. }
  5170.  
  5171. if (hideReason.length > 0) {
  5172. // -- increment hidden count
  5173. VARS.echoCount++;
  5174. if (hideReason !== 'hidden') {
  5175. // -- post not yet hidden, hide it.
  5176. nf_hidePost(post, hideReason);
  5177. }
  5178. }
  5179. else {
  5180. // -- not a hidden post
  5181. // -- reset hidden count
  5182. VARS.echoCount = 0;
  5183. // -- run pause animation (useful to hide those animated comments)
  5184. if (VARS.Options.NF_ANIMATED_GIFS) {
  5185. swatTheMosquitos(post);
  5186. }
  5187. // -- hide info boxes
  5188. if (VARS.hideAnInfoBox) {
  5189. scrubInfoBoxes(post);
  5190. }
  5191. // -- hide number of shares box
  5192. if (VARS.Options.NF_SHARES) {
  5193. nf_hideNumberOfShares(post);
  5194. }
  5195. }
  5196. }
  5197. }
  5198. // console.info(log+'<--- mopUpTheNewsFeed()');
  5199. }
  5200. }
  5201.  
  5202. function mopUpTheGroupsFeed() {
  5203. // -- mopping up the groups feed page
  5204.  
  5205. // console.info(log+'mopUpTheGroupsFeed(), gfType:', VARS.gfType, '; hide an info box:', VARS.hideAnInfoBox);
  5206.  
  5207. if (VARS.gfType === 'groups' || VARS.gfType === 'groups-recent' || VARS.gfType === 'search') {
  5208. // - main groups feed.
  5209. // -- 'groups' - accessible via the Groups link
  5210. // -- 'groups-recent' - accessible via the Feeds > group link (has similar HTML structure to News Feed)
  5211. // -- 'search' - groups (same layout as groups feed)
  5212.  
  5213. // -- aside's suggestions (also appears above feed on narrow pages)
  5214. if (VARS.Options.GF_SUGGESTIONS) {
  5215. gf_cleanTheConsoleTable('Suggestions');
  5216. }
  5217.  
  5218. // -- groups feed stream ...
  5219. const query = VARS.gfType === 'groups-recent' ? 'h2[dir="auto"] + div > div' : 'div[role="feed"] > div';
  5220. const posts = Array.from(document.querySelectorAll(query));
  5221. if (posts.length) {
  5222. // console.info(log+'---> mopUpTheGroupsFeed() - multiple groups');
  5223. for (const post of posts) {
  5224. if (post.innerHTML.length === 0) {
  5225. continue;
  5226. }
  5227.  
  5228. let hideReason = '';
  5229.  
  5230. // -- add the open post in new tab link+icon.
  5231. if ((VARS.gfType === 'groups') && (post[postPropDS] === undefined)) {
  5232. gf_setPostLinkToOpenInNewTab(post);
  5233. }
  5234.  
  5235. if (post.hasAttribute(postAtt)) {
  5236. // -- already flagged
  5237. hideReason = 'hidden';
  5238. }
  5239. else if ((post[postPropDS] !== undefined) && (parseInt(post[postPropDS]) >= VARS.scanCountMaxLoop)) {
  5240. // -- skip these - already been scanned a few times
  5241. }
  5242. else {
  5243.  
  5244. doLightDusting(post);
  5245.  
  5246. if (hideReason === '' && VARS.Options.GF_SPONSORED && isSponsored(post)) {
  5247. hideReason = KeyWords.SPONSORED[VARS.language];
  5248. }
  5249. if (hideReason === '' && VARS.Options.GF_SUGGESTIONS) {
  5250. hideReason = gf_isSuggested(post);
  5251. }
  5252. // if (hideReason === '' && VARS.Options.GF_PAID_PARTNERSHIP) {
  5253. // //console.info(log + 'mopUpTheGroupsFeed(), ---- Paid partnership - needs code ----')
  5254. // }
  5255. if (hideReason === '' && VARS.Options.GF_SHORT_REEL_VIDEO) {
  5256. hideReason = gf_isShortReelVideo(post);
  5257. }
  5258. if (hideReason === '' && VARS.Options.GF_BLOCKED_ENABLED) {
  5259. hideReason = gf_isBlockedText(post);
  5260. }
  5261. }
  5262.  
  5263. if (hideReason.length > 0) {
  5264. // -- increment hidden count
  5265. VARS.echoCount++;
  5266. if (hideReason !== 'hidden') {
  5267. // -- post not yet hidden, hide it.
  5268. gvf_hidePost(post, hideReason)
  5269. }
  5270. }
  5271. else {
  5272. // -- not a hidden post
  5273. // -- reset hidden count
  5274. VARS.echoCount = 0;
  5275. // -- run pause animation (useful to hide those animated comments)
  5276. if (VARS.Options.GF_ANIMATED_GIFS) {
  5277. // console.info(log + 'pausing animations ...');
  5278. swatTheMosquitos(post);
  5279. }
  5280. // -- hide info boxes
  5281. if (VARS.hideAnInfoBox) {
  5282. scrubInfoBoxes(post);
  5283. }
  5284. // -- hide number of shares box
  5285. if (VARS.Options.GF_SHARES) {
  5286. gf_hideNumberOfShares(post);
  5287. }
  5288. }
  5289. // console.info(log+'mopUpTheGroupsFeed:', hideReason, VARS.echoCount, post);
  5290. }
  5291. // console.info(log+'<--- mopUpTheGroupsFeed() - multiple groups');
  5292. }
  5293. }
  5294. else {
  5295. // - single group ...
  5296. const query = 'div[role="feed"] > div';
  5297. const posts = Array.from(document.querySelectorAll(query));
  5298. if (posts.length) {
  5299. // console.info(log+'---> mopUpTheGroupsFeed() - single group');
  5300. for (const post of posts) {
  5301.  
  5302. if (post.innerHTML.length === 0) {
  5303. continue;
  5304. }
  5305.  
  5306. let hideReason = '';
  5307.  
  5308. if (post.hasAttribute(postAtt)) {
  5309. // -- already flagged
  5310. hideReason = 'hidden';
  5311. }
  5312. else if ((post[postPropDS] !== undefined) && (parseInt(post[postPropDS]) >= VARS.scanCountMaxLoop)) {
  5313. // -- skip these - already scanned a few times
  5314. }
  5315. else {
  5316. doLightDusting(post);
  5317.  
  5318. if (hideReason === '' && VARS.Options.GF_SHORT_REEL_VIDEO) {
  5319. hideReason = gf_isShortReelVideo(post);
  5320. }
  5321. if (hideReason === '' && VARS.Options.GF_BLOCKED_ENABLED) {
  5322. hideReason = gf_isBlockedText(post);
  5323. }
  5324. }
  5325.  
  5326. if (hideReason.length > 0) {
  5327. // -- increment hidden counter
  5328. VARS.echoCount++;
  5329. if (hideReason !== 'hidden') {
  5330. // -- post not yet hidden, hide it.
  5331. gvf_hidePost(post, hideReason)
  5332. }
  5333. }
  5334. else {
  5335. // -- not a hidden post
  5336. // -- reset hidden count
  5337. VARS.echoCount = 0;
  5338. // -- run pause animation (useful to hide those animated comments)
  5339. if (VARS.Options.GF_ANIMATED_GIFS) {
  5340. // console.info(log + 'pausing animations ...');
  5341. swatTheMosquitos(post);
  5342. }
  5343. // -- hide info boxes
  5344. if (VARS.hideAnInfoBox) {
  5345. scrubInfoBoxes(post);
  5346. }
  5347. // -- hide number of shares box
  5348. if (VARS.Options.GF_SHARES) {
  5349. gf_hideNumberOfShares(post);
  5350. }
  5351. }
  5352. }
  5353. // console.info(log+'<--- mopUpTheGroupsFeed() - single group');
  5354. }
  5355. }
  5356. }
  5357.  
  5358. function mopUpTheWatchVideosFeed() {
  5359. // -- mopping up the watch videos feed page
  5360.  
  5361. let query;
  5362. let queryBlocks;
  5363. if (VARS.vfType === 'videos') {
  5364. // -- normal feed
  5365. query = 'div[id="watch_feed"] > div > div > div > div > div > div';
  5366. //queryBlocks = ':scope > div > div > div > div > div:nth-of-type(2) > div';
  5367. queryBlocks = ':scope > div > div > div > div > div > div:nth-of-type(2) > div';
  5368. }
  5369. else if (VARS.vfType === 'search') {
  5370. // -- videos --> search
  5371. query = 'div[role="feed"] > div[role="article"]';
  5372. queryBlocks = ':scope > div > div > div > div > div > div > div:nth-of-type(2)';
  5373. }
  5374. else if (VARS.vfType === 'item') {
  5375. // -- videos --> search --> item (videos being listed below the video of interest)
  5376. // -- video - via link
  5377. query = 'div[id="watch_feed"] > div > div:nth-of-type(2) > div > div > div > div:nth-of-type(2) > div > div > div';
  5378. queryBlocks = ':scope > div > div > div > div > div:nth-of-type(2) > div';
  5379. }
  5380. else {
  5381. return;
  5382. }
  5383.  
  5384. if (VARS.vfType !== 'search') {
  5385. const posts = document.querySelectorAll(query);
  5386. for (const post of posts) {
  5387. if (post.innerHTML.length === 0) {
  5388. continue;
  5389. }
  5390.  
  5391. let hideReason = '';
  5392.  
  5393. if (post.hasAttribute(postAtt)) {
  5394. // -- already hidden
  5395. hideReason = 'hidden';
  5396. }
  5397. else if ((post[postPropDS] !== undefined) && (parseInt(post[postPropDS]) >= VARS.scanCountMaxLoop)) {
  5398. // -- skip these - already been scanned a few times
  5399. // console.info(log + 'video; skipping;', post[postPropDS], VARS.scanCountMaxLoop, post);
  5400. }
  5401. else {
  5402. doLightDusting(post);
  5403.  
  5404. if (hideReason === '' && VARS.Options.VF_SPONSORED && isSponsored(post)) {
  5405. hideReason = KeyWords.SPONSORED[VARS.language];
  5406. }
  5407. if (hideReason === '' && VARS.Options.VF_LIVE) {
  5408. hideReason = vf_isVideoLive(post);
  5409. }
  5410. if (hideReason === '' && VARS.Options.VF_BLOCKED_ENABLED) {
  5411. hideReason = vf_isBlockedText(post, queryBlocks);
  5412. }
  5413. // console.info(log + 'mopUpTheWatchVideosFeed(); ::: hideReason:', hideReason, post, queryBlocks);
  5414. }
  5415.  
  5416. if (hideReason.length > 0) {
  5417. // -- increment hidden count
  5418. VARS.echoCount++;
  5419. if (hideReason !== 'hidden') {
  5420. // -- post not yet hidden, hide it.
  5421. gvf_hidePost(post, hideReason);
  5422. }
  5423. }
  5424. else {
  5425. // -- not a hidden post
  5426. // -- reset hidden count
  5427. VARS.echoCount = 0;
  5428. // -- run pause animation (useful to hide those animated comments)
  5429. if (VARS.Options.VF_ANIMATED_GIFS) {
  5430. // console.info(log + 'pausing animations ...');
  5431. swatTheMosquitos(post);
  5432. }
  5433. // -- hide info boxes
  5434. if (VARS.hideAnInfoBox) {
  5435. scrubInfoBoxes(post);
  5436. }
  5437. // -- nb: videos do not have a number of shares box
  5438.  
  5439. // -- hide sponsored blocks (appears between video & comments)
  5440. vf_scrubSponsoredBlock(post);
  5441. }
  5442. }
  5443. }
  5444. else {
  5445. // -- search videos
  5446. // -- structure is different from regular video feed
  5447. // -- thumbnail on left, text on right
  5448. const posts = document.querySelectorAll(query);
  5449. for (const post of posts) {
  5450.  
  5451. let hideReason = '';
  5452.  
  5453. if (post.hasAttribute(postAtt)) {
  5454. // -- already hidden
  5455. hideReason = 'hidden';
  5456. }
  5457. else {
  5458. if (VARS.Options.VF_BLOCKED_ENABLED) {
  5459. hideReason = vf_isBlockedText(post, queryBlocks);
  5460. }
  5461. }
  5462.  
  5463. if (hideReason.length > 0) {
  5464. // -- increment hidden count
  5465. VARS.echoCount++;
  5466. if (hideReason !== 'hidden') {
  5467. // -- post not yet hidden, hide it.
  5468. gvf_hidePost(post, hideReason);
  5469. }
  5470. }
  5471. else {
  5472. // -- not a hidden post
  5473. // -- reset hidden count
  5474. VARS.echoCount = 0;
  5475. }
  5476. }
  5477. }
  5478. }
  5479.  
  5480. function mp_hideBox(box, reason) {
  5481. box.setAttribute(VARS.cssHideEl, '');
  5482. box.setAttribute(postAtt, sanitizeReason(reason));
  5483. if (VARS.Options.VERBOSITY_DEBUG) {
  5484. box.setAttribute(VARS.cssShow, '');
  5485. }
  5486. }
  5487.  
  5488. function mp_stopTrackingDirtIntoMyHouse() {
  5489. // -- remove tracking bits
  5490. const collectionOfLinks = document.querySelectorAll('a[href*="/?ref="]');
  5491. for (const trackingLink of collectionOfLinks) {
  5492. trackingLink.href = trackingLink.href.split('/?ref')[0];
  5493. }
  5494. }
  5495.  
  5496. function mopUpTheMarketplaceFeed() {
  5497. // -- mopping up parts of the Marketplace ...
  5498.  
  5499. mp_stopTrackingDirtIntoMyHouse();
  5500.  
  5501. // console.info(log + 'mopUpTheMarketplaceFeed(); mpType:', VARS.mpType);
  5502.  
  5503. if (VARS.mpType === 'marketplace' || VARS.mpType === 'item') {
  5504. // - standard marketplace page
  5505. // - on the item page, there's listing of items to sell ... (similar structure to standard marketplace page)
  5506. // -- "sponsored" is _not_ obfuscated;
  5507. // -- nb: adguard base filter hides the label, but not the item/product ...
  5508. const queryHeadings = `div:not([${postAtt}]) > a[href="/ads/about/?entry_product=ad_preferences"]`;
  5509. const headings = document.querySelectorAll(queryHeadings);
  5510.  
  5511. let queryItems = `div[style]:not([${postAtt}]) > span > div:first-of-type > a:not([href*="marketplace"])`;
  5512. let items = document.querySelectorAll(queryItems);
  5513. if (items.length === 0) {
  5514. // -- structure changed in Nov 2023.
  5515. queryItems = `div[style]:not([${postAtt}]) > span > div:first-of-type > div > a:not([href*="marketplace"])`;
  5516. items = document.querySelectorAll(queryItems);
  5517. }
  5518.  
  5519. // console.info(log+'marketplace(); headings:', headings);
  5520. // console.info(log+'marketplace(); items:', items);
  5521.  
  5522. if (VARS.Options.MP_SPONSORED && (headings.length > 0) && (items.length > 0)) {
  5523. for (const heading of headings) {
  5524. // heading = heading.parentElement;
  5525. mp_hideBox(heading.parentElement, KeyWords.SPONSORED[VARS.language]);
  5526. }
  5527. for (const item of items) {
  5528. // const parentItem = climbUpTheTree(item, 3);
  5529. const parentItem = climbUpTheTree(item, 4);
  5530. mp_hideBox(parentItem, KeyWords.SPONSORED[VARS.language]);
  5531. }
  5532. }
  5533. if (VARS.Options.MP_BLOCKED_ENABLED) {
  5534. mp_doBlockingByBlockedText();
  5535. }
  5536. }
  5537. if (VARS.mpType === 'item') {
  5538. // -- viewing a marketplace item - a small sponsored box often shows up on the right.
  5539. if (VARS.Options.MP_SPONSORED) {
  5540. const elDialog = document.querySelector('div[role="dialog"]');
  5541. if (elDialog) {
  5542. // -- viewing a mp item via mp feed (no new tab or reloaded page)
  5543. let queryPattern = 'a[href*="/ads/"]';
  5544. let element = elDialog.querySelector(queryPattern);
  5545. if (element) {
  5546. if (element.hasAttribute(postAtt)) {
  5547. return;
  5548. }
  5549. // console.info(`${log}MPItem() - element:`, queryPattern1, element);
  5550. if (element.closest('div[data-pagelet^="BrowseFeedUpsell"]') === null) {
  5551. // -- found the sponsored box inside the mp item box.
  5552. // -- mp item do not have a parent element having data-pagelet attribute.
  5553. let elParent = element.parentElement.closest('h2');
  5554. if (elParent) {
  5555. elParent = elParent.closest('span');
  5556. mp_hideBox(elParent, KeyWords.SPONSORED[VARS.language]);
  5557. element.setAttribute(postAtt, KeyWords.SPONSORED[VARS.language]);
  5558. }
  5559. }
  5560. }
  5561. else {
  5562. // -- structure change, Nov 2023
  5563. // -- multiple sponsored items (slider style)
  5564. queryPattern = 'a[href*="//l.facebook.com/l.php?u="]';
  5565. const elements = elDialog.querySelectorAll(queryPattern);
  5566. if (elements.length > 0) {
  5567. element = elements[0];
  5568. if (element.hasAttribute(postAttChildFlag)) {
  5569. return;
  5570. }
  5571. if (element.href.length > 500) {
  5572. const elParent = climbUpTheTree(element, 9);
  5573. mp_hideBox(elParent, KeyWords.SPONSORED[VARS.language]);
  5574. element.setAttribute(postAttChildFlag, KeyWords.SPONSORED[VARS.language]);
  5575. }
  5576. }
  5577. }
  5578. }
  5579. else {
  5580. // -- viewing a mp item in a new tab / reloaded page.
  5581. let queryPattern = 'a[href*="/ads/"]';
  5582. let element = document.querySelector(queryPattern);
  5583. if (element) {
  5584. if (!element.hasAttribute(postAtt)) {
  5585. // -- found the sponsored box inside the mp item box.
  5586. let elParent = element.parentElement.closest('h2');
  5587. if (elParent) {
  5588. elParent = elParent.closest('span');
  5589. mp_hideBox(elParent, KeyWords.SPONSORED[VARS.language]);
  5590. element.setAttribute(postAtt, KeyWords.SPONSORED[VARS.language]);
  5591. }
  5592. }
  5593. }
  5594. else {
  5595. // -- structure change, Nov 2023
  5596. // -- multiple sponsored items (slider style)
  5597. queryPattern = 'a[href*="//l.facebook.com/l.php?u="]';
  5598. const elements = document.querySelectorAll(queryPattern);
  5599. if (elements.length > 0) {
  5600. element = elements[0];
  5601. if (element.hasAttribute(postAttChildFlag)) {
  5602. return;
  5603. }
  5604. if (element.href.length > 500) {
  5605. const elParent = climbUpTheTree(element, 9);
  5606. mp_hideBox(elParent, KeyWords.SPONSORED[VARS.language]);
  5607. element.setAttribute(postAttChildFlag, KeyWords.SPONSORED[VARS.language]);
  5608. }
  5609. }
  5610. }
  5611. }
  5612. }
  5613. }
  5614. else if ((VARS.mpType === 'category') || (VARS.mpType === 'search')) {
  5615. // - viewing a markplace category or marketplace search results
  5616. // - (both have similar layout)
  5617. if (VARS.Options.MP_SPONSORED) {
  5618. const query = `a[href*="/ads/"]:not([${postAtt}])`;
  5619. const elements = document.querySelectorAll(query);
  5620. for (const element of elements) {
  5621. // console.info(log + 'mp-clean:', element);
  5622. element.setAttribute(postAtt, element.innerHTML.length);
  5623. const itemBox = climbUpTheTree(element.parentElement.closest('a'), 3);
  5624. mp_hideBox(itemBox, KeyWords.SPONSORED[VARS.language]);
  5625. }
  5626. }
  5627. if (VARS.Options.MP_BLOCKED_ENABLED) {
  5628. mp_doBlockingByBlockedText();
  5629. }
  5630. }
  5631. }
  5632.  
  5633. function mopUpTheSearchFeed() {
  5634. // mopping up the search feed / results
  5635. // -- (nb: has similar layout to news feed stream)
  5636. // -- "borrow" news feed's text filter.
  5637. if (VARS.Options.NF_BLOCKED_ENABLED) {
  5638. const query = 'div[role="feed"] > div';
  5639. const posts = Array.from(document.querySelectorAll(query));
  5640.  
  5641. for (const post of posts) {
  5642.  
  5643. if (post.innerHTML.length === 0) {
  5644. continue;
  5645. }
  5646.  
  5647. let hideReason = '';
  5648.  
  5649. if (post.hasAttribute(postAtt)) {
  5650. hideReason = 'hidden';
  5651. }
  5652. else {
  5653. if (VARS.Options.NF_SPONSORED && isSponsored(post)) {
  5654. hideReason = KeyWords.SPONSORED[VARS.language];
  5655. }
  5656. if (hideReason === '' && VARS.NF_BLOCKED_ENABLED) {
  5657. hideReason = nf_isBlockedText(post);
  5658. }
  5659. }
  5660.  
  5661. if (hideReason.length > 0) {
  5662. // -- increment hidden count
  5663. VARS.echoCount++;
  5664. if (hideReason !== 'hidden') {
  5665. // -- post not yet hidden, hide it.
  5666. nf_hidePost(post, hideReason);
  5667. }
  5668. }
  5669. else {
  5670. // -- not a hidden post
  5671. // -- reset hidden count
  5672. VARS.echoCount = 0;
  5673. // -- run pause animation (useful to hide those animated comments)
  5674. if (VARS.Options.NF_ANIMATED_GIFS) {
  5675. // console.info(log + 'pausing animations ...');
  5676. swatTheMosquitos(post);
  5677. }
  5678. // -- hide info boxes
  5679. if (VARS.hideAnInfoBox) {
  5680. scrubInfoBoxes(post);
  5681. }
  5682. }
  5683. }
  5684. }
  5685. }
  5686.  
  5687. function mopUpTheReelFeed(caller) {
  5688. // -- display the reel's video controls
  5689.  
  5690. // -- bodyMutation will initially trigger this function to run, but sometimes misses out on a reel video ...
  5691. // -- so, we use setTimeout() to make it run regularly until no longer in Reels.
  5692.  
  5693. // -- saveUserOptions will also call this function ...
  5694.  
  5695. // -- nb: videos from the watch videos feed are also collected in the query ..
  5696. // -- .. but they do not have a container with [data-video-id] attribute
  5697. // -- .. and therefore skipped ...
  5698.  
  5699. // -- nb: setting VARS.isRF determines if this function is called or not.
  5700.  
  5701. if (!VARS.isRF) {
  5702. // -- no longer in Reels Feed
  5703. VARS.isRF_InTimeoutMode = false;
  5704. return;
  5705. }
  5706. if (caller !== 'self' && VARS.isRF_InTimeoutMode === true) {
  5707. // -- either bodyMutation or saveUserOptions is calling and TimeoutMode is currently active.
  5708. return;
  5709. }
  5710.  
  5711. const videoRules = 'video:not([controls])';
  5712. const videos = document.querySelectorAll(videoRules);
  5713. // console.info(log+'mopUpTheReelFeed(); videos:', caller, videos);
  5714. for (const video of videos) {
  5715. // -- get the video's container's child element
  5716. const elVideoId = video.closest('[data-video-id]');
  5717. if (elVideoId) {
  5718. // -- get the video's container
  5719. const videoContainer = elVideoId.parentElement;
  5720. if (videoContainer) {
  5721. // -- get the video's description + audio track info container.
  5722. const descriptionOverlay = videoContainer.nextElementSibling;
  5723. if (descriptionOverlay) {
  5724. // -- make room to display the controls by moving the description element up a bit ...
  5725. const elDescriptionContainer = descriptionOverlay.children[0];
  5726. elDescriptionContainer.setAttribute('style', 'margin-bottom:2.15rem;');
  5727. // -- enable controls on the video
  5728. video.setAttribute('controls', 'true');
  5729. // -- hide the video's sibling (makes it easier to click on the video's controls)
  5730. const sibling = video.nextElementSibling;
  5731. if (sibling) {
  5732. sibling.setAttribute('style', 'display:none;');
  5733. }
  5734. }
  5735. }
  5736. }
  5737. else {
  5738. // -- a video from the watch videos feed
  5739. // -- hidden underneath the reels feed overlay)
  5740. }
  5741. }
  5742.  
  5743. // -- call me again in a few ms ...
  5744. VARS.isRF_InTimeoutMode = true;
  5745. setTimeout(function () {
  5746. mopUpTheReelFeed('self')
  5747. }, 1000);
  5748. }
  5749.  
  5750.  
  5751. // ** Mutations processor
  5752. function bodyMutating(mutations) {
  5753. for (const mutation of mutations) {
  5754. if ((mutation.type === 'childList') && (mutation.addedNodes.length > 0)) {
  5755. if (VARS.prevURL !== window.location.href) {
  5756. // - page url has changed ... refresh the bodyObserver.
  5757. runMO();
  5758. }
  5759. else if (VARS.isAF) {
  5760. // -- isAF := any feed
  5761. // -- nb: don't bother with looping through mutation.addedNodes.length - 99.5% of the time there's only one ...
  5762. const mnode = mutation.addedNodes[0]; // placed here for error trapping block
  5763. // try {
  5764. VARS.mutationsCount++;
  5765. // if (VARS.mutationsCount % 100 === 0) {
  5766. // console.info(log+'bodyMutating(); mutationsCount:', VARS.mutationsCount);
  5767. // }
  5768. if (VARS.mutationsCount > VARS.mutationsInitSkip) {
  5769. if (['A', 'DIV', 'IMG', 'SPAN', '#text', 'svg', 'VIDEO'].indexOf(mnode.nodeName) > 0) {
  5770. if ((mnode.nodeType === Node.ELEMENT_NODE) && ((mnode.innerHTML.length < 129) || (mnode.textContent.length === 0))) {
  5771. // - skip these ...
  5772. }
  5773. else {
  5774. // console.info(log + 'bodyMutating();', VARS.isNF, VARS.isGF, VARS.isVF, VARS.isMF, VARS.isSF);
  5775. if (VARS.isNF) {
  5776. mopUpTheNewsFeed();
  5777. }
  5778. else if (VARS.isGF) {
  5779. mopUpTheGroupsFeed();
  5780. }
  5781. else if (VARS.isVF) {
  5782. mopUpTheWatchVideosFeed();
  5783. }
  5784. else if (VARS.isMF) {
  5785. mopUpTheMarketplaceFeed();
  5786. }
  5787. else if (VARS.isSF) {
  5788. mopUpTheSearchFeed();
  5789. }
  5790. else if (VARS.isRF) {
  5791. mopUpTheReelFeed('mutations');
  5792. }
  5793. }
  5794. }
  5795. }
  5796. }
  5797. }
  5798. }
  5799. };
  5800.  
  5801. // ** Mutation Observer
  5802. let bodyObserver = new MutationObserver(bodyMutating);
  5803. // ** MO starter / restarter
  5804. let firstRun = true;
  5805.  
  5806. function runMO() {
  5807. // -- run code soon as the elements HEAD, BDDY and variable Options are ready/available.
  5808. // -- or when page url has changed ...
  5809. if (document.head && document.body && VARS.optionsReady) {
  5810. // console.info(log + 'runMO(); - ready ...');
  5811. if (firstRun) {
  5812. GM.registerMenuCommand(KeyWords.GM_MENU_SETTINGS[VARS.language], toggleDialog);
  5813. addCSS();
  5814. window.setTimeout(addExtraCSS, 150); // fb is sometimes laggy ...
  5815. buildMoppingDialog();
  5816. firstRun = false;
  5817. }
  5818. if (setFeedSettings()) {
  5819. // - clear out mutations not yet processed ...
  5820. let mutations = bodyObserver.takeRecords();
  5821. bodyObserver.disconnect();
  5822. // - and start up the osbserver again.
  5823. bodyObserver.observe(document.body, {
  5824. childList: true,
  5825. subtree: true,
  5826. attributes: false
  5827. });
  5828.  
  5829. if (VARS.isRF) {
  5830. // -- mutations might not call mopUpTheReelFeed() when the URL changes, so call it now.
  5831. mopUpTheReelFeed('setFeedSettings');
  5832. }
  5833. }
  5834. }
  5835. else {
  5836. // HEAD / BODY / Options not yet ready ...
  5837. // console.info(log + 'runMO(); - not yet ready ...');
  5838. setTimeout(runMO, 10);
  5839. }
  5840. }
  5841. runMO();
  5842.  
  5843. })();