@lvce-editor/main-process 6.33.0 → 6.33.1

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.
@@ -6561,6 +6561,16 @@ const cancelIfStartsWith = (url, canceledUrls) => {
6561
6561
  }
6562
6562
  return {};
6563
6563
  };
6564
+ const canceledAdUrls = ['https://c.amazon-adsystem.com/', 'https://cadmus.script.ac/', 'https://config.aps.amazon-adsystem.com/', 'https://dn0qt3r0xannq.cloudfront.net/', 'https://edge.aditude.io/', 'https://ep1.adtrafficquality.google/', 'https://event-ingestor.judy.pnap.aditude.cloud/', 'https://pagead2.googlesyndication.com/', 'https://raven-static.aditude.io/', 'https://securepubads.g.doubleclick.net/'];
6565
+ const safeframeUrlRegex = /^https:\/\/[^/]+\.safeframe\.googlesyndication\.com\//;
6566
+ const getBeforeRequestResponseAd = url => {
6567
+ if (safeframeUrlRegex.test(url)) {
6568
+ return {
6569
+ cancel: true
6570
+ };
6571
+ }
6572
+ return cancelIfStartsWith(url, canceledAdUrls);
6573
+ };
6564
6574
  const getBeforeRequestResponseXhrPost = url => {
6565
6575
  const canceledUrls = ['https://www.youtube.com/api/stats/qoe', 'https://www.youtube.com/youtubei/v1/log_event', 'https://play.google.com/log'];
6566
6576
  return cancelIfStartsWith(url, canceledUrls);
@@ -6604,6 +6614,10 @@ const getBeforeRequestResponse = details => {
6604
6614
  resourceType,
6605
6615
  url
6606
6616
  } = details;
6617
+ const adResponse = getBeforeRequestResponseAd(url);
6618
+ if (adResponse.cancel) {
6619
+ return adResponse;
6620
+ }
6607
6621
  switch (resourceType) {
6608
6622
  case MainFrame:
6609
6623
  return getBeforeRequestResponseMainFrame();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/main-process",
3
- "version": "6.33.0",
3
+ "version": "6.33.1",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "electron"