@browserless.io/browserless 2.38.0 → 2.38.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/build/browsers/index.js +12 -6
  3. package/build/routes/management/http/kill.get.js +2 -2
  4. package/build/shared/utils/function/handler.js +2 -2
  5. package/build/utils.d.ts +1 -0
  6. package/build/utils.js +1 -0
  7. package/build/utils.spec.d.ts +1 -0
  8. package/build/utils.spec.js +27 -0
  9. package/extensions/ublocklite/_locales/be/messages.json +5 -5
  10. package/extensions/ublocklite/_locales/id/messages.json +9 -9
  11. package/extensions/ublocklite/_locales/ja/messages.json +4 -4
  12. package/extensions/ublocklite/_locales/pt_PT/messages.json +1 -1
  13. package/extensions/ublocklite/_locales/th/messages.json +2 -2
  14. package/extensions/ublocklite/_locales/uk/messages.json +9 -9
  15. package/extensions/ublocklite/_locales/vi/messages.json +5 -5
  16. package/extensions/ublocklite/_locales/zh_CN/messages.json +8 -8
  17. package/extensions/ublocklite/js/jsonpath.js +2 -2
  18. package/extensions/ublocklite/js/static-filtering-parser.js +3 -1
  19. package/extensions/ublocklite/js/utils.js +1 -3
  20. package/extensions/ublocklite/manifest.json +1 -1
  21. package/extensions/ublocklite/rulesets/generic-details.json +2 -0
  22. package/extensions/ublocklite/rulesets/main/adguard-mobile.json +1 -2
  23. package/extensions/ublocklite/rulesets/main/adguard-spyware-url.json +7 -4
  24. package/extensions/ublocklite/rulesets/main/annoyances-cookies.json +2 -1
  25. package/extensions/ublocklite/rulesets/main/chn-0.json +23 -13
  26. package/extensions/ublocklite/rulesets/main/deu-0.json +2 -1
  27. package/extensions/ublocklite/rulesets/main/dpollock-0.json +1 -0
  28. package/extensions/ublocklite/rulesets/main/easylist.json +12 -4
  29. package/extensions/ublocklite/rulesets/main/easyprivacy.json +19 -6
  30. package/extensions/ublocklite/rulesets/main/fra-0.json +2 -2
  31. package/extensions/ublocklite/rulesets/main/hrv-0.json +6 -15
  32. package/extensions/ublocklite/rulesets/main/idn-0.json +6 -2
  33. package/extensions/ublocklite/rulesets/main/ind-0.json +27 -11
  34. package/extensions/ublocklite/rulesets/main/isr-0.json +1 -0
  35. package/extensions/ublocklite/rulesets/main/jpn-1.json +9 -4
  36. package/extensions/ublocklite/rulesets/main/kor-1.json +3 -2
  37. package/extensions/ublocklite/rulesets/main/nld-0.json +9 -7
  38. package/extensions/ublocklite/rulesets/main/nor-0.json +6 -3
  39. package/extensions/ublocklite/rulesets/main/pgl.json +10 -3
  40. package/extensions/ublocklite/rulesets/main/pol-0.json +2 -0
  41. package/extensions/ublocklite/rulesets/main/rus-0.json +11 -9
  42. package/extensions/ublocklite/rulesets/main/rus-1.json +2 -1
  43. package/extensions/ublocklite/rulesets/main/spa-1.json +2 -1
  44. package/extensions/ublocklite/rulesets/main/stevenblack-hosts.json +15646 -4853
  45. package/extensions/ublocklite/rulesets/main/swe-1.json +7 -9
  46. package/extensions/ublocklite/rulesets/main/tur-0.json +3 -4
  47. package/extensions/ublocklite/rulesets/main/ublock-badware.json +4 -7
  48. package/extensions/ublocklite/rulesets/main/ublock-filters.json +46 -21
  49. package/extensions/ublocklite/rulesets/main/ukr-0.json +3 -5
  50. package/extensions/ublocklite/rulesets/main/urlhaus-full.json +1554 -196
  51. package/extensions/ublocklite/rulesets/main/vie-1.json +26 -26
  52. package/extensions/ublocklite/rulesets/regex/chn-0.json +2 -2
  53. package/extensions/ublocklite/rulesets/regex/hrv-0.json +20 -0
  54. package/extensions/ublocklite/rulesets/regex/jpn-1.json +1 -1
  55. package/extensions/ublocklite/rulesets/regex/ublock-filters.json +10 -9
  56. package/extensions/ublocklite/rulesets/ruleset-details.json +160 -160
  57. package/extensions/ublocklite/rulesets/scripting/generic/annoyances-notifications.js +1 -1
  58. package/extensions/ublocklite/rulesets/scripting/generic/chn-0.js +1 -1
  59. package/extensions/ublocklite/rulesets/scripting/generic/easylist.js +1 -1
  60. package/extensions/ublocklite/rulesets/scripting/generic/hrv-0.js +1 -1
  61. package/extensions/ublocklite/rulesets/scripting/generic/rus-0.js +1 -1
  62. package/extensions/ublocklite/rulesets/scripting/generic/spa-1.js +2 -2
  63. package/extensions/ublocklite/rulesets/scripting/generic/ublock-filters.js +3 -3
  64. package/extensions/ublocklite/rulesets/scripting/generic/vie-1.js +1 -1
  65. package/extensions/ublocklite/rulesets/scripting/generichigh/rus-0.css +1 -0
  66. package/extensions/ublocklite/rulesets/scripting/procedural/annoyances-cookies.js +1 -1
  67. package/extensions/ublocklite/rulesets/scripting/procedural/annoyances-overlays.js +2 -2
  68. package/extensions/ublocklite/rulesets/scripting/procedural/easylist.js +3 -3
  69. package/extensions/ublocklite/rulesets/scripting/procedural/hrv-0.js +3 -3
  70. package/extensions/ublocklite/rulesets/scripting/procedural/jpn-1.js +3 -3
  71. package/extensions/ublocklite/rulesets/scripting/procedural/rou-1.js +3 -3
  72. package/extensions/ublocklite/rulesets/scripting/procedural/rus-0.js +3 -3
  73. package/extensions/ublocklite/rulesets/scripting/procedural/swe-1.js +2 -2
  74. package/extensions/ublocklite/rulesets/scripting/procedural/tur-0.js +3 -3
  75. package/extensions/ublocklite/rulesets/scripting/procedural/ublock-filters.js +3 -3
  76. package/extensions/ublocklite/rulesets/scripting/procedural/vie-1.js +3 -3
  77. package/extensions/ublocklite/rulesets/scripting/scriptlet/adguard-mobile.abort-on-property-read.js +2 -2
  78. package/extensions/ublocklite/rulesets/scripting/scriptlet/annoyances-cookies.remove-node-text.js +1 -1
  79. package/extensions/ublocklite/rulesets/scripting/scriptlet/annoyances-cookies.set-cookie.js +2 -2
  80. package/extensions/ublocklite/rulesets/scripting/scriptlet/annoyances-cookies.trusted-click-element.js +3 -3
  81. package/extensions/ublocklite/rulesets/scripting/scriptlet/annoyances-cookies.trusted-set-cookie.js +2 -2
  82. package/extensions/ublocklite/rulesets/scripting/scriptlet/annoyances-overlays.addEventListener-defuser.js +1 -1
  83. package/extensions/ublocklite/rulesets/scripting/scriptlet/annoyances-overlays.prevent-fetch.js +10 -5
  84. package/extensions/ublocklite/rulesets/scripting/scriptlet/annoyances-overlays.remove-node-text.js +2 -2
  85. package/extensions/ublocklite/rulesets/scripting/scriptlet/chn-0.abort-on-property-read.js +2 -2
  86. package/extensions/ublocklite/rulesets/scripting/scriptlet/chn-0.abort-on-stack-trace.js +2 -2
  87. package/extensions/ublocklite/rulesets/scripting/scriptlet/chn-0.prevent-fetch.js +10 -5
  88. package/extensions/ublocklite/rulesets/scripting/scriptlet/easyprivacy.prevent-fetch.js +10 -5
  89. package/extensions/ublocklite/rulesets/scripting/scriptlet/fin-0.set-constant.js +541 -0
  90. package/extensions/ublocklite/rulesets/scripting/scriptlet/fra-0.prevent-fetch.js +10 -5
  91. package/extensions/ublocklite/rulesets/scripting/scriptlet/hrv-0.set-constant.js +541 -0
  92. package/extensions/ublocklite/rulesets/scripting/scriptlet/idn-0.prevent-fetch.js +10 -5
  93. package/extensions/ublocklite/rulesets/scripting/scriptlet/irn-0.prevent-fetch.js +10 -5
  94. package/extensions/ublocklite/rulesets/scripting/scriptlet/isr-0.prevent-fetch.js +10 -5
  95. package/extensions/ublocklite/rulesets/scripting/scriptlet/jpn-1.prevent-fetch.js +10 -5
  96. package/extensions/ublocklite/rulesets/scripting/scriptlet/kor-1.json-prune-xhr-response.js +1 -1
  97. package/extensions/ublocklite/rulesets/scripting/scriptlet/kor-1.prevent-fetch.js +10 -5
  98. package/extensions/ublocklite/rulesets/scripting/scriptlet/nld-0.abort-current-script.js +2 -2
  99. package/extensions/ublocklite/rulesets/scripting/scriptlet/nld-0.prevent-fetch.js +11 -6
  100. package/extensions/ublocklite/rulesets/scripting/scriptlet/nld-0.xml-prune.js +1 -1
  101. package/extensions/ublocklite/rulesets/scripting/scriptlet/nor-0.prevent-fetch.js +10 -5
  102. package/extensions/ublocklite/rulesets/scripting/scriptlet/rus-0.abort-on-property-read.js +2 -2
  103. package/extensions/ublocklite/rulesets/scripting/scriptlet/rus-0.abort-on-stack-trace.js +1 -1
  104. package/extensions/ublocklite/rulesets/scripting/scriptlet/rus-0.addEventListener-defuser.js +3 -3
  105. package/extensions/ublocklite/rulesets/scripting/scriptlet/rus-0.href-sanitizer.js +2 -2
  106. package/extensions/ublocklite/rulesets/scripting/scriptlet/rus-0.prevent-fetch.js +10 -5
  107. package/extensions/ublocklite/rulesets/scripting/scriptlet/rus-0.remove-attr.js +2 -2
  108. package/extensions/ublocklite/rulesets/scripting/scriptlet/rus-0.remove-cookie.js +1 -1
  109. package/extensions/ublocklite/rulesets/scripting/scriptlet/rus-0.set-attr.js +1 -1
  110. package/extensions/ublocklite/rulesets/scripting/scriptlet/rus-0.set-constant.js +2 -2
  111. package/extensions/ublocklite/rulesets/scripting/scriptlet/rus-1.prevent-fetch.js +10 -5
  112. package/extensions/ublocklite/rulesets/scripting/scriptlet/spa-1.prevent-fetch.js +10 -5
  113. package/extensions/ublocklite/rulesets/scripting/scriptlet/tur-0.addEventListener-defuser.js +2 -2
  114. package/extensions/ublocklite/rulesets/scripting/scriptlet/tur-0.prevent-fetch.js +10 -5
  115. package/extensions/ublocklite/rulesets/scripting/scriptlet/{fin-0.spoof-css.js → tur-0.remove-cookie.js} +69 -115
  116. package/extensions/ublocklite/rulesets/scripting/scriptlet/tur-0.set-constant.js +2 -2
  117. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-experimental.trusted-json-edit-fetch-request.js +941 -0
  118. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-experimental.trusted-json-edit-xhr-request.js +3 -3
  119. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-experimental.trusted-replace-node-text.js +1 -1
  120. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.abort-current-script.js +3 -3
  121. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.abort-on-property-read.js +1 -1
  122. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.abort-on-stack-trace.js +1 -1
  123. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.addEventListener-defuser.js +2 -2
  124. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.json-edit-fetch-response.js +2 -2
  125. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.json-edit-xhr-response.js +2 -2
  126. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.json-edit.js +2 -2
  127. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.json-prune-fetch-response.js +2 -2
  128. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.jsonl-edit-xhr-response.js +2 -2
  129. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.noeval-if.js +1 -1
  130. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.prevent-fetch.js +12 -7
  131. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.prevent-setInterval.js +3 -3
  132. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.prevent-setTimeout.js +3 -3
  133. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.prevent-window-open.js +2 -2
  134. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.prevent-xhr.js +1 -1
  135. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.remove-node-text.js +3 -3
  136. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.set-constant.js +3 -3
  137. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.set-cookie.js +2 -2
  138. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.set-local-storage-item.js +2 -2
  139. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.spoof-css.js +3 -3
  140. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.trusted-json-edit-fetch-request.js +941 -0
  141. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.trusted-json-edit-fetch-response.js +2 -2
  142. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.trusted-json-edit.js +2 -2
  143. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.trusted-prevent-fetch.js +10 -5
  144. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.trusted-replace-argument.js +2 -2
  145. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.trusted-replace-node-text.js +2 -2
  146. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.trusted-replace-outbound-text.js +2 -2
  147. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.trusted-set-attr.js +3 -3
  148. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.trusted-set-constant.js +2 -2
  149. package/extensions/ublocklite/rulesets/scripting/scriptlet/ublock-filters.trusted-suppress-native-method.js +2 -2
  150. package/extensions/ublocklite/rulesets/scripting/scriptlet/ubol-tests.jsonl-edit-fetch-response.js +2 -2
  151. package/extensions/ublocklite/rulesets/scripting/scriptlet/ubol-tests.jsonl-edit-xhr-response.js +2 -2
  152. package/extensions/ublocklite/rulesets/scripting/scriptlet/ukr-0.prevent-fetch.js +10 -5
  153. package/extensions/ublocklite/rulesets/scripting/scriptlet/vie-1.abort-current-script.js +2 -2
  154. package/extensions/ublocklite/rulesets/scripting/scriptlet/vie-1.abort-on-property-read.js +1 -1
  155. package/extensions/ublocklite/rulesets/scripting/scriptlet/vie-1.prevent-fetch.js +10 -5
  156. package/extensions/ublocklite/rulesets/scripting/scriptlet/vie-1.set-constant.js +2 -2
  157. package/extensions/ublocklite/rulesets/scripting/specific/adguard-mobile.js +3 -3
  158. package/extensions/ublocklite/rulesets/scripting/specific/annoyances-cookies.js +3 -3
  159. package/extensions/ublocklite/rulesets/scripting/specific/annoyances-notifications.js +3 -3
  160. package/extensions/ublocklite/rulesets/scripting/specific/annoyances-others.js +3 -3
  161. package/extensions/ublocklite/rulesets/scripting/specific/annoyances-overlays.js +3 -3
  162. package/extensions/ublocklite/rulesets/scripting/specific/annoyances-social.js +2 -2
  163. package/extensions/ublocklite/rulesets/scripting/specific/chn-0.js +3 -3
  164. package/extensions/ublocklite/rulesets/scripting/specific/deu-0.js +3 -3
  165. package/extensions/ublocklite/rulesets/scripting/specific/easylist.js +3 -3
  166. package/extensions/ublocklite/rulesets/scripting/specific/est-0.js +3 -3
  167. package/extensions/ublocklite/rulesets/scripting/specific/fin-0.js +3 -3
  168. package/extensions/ublocklite/rulesets/scripting/specific/fra-0.js +3 -3
  169. package/extensions/ublocklite/rulesets/scripting/specific/hrv-0.js +4 -4
  170. package/extensions/ublocklite/rulesets/scripting/specific/hun-0.js +3 -3
  171. package/extensions/ublocklite/rulesets/scripting/specific/idn-0.js +3 -3
  172. package/extensions/ublocklite/rulesets/scripting/specific/ind-0.js +3 -3
  173. package/extensions/ublocklite/rulesets/scripting/specific/ita-0.js +3 -3
  174. package/extensions/ublocklite/rulesets/scripting/specific/jpn-1.js +3 -3
  175. package/extensions/ublocklite/rulesets/scripting/specific/kor-1.js +3 -3
  176. package/extensions/ublocklite/rulesets/scripting/specific/nld-0.js +3 -3
  177. package/extensions/ublocklite/rulesets/scripting/specific/nor-0.js +3 -3
  178. package/extensions/ublocklite/rulesets/scripting/specific/pol-0.js +3 -3
  179. package/extensions/ublocklite/rulesets/scripting/specific/rou-1.js +3 -3
  180. package/extensions/ublocklite/rulesets/scripting/specific/rus-0.js +3 -3
  181. package/extensions/ublocklite/rulesets/scripting/specific/spa-0.js +3 -3
  182. package/extensions/ublocklite/rulesets/scripting/specific/spa-1.js +3 -3
  183. package/extensions/ublocklite/rulesets/scripting/specific/swe-1.js +3 -3
  184. package/extensions/ublocklite/rulesets/scripting/specific/tur-0.js +3 -3
  185. package/extensions/ublocklite/rulesets/scripting/specific/ublock-badware.js +3 -3
  186. package/extensions/ublocklite/rulesets/scripting/specific/ublock-filters.js +3 -3
  187. package/extensions/ublocklite/rulesets/scripting/specific/ukr-0.js +1 -1
  188. package/extensions/ublocklite/rulesets/scripting/specific/vie-1.js +3 -3
  189. package/extensions/ublocklite/rulesets/scriptlet-details.json +113 -60
  190. package/extensions/ublocklite/rulesets/strictblock/chn-0.json +117 -2
  191. package/extensions/ublocklite/rulesets/strictblock/dpollock-0.json +1 -0
  192. package/extensions/ublocklite/rulesets/strictblock/easylist.json +1 -1
  193. package/extensions/ublocklite/rulesets/strictblock/easyprivacy.json +7 -1
  194. package/extensions/ublocklite/rulesets/strictblock/hrv-0.json +8 -1
  195. package/extensions/ublocklite/rulesets/strictblock/jpn-1.json +134 -133
  196. package/extensions/ublocklite/rulesets/strictblock/nor-0.json +1 -1
  197. package/extensions/ublocklite/rulesets/strictblock/pgl.json +10 -3
  198. package/extensions/ublocklite/rulesets/strictblock/stevenblack-hosts.json +15646 -4853
  199. package/extensions/ublocklite/rulesets/strictblock/tur-0.json +1 -0
  200. package/extensions/ublocklite/rulesets/strictblock/ublock-badware.json +10 -10
  201. package/extensions/ublocklite/rulesets/strictblock/ublock-filters.json +3 -3
  202. package/extensions/ublocklite/rulesets/strictblock/ukr-0.json +1 -0
  203. package/extensions/ublocklite/rulesets/strictblock/urlhaus-full.json +1554 -196
  204. package/extensions/ublocklite/ublock.zip +0 -0
  205. package/package.json +1 -1
  206. package/src/browsers/index.ts +17 -8
  207. package/src/routes/management/http/kill.get.ts +2 -1
  208. package/src/shared/utils/function/handler.ts +2 -1
  209. package/src/utils.spec.ts +62 -0
  210. package/src/utils.ts +3 -0
  211. package/static/docs/swagger.json +2 -2
  212. package/static/docs/swagger.min.json +1 -1
  213. package/extensions/ublocklite/rulesets/scripting/procedural/ublock-experimental.js +0 -42
package/CHANGELOG.md CHANGED
@@ -1,4 +1,29 @@
1
- # [Latest](https://github.com/browserless/chrome/compare/v2.38.0...main)
1
+ # [Latest](https://github.com/browserless/chrome/compare/v2.38.2...main)
2
+
3
+ # [v2.38.2](https://github.com/browserless/browserless/compare/v2.38.1...v2.38.2)
4
+
5
+ - Standardizes on how path parsing works internally, exports the utility as well.
6
+ - Supports the following libraries and browsers:
7
+ - puppeteer-core: `24.26.1`
8
+ - playwright-core: `1.56.1`, `1.55.1`, `1.54.2`, `1.53.2`, and `1.52.0`.
9
+ - Chromium: `141.0.7390.37`
10
+ - Chrome: `141.0.7390.123` (amd64 only)
11
+ - Firefox: `142.0.1`
12
+ - Webkit: `26.0`
13
+ - Edge: `141.0.3537.99` (amd64 only)
14
+
15
+ # [v2.38.1](https://github.com/browserless/browserless/compare/v2.38.0...v2.38.1)
16
+
17
+ - Dependency updates.
18
+ - Bugfix when a trailing slash is present in /function API call.
19
+ - Supports the following libraries and browsers:
20
+ - puppeteer-core: `24.26.1`
21
+ - playwright-core: `1.56.1`, `1.55.1`, `1.54.2`, `1.53.2`, and `1.52.0`.
22
+ - Chromium: `141.0.7390.37`
23
+ - Chrome: `141.0.7390.123` (amd64 only)
24
+ - Firefox: `142.0.1`
25
+ - Webkit: `26.0`
26
+ - Edge: `141.0.3537.99` (amd64 only)
2
27
 
3
28
  # [v2.38.0](https://github.com/browserless/chrome/compare/v2.37.1...v2.38.0)
4
29
 
@@ -1,4 +1,4 @@
1
- import { BLESS_PAGE_IDENTIFIER, BadRequest, ChromeCDP, ChromePlaywright, ChromiumCDP, ChromiumPlaywright, EdgeCDP, EdgePlaywright, FirefoxPlaywright, Logger, NotFound, ServerError, WebKitPlaywright, availableBrowsers, convertIfBase64, exists, generateDataDir, makeExternalURL, noop, parseBooleanParam, parseStringParam, pwVersionRegex, } from '@browserless.io/browserless';
1
+ import { BLESS_PAGE_IDENTIFIER, BadRequest, ChromeCDP, ChromePlaywright, ChromiumCDP, ChromiumPlaywright, EdgeCDP, EdgePlaywright, FirefoxPlaywright, Logger, NotFound, ServerError, WebKitPlaywright, availableBrowsers, convertIfBase64, exists, generateDataDir, getFinalPathSegment, makeExternalURL, noop, parseBooleanParam, parseStringParam, pwVersionRegex, } from '@browserless.io/browserless';
2
2
  import { deleteAsync } from 'del';
3
3
  import micromatch from 'micromatch';
4
4
  import path from 'path';
@@ -299,7 +299,10 @@ export class BrowserManager {
299
299
  // Handle browser re-connects here
300
300
  if (this.reconnectionPatterns.some((p) => req.parsed.pathname.includes(p))) {
301
301
  const sessions = Array.from(this.browsers);
302
- const id = req.parsed.pathname.split('/').pop();
302
+ const id = getFinalPathSegment(req.parsed.pathname);
303
+ if (!id) {
304
+ throw new NotFound(`Couldn't locate browser ID from path "${req.parsed.pathname}"`);
305
+ }
303
306
  const found = sessions.find(([b]) => b.wsEndpoint()?.includes(id));
304
307
  if (found) {
305
308
  const [browser, session] = found;
@@ -311,8 +314,8 @@ export class BrowserManager {
311
314
  }
312
315
  // Handle page connections here
313
316
  if (req.parsed.pathname.includes('/devtools/page')) {
314
- const id = req.parsed.pathname.split('/').pop();
315
- if (!id.includes(BLESS_PAGE_IDENTIFIER)) {
317
+ const id = getFinalPathSegment(req.parsed.pathname);
318
+ if (!id?.includes(BLESS_PAGE_IDENTIFIER)) {
316
319
  const browsers = Array.from(this.browsers).map(([browser]) => browser);
317
320
  const allPages = await Promise.all(browsers
318
321
  .filter((b) => !!b.wsEndpoint())
@@ -358,7 +361,10 @@ export class BrowserManager {
358
361
  if (proxyServerParam) {
359
362
  const existingArgs = launchOptions.args || [];
360
363
  const filteredArgs = existingArgs.filter((arg) => !arg.includes('--proxy-server='));
361
- launchOptions.args = [...filteredArgs, `--proxy-server=${proxyServerParam}`];
364
+ launchOptions.args = [
365
+ ...filteredArgs,
366
+ `--proxy-server=${proxyServerParam}`,
367
+ ];
362
368
  }
363
369
  const manualUserDataDir = launchOptions.args
364
370
  ?.find((arg) => arg.includes('--user-data-dir='))
@@ -410,7 +416,7 @@ export class BrowserManager {
410
416
  });
411
417
  await this.hooks.browser({ browser, req });
412
418
  const session = {
413
- id: browser.wsEndpoint()?.split('/').pop(),
419
+ id: getFinalPathSegment(browser.wsEndpoint()),
414
420
  initialConnectURL: path.join(req.parsed.pathname, req.parsed.search) || '',
415
421
  isTempDataDir: !manualUserDataDir,
416
422
  launchOptions,
@@ -1,4 +1,4 @@
1
- import { APITags, BrowserlessRoutes, HTTPManagementRoutes, HTTPRoute, Methods, contentTypes, writeResponse, } from '@browserless.io/browserless';
1
+ import { APITags, BrowserlessRoutes, HTTPManagementRoutes, HTTPRoute, Methods, contentTypes, getFinalPathSegment, writeResponse, } from '@browserless.io/browserless';
2
2
  export default class KillGetRoute extends HTTPRoute {
3
3
  name = BrowserlessRoutes.KillGetRoute;
4
4
  accepts = [contentTypes.any];
@@ -11,7 +11,7 @@ export default class KillGetRoute extends HTTPRoute {
11
11
  path = HTTPManagementRoutes.kill;
12
12
  tags = [APITags.management];
13
13
  async handler(req, res) {
14
- const target = req.parsed.pathname.split('/')[2];
14
+ const target = getFinalPathSegment(req.parsed.pathname);
15
15
  const browserManager = this.browserManager();
16
16
  await browserManager.killSessions(target);
17
17
  return writeResponse(res, 204, '');
@@ -1,4 +1,4 @@
1
- import { BadRequest, HTTPRoutes, ServerError, contentTypes, convertIfBase64, exists, getTokenFromRequest, makeExternalURL, mimeTypes, } from '@browserless.io/browserless';
1
+ import { BadRequest, HTTPRoutes, ServerError, contentTypes, convertIfBase64, exists, getFinalPathSegment, getTokenFromRequest, makeExternalURL, mimeTypes, } from '@browserless.io/browserless';
2
2
  import fs from 'fs';
3
3
  import path from 'path';
4
4
  export default (config, logger, options = {}) => async (req, browser) => {
@@ -19,7 +19,7 @@ export default (config, logger, options = {}) => async (req, browser) => {
19
19
  if (!privateWSEndpoint) {
20
20
  throw new ServerError(`No browser endpoint was found, is the browser running?`);
21
21
  }
22
- const browserID = privateWSEndpoint.split('/').pop();
22
+ const browserID = getFinalPathSegment(privateWSEndpoint);
23
23
  const browserWSEndpoint = makeExternalURL(config.getExternalWebSocketAddress(), 'function', 'connect', browserID, '?token=' + getTokenFromRequest(req));
24
24
  const functionCodeJS = `browserless-function-${browserID}.js`;
25
25
  const page = (await browser.newPage());
package/build/utils.d.ts CHANGED
@@ -140,4 +140,5 @@ export declare const printLogo: (docsLink: string, debugURL?: string | boolean)
140
140
  export declare const getCDPClient: (page: Page) => CDPSession;
141
141
  export declare const ublockLitePath: string;
142
142
  export declare const isMatch: (text: string, pattern: string) => boolean;
143
+ export declare const getFinalPathSegment: (pathname: string) => string | undefined;
143
144
  export {};
package/build/utils.js CHANGED
@@ -654,3 +654,4 @@ export const ublockLitePath = path.join(__dirname, '..', 'extensions', 'ublockli
654
654
  export const isMatch = (text, pattern) => {
655
655
  return micromatch.isMatch(text, pattern, { bash: true });
656
656
  };
657
+ export const getFinalPathSegment = (pathname) => pathname.split(/[?#&]/)[0].split('/').filter(Boolean).pop();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ import { expect } from 'chai';
2
+ import { getFinalPathSegment } from '@browserless.io/browserless';
3
+ describe('Utils', () => {
4
+ describe('#getFinalPathSegment', () => {
5
+ it('returns the final path segment', () => {
6
+ expect(getFinalPathSegment('https://www.browserless.io/some/random/path/segment')).to.equal('segment');
7
+ });
8
+ it('returns the final path segment with trailing slashes', () => {
9
+ expect(getFinalPathSegment('https://www.browserless.io/some/random/path/segment/')).to.equal('segment');
10
+ });
11
+ it('returns the final path segment with URLs that have query params', () => {
12
+ expect(getFinalPathSegment('https://www.browserless.io/some/random/path/segment?foo=bar')).to.equal('segment');
13
+ });
14
+ it('returns the final path segment with URLs that have fragments', () => {
15
+ expect(getFinalPathSegment('https://www.browserless.io/some/random/path/segment#foo=bar')).to.equal('segment');
16
+ });
17
+ it('returns the final path segment with trailing slashes, query-params and fragments', () => {
18
+ expect(getFinalPathSegment('https://www.browserless.io/some/random/path/segment/?foo=bar&baz=qux#hello=world')).to.equal('segment');
19
+ });
20
+ it('returns the final path segment with trailing slashes, query-params and fragments on websockets', () => {
21
+ expect(getFinalPathSegment('wss://www.browserless.io/some/random/path/segment/?foo=bar&baz=qux#hello=world')).to.equal('segment');
22
+ });
23
+ it('returns the final path segment with malformed URLs', () => {
24
+ expect(getFinalPathSegment('wss://www.browserless.io/some/random/path/segment/&bad=query')).to.equal('segment');
25
+ });
26
+ });
27
+ });
@@ -264,15 +264,15 @@
264
264
  "description": "Short description for a checkbox in the options page"
265
265
  },
266
266
  "settingsBackupRestoreLabel": {
267
- "message": "Backup",
267
+ "message": "Рэзервовая копія",
268
268
  "description": "The header text for the back up/restore section"
269
269
  },
270
270
  "settingsBackupRestoreSummary": {
271
- "message": "Back up your custom settings to a file, or restore your custom settings from a file.",
271
+ "message": "Стварыць рэзервовую копію ўласных налад у файл або аднавіць уласныя налады з файла.",
272
272
  "description": "A summary description of the back up/restore section."
273
273
  },
274
274
  "settingsBackupRestoreLegend": {
275
- "message": "Restoring will overwrite all your current custom settings.",
275
+ "message": "Аднаўленне перазапіша ўсе вашыя бягучыя ўласныя налады.",
276
276
  "description": "Important information about the back up/restore section."
277
277
  },
278
278
  "findListsPlaceholder": {
@@ -376,11 +376,11 @@
376
376
  "description": "Text for buttons used to export content"
377
377
  },
378
378
  "backupButton": {
379
- "message": "Back up…",
379
+ "message": "Стварыць копію…",
380
380
  "description": "Text for buttons used to back up content"
381
381
  },
382
382
  "restoreButton": {
383
- "message": "Restore…",
383
+ "message": "Аднавіць…",
384
384
  "description": "Text for buttons used to restore content"
385
385
  },
386
386
  "dnrRulesWarning": {
@@ -20,7 +20,7 @@
20
20
  "description": "appears as tab name in dashboard"
21
21
  },
22
22
  "customFiltersPageName": {
23
- "message": "Custom filters",
23
+ "message": "Filter khusus",
24
24
  "description": "appears as tab name in dashboard"
25
25
  },
26
26
  "developPageName": {
@@ -88,11 +88,11 @@
88
88
  "description": "Header for a ruleset section in 'Filter lists pane'"
89
89
  },
90
90
  "customFiltersImportExportLabel": {
91
- "message": "Import / Export",
91
+ "message": "Impor / Ekspor",
92
92
  "description": "Text label heading the import/export area of custom filters"
93
93
  },
94
94
  "customFiltersImportTextareaPlaceholder": {
95
- "message": "Paste here specific cosmetic filters to add",
95
+ "message": "Tambahkan filter kosmetik dengan menempel di sini",
96
96
  "description": "Placeholder text which describes the purpose of the textarea widget"
97
97
  },
98
98
  "aboutChangelog": {
@@ -264,15 +264,15 @@
264
264
  "description": "Short description for a checkbox in the options page"
265
265
  },
266
266
  "settingsBackupRestoreLabel": {
267
- "message": "Backup",
267
+ "message": "Cadangan",
268
268
  "description": "The header text for the back up/restore section"
269
269
  },
270
270
  "settingsBackupRestoreSummary": {
271
- "message": "Back up your custom settings to a file, or restore your custom settings from a file.",
271
+ "message": "Cadangkan settingan khusus ke berkas, atau pulihkan settingan khusus dari berkas.",
272
272
  "description": "A summary description of the back up/restore section."
273
273
  },
274
274
  "settingsBackupRestoreLegend": {
275
- "message": "Restoring will overwrite all your current custom settings.",
275
+ "message": "Pemulihan akan menimpa semua settingan khusus saat ini.",
276
276
  "description": "Important information about the back up/restore section."
277
277
  },
278
278
  "findListsPlaceholder": {
@@ -364,7 +364,7 @@
364
364
  "description": "Text for buttons used to revert changes"
365
365
  },
366
366
  "addButton": {
367
- "message": "Add",
367
+ "message": "Tambah",
368
368
  "description": "Text for buttons used to add content"
369
369
  },
370
370
  "importAndAppendButton": {
@@ -376,11 +376,11 @@
376
376
  "description": "Text for buttons used to export content"
377
377
  },
378
378
  "backupButton": {
379
- "message": "Back up…",
379
+ "message": "Cadangkan…",
380
380
  "description": "Text for buttons used to back up content"
381
381
  },
382
382
  "restoreButton": {
383
- "message": "Restore…",
383
+ "message": "Pulihkan…",
384
384
  "description": "Text for buttons used to restore content"
385
385
  },
386
386
  "dnrRulesWarning": {
@@ -20,7 +20,7 @@
20
20
  "description": "appears as tab name in dashboard"
21
21
  },
22
22
  "customFiltersPageName": {
23
- "message": "Custom filters",
23
+ "message": "カスタムフィルター",
24
24
  "description": "appears as tab name in dashboard"
25
25
  },
26
26
  "developPageName": {
@@ -88,11 +88,11 @@
88
88
  "description": "Header for a ruleset section in 'Filter lists pane'"
89
89
  },
90
90
  "customFiltersImportExportLabel": {
91
- "message": "Import / Export",
91
+ "message": "インポート又はエクスポート",
92
92
  "description": "Text label heading the import/export area of custom filters"
93
93
  },
94
94
  "customFiltersImportTextareaPlaceholder": {
95
- "message": "Paste here specific cosmetic filters to add",
95
+ "message": "ここに追加したいコスメティックフィルターをペースト",
96
96
  "description": "Placeholder text which describes the purpose of the textarea widget"
97
97
  },
98
98
  "aboutChangelog": {
@@ -364,7 +364,7 @@
364
364
  "description": "Text for buttons used to revert changes"
365
365
  },
366
366
  "addButton": {
367
- "message": "Add",
367
+ "message": "追加",
368
368
  "description": "Text for buttons used to add content"
369
369
  },
370
370
  "importAndAppendButton": {
@@ -88,7 +88,7 @@
88
88
  "description": "Header for a ruleset section in 'Filter lists pane'"
89
89
  },
90
90
  "customFiltersImportExportLabel": {
91
- "message": "Importar / Exportar",
91
+ "message": "Importar/Exportar",
92
92
  "description": "Text label heading the import/export area of custom filters"
93
93
  },
94
94
  "customFiltersImportTextareaPlaceholder": {
@@ -20,7 +20,7 @@
20
20
  "description": "appears as tab name in dashboard"
21
21
  },
22
22
  "customFiltersPageName": {
23
- "message": "Custom filters",
23
+ "message": "กำหนดตัวกรอง",
24
24
  "description": "appears as tab name in dashboard"
25
25
  },
26
26
  "developPageName": {
@@ -88,7 +88,7 @@
88
88
  "description": "Header for a ruleset section in 'Filter lists pane'"
89
89
  },
90
90
  "customFiltersImportExportLabel": {
91
- "message": "Import / Export",
91
+ "message": "นำเข้า / ส่งออก",
92
92
  "description": "Text label heading the import/export area of custom filters"
93
93
  },
94
94
  "customFiltersImportTextareaPlaceholder": {
@@ -20,7 +20,7 @@
20
20
  "description": "appears as tab name in dashboard"
21
21
  },
22
22
  "customFiltersPageName": {
23
- "message": "Custom filters",
23
+ "message": "Користувацькі фільтри",
24
24
  "description": "appears as tab name in dashboard"
25
25
  },
26
26
  "developPageName": {
@@ -88,11 +88,11 @@
88
88
  "description": "Header for a ruleset section in 'Filter lists pane'"
89
89
  },
90
90
  "customFiltersImportExportLabel": {
91
- "message": "Import / Export",
91
+ "message": "Імпорт / Експорт",
92
92
  "description": "Text label heading the import/export area of custom filters"
93
93
  },
94
94
  "customFiltersImportTextareaPlaceholder": {
95
- "message": "Paste here specific cosmetic filters to add",
95
+ "message": "Вставте сюди конкретні косметичні фільтри, які потрібно додати",
96
96
  "description": "Placeholder text which describes the purpose of the textarea widget"
97
97
  },
98
98
  "aboutChangelog": {
@@ -264,15 +264,15 @@
264
264
  "description": "Short description for a checkbox in the options page"
265
265
  },
266
266
  "settingsBackupRestoreLabel": {
267
- "message": "Backup",
267
+ "message": "Резервне копіювання",
268
268
  "description": "The header text for the back up/restore section"
269
269
  },
270
270
  "settingsBackupRestoreSummary": {
271
- "message": "Back up your custom settings to a file, or restore your custom settings from a file.",
271
+ "message": "Створіть резервну копію власних налаштувань у файлі або відновіть власні налаштування з файлу.",
272
272
  "description": "A summary description of the back up/restore section."
273
273
  },
274
274
  "settingsBackupRestoreLegend": {
275
- "message": "Restoring will overwrite all your current custom settings.",
275
+ "message": "Відновлення призведе до перезапису всіх ваших поточних налаштувань.",
276
276
  "description": "Important information about the back up/restore section."
277
277
  },
278
278
  "findListsPlaceholder": {
@@ -364,7 +364,7 @@
364
364
  "description": "Text for buttons used to revert changes"
365
365
  },
366
366
  "addButton": {
367
- "message": "Add",
367
+ "message": "Додати",
368
368
  "description": "Text for buttons used to add content"
369
369
  },
370
370
  "importAndAppendButton": {
@@ -376,11 +376,11 @@
376
376
  "description": "Text for buttons used to export content"
377
377
  },
378
378
  "backupButton": {
379
- "message": "Back up…",
379
+ "message": "Створити…",
380
380
  "description": "Text for buttons used to back up content"
381
381
  },
382
382
  "restoreButton": {
383
- "message": "Restore…",
383
+ "message": "Відновити…",
384
384
  "description": "Text for buttons used to restore content"
385
385
  },
386
386
  "dnrRulesWarning": {
@@ -20,7 +20,7 @@
20
20
  "description": "appears as tab name in dashboard"
21
21
  },
22
22
  "customFiltersPageName": {
23
- "message": "Custom filters",
23
+ "message": "Bộ lọc tự tạo",
24
24
  "description": "appears as tab name in dashboard"
25
25
  },
26
26
  "developPageName": {
@@ -88,11 +88,11 @@
88
88
  "description": "Header for a ruleset section in 'Filter lists pane'"
89
89
  },
90
90
  "customFiltersImportExportLabel": {
91
- "message": "Import / Export",
91
+ "message": "Nhập / Xuất",
92
92
  "description": "Text label heading the import/export area of custom filters"
93
93
  },
94
94
  "customFiltersImportTextareaPlaceholder": {
95
- "message": "Paste here specific cosmetic filters to add",
95
+ "message": "Dán vào đây các bộ lọc cụ thể",
96
96
  "description": "Placeholder text which describes the purpose of the textarea widget"
97
97
  },
98
98
  "aboutChangelog": {
@@ -272,7 +272,7 @@
272
272
  "description": "A summary description of the back up/restore section."
273
273
  },
274
274
  "settingsBackupRestoreLegend": {
275
- "message": "Restoring will overwrite all your current custom settings.",
275
+ "message": "Khôi phục sẽ ghi đè lên những tùy chọn hiện tại của bạn.",
276
276
  "description": "Important information about the back up/restore section."
277
277
  },
278
278
  "findListsPlaceholder": {
@@ -364,7 +364,7 @@
364
364
  "description": "Text for buttons used to revert changes"
365
365
  },
366
366
  "addButton": {
367
- "message": "Add",
367
+ "message": "Thêm",
368
368
  "description": "Text for buttons used to add content"
369
369
  },
370
370
  "importAndAppendButton": {
@@ -4,7 +4,7 @@
4
4
  "description": "extension name."
5
5
  },
6
6
  "extShortDesc": {
7
- "message": "一个不需要权限的内容屏蔽工具。安装即可屏蔽广告、跟踪器、挖矿脚本等网页内容。",
7
+ "message": "一款高效的内容屏蔽工具。安装即可屏蔽广告、跟踪器、挖矿脚本等网页内容。",
8
8
  "description": "this will be in the Chrome web store: must be 132 characters or less"
9
9
  },
10
10
  "perRulesetStats": {
@@ -140,7 +140,7 @@
140
140
  "description": "A paragraph in the filter issue reporter section"
141
141
  },
142
142
  "supportFindSpecificButton": {
143
- "message": "找到相似报告",
143
+ "message": "在 GitHub 上寻找相似报告",
144
144
  "description": "A clickable link in the filter issue reporter section"
145
145
  },
146
146
  "supportS6URL": {
@@ -280,7 +280,7 @@
280
280
  "description": "Placeholder for the input field used to find lists"
281
281
  },
282
282
  "strictblockTitle": {
283
- "message": "被拦截的页面",
283
+ "message": "页面已被拦截",
284
284
  "description": "Webpage title for the strict-blocked page"
285
285
  },
286
286
  "strictblockSentence1": {
@@ -308,7 +308,7 @@
308
308
  "description": "A button to close the current tab"
309
309
  },
310
310
  "strictblockDontWarn": {
311
- "message": "不要再警告我有关此网站",
311
+ "message": "不再针对此网站作出警告",
312
312
  "description": "Label for checkbox in document-blocked page"
313
313
  },
314
314
  "strictblockProceed": {
@@ -320,19 +320,19 @@
320
320
  "description": "Tooltip for the button used to enter zapper mode"
321
321
  },
322
322
  "zapperTipQuit": {
323
- "message": "退出临时元素移除模式",
323
+ "message": "退出临时移除元素模式",
324
324
  "description": "Tooltip for the button used to exit zapper mode"
325
325
  },
326
326
  "pickerTipEnter": {
327
- "message": "创建自定义过滤器",
327
+ "message": "创建自定义过滤规则",
328
328
  "description": "Label for the menu entry to create cosmetic filters"
329
329
  },
330
330
  "unpickerTipEnter": {
331
- "message": "移除自定义过滤器",
331
+ "message": "移除自定义过滤规则",
332
332
  "description": "Label for the menu entry to delete cosmetic filters"
333
333
  },
334
334
  "developDropdownLabel": {
335
- "message": "视图:",
335
+ "message": "查看:",
336
336
  "description": "A label of a dropdown list"
337
337
  },
338
338
  "developOptionFilteringModeDetails": {
@@ -416,9 +416,9 @@ export class JSONPath {
416
416
  break;
417
417
  }
418
418
  if ( c === 0x5C /* \ */ && (end+1) < len ) {
419
- parts.push(query.slice(beg, end));
420
419
  const d = query.charCodeAt(end+1);
421
- if ( d === targetCharCode || d === 0x5C ) {
420
+ if ( d === targetCharCode ) {
421
+ parts.push(query.slice(beg, end));
422
422
  end += 1;
423
423
  beg = end;
424
424
  }
@@ -1371,7 +1371,9 @@ export class AstFilterParser {
1371
1371
  realBad = hasValue;
1372
1372
  if ( realBad ) { break; }
1373
1373
  requestTypeCount += 1;
1374
- unredirectableTypeCount += 1;
1374
+ if ( (flags & NODE_FLAG_IS_NEGATED) === 0 ) {
1375
+ unredirectableTypeCount += 1;
1376
+ }
1375
1377
  break;
1376
1378
  case NODE_TYPE_NET_OPTION_NAME_POPUNDER:
1377
1379
  case NODE_TYPE_NET_OPTION_NAME_POPUP:
@@ -118,7 +118,7 @@ export const matchesFromHostnames = hostnames => {
118
118
 
119
119
  export const hostnameFromMatch = origin => {
120
120
  if ( origin === '<all_urls>' || origin === '*://*/*' ) { return 'all-urls'; }
121
- const match = reOriginToHostname.exec(origin);
121
+ const match = /^\*:\/\/(?:\*\.)?([^/]+)\/\*/.exec(origin);
122
122
  if ( match === null ) { return ''; }
123
123
  return match[1];
124
124
  };
@@ -133,8 +133,6 @@ export const hostnamesFromMatches = origins => {
133
133
  return out;
134
134
  };
135
135
 
136
- const reOriginToHostname = /^\*:\/\/(?:\*\.)?([^/]+)\/\*/;
137
-
138
136
  /******************************************************************************/
139
137
 
140
138
  const broadcastMessage = message => {
@@ -325,7 +325,7 @@
325
325
  "storage": {
326
326
  "managed_schema": "managed_storage.json"
327
327
  },
328
- "version": "2025.1019.1656",
328
+ "version": "2025.1028.1744",
329
329
  "web_accessible_resources": [
330
330
  {
331
331
  "resources": [
@@ -689,6 +689,7 @@
689
689
  "okdebrid.com",
690
690
  "oko.sh",
691
691
  "omekon.blogspot.com",
692
+ "omuzaani.me",
692
693
  "onbatch.my.id",
693
694
  "ondemandkorea.com",
694
695
  "onemanhua.com",
@@ -897,6 +898,7 @@
897
898
  "startimez.com",
898
899
  "startseite.to",
899
900
  "starxinvestor.com",
901
+ "stateless.me",
900
902
  "stgeorgeutah.com",
901
903
  "stltoday.com",
902
904
  "stokerpiller.dk",