From 2a7d08ca153ed156a3c8a38752c97324a4ec55be Mon Sep 17 00:00:00 2001 From: marcosholgado Date: Fri, 7 Apr 2023 11:17:57 +0000 Subject: [PATCH] Release build 4.10.1 [ci release] --- build/android/contentScope.js | 61 ++--------------------------------- inject/android.js | 52 ++--------------------------- 2 files changed, 5 insertions(+), 108 deletions(-) diff --git a/build/android/contentScope.js b/build/android/contentScope.js index 1e37a2401..b21877f10 100644 --- a/build/android/contentScope.js +++ b/build/android/contentScope.js @@ -610,17 +610,6 @@ } } - async function update$1 (args) { - if (!shouldRun()) { - return - } - if (initArgs === null) { - updates.push(args); - return - } - updateFeaturesInner(args); - } - function alwaysInitExtensionFeatures (args, featureName) { return args.platform.name === 'extension' && alwaysInitFeatures.has(featureName) } @@ -639,15 +628,6 @@ * @category Content Scope Scripts Integrations */ - const allowedMessages = [ - 'getClickToLoadState', - 'getYouTubeVideoDetails', - 'openShareFeedbackPage', - 'setYoutubePreviewsEnabled', - 'unblockClickToLoadContent', - 'updateYouTubeCTLAddedFlag' - ]; - function initCode () { // @ts-expect-error https://app.asana.com/0/1201614831475344/1203979574128023/f const processedConfig = processConfig($CONTENT_SCOPE$, $USER_UNPROTECTED_DOMAINS$, $USER_PREFERENCES$); @@ -659,47 +639,10 @@ platform: processedConfig.platform }); - const messageSecret = processedConfig.messageSecret; - // Receives messages from the platform - const messageCallback = processedConfig.messageCallback; - // Sends messages to the platform - const messageInterface = processedConfig.messageInterface; - - const wrappedUpdate = ((providedSecret, ...args) => { - if (providedSecret === messageSecret) { - update$1(...args); - } - }).bind(); - - Object.defineProperty(window, messageCallback, { - value: wrappedUpdate - }); - - // @ts-ignore - const sendMessageToAndroid = window[messageInterface].process.bind(window[messageInterface]); - delete window[messageInterface]; - init$1(processedConfig); - window.addEventListener('sendMessageProxy' + messageSecret, event => { - event.stopImmediatePropagation(); - - if (!(event instanceof CustomEvent) || !event?.detail) { - return console.warn('no details in sendMessage proxy', event) - } - - const messageType = event.detail?.messageType; - if (!allowedMessages.includes(messageType)) { - return console.warn('Ignoring invalid sendMessage messageType', messageType) - } - - const message = { - type: messageType, - options: event.detail?.options - }; - const stringifiedArgs = JSON.stringify(message); - sendMessageToAndroid(stringifiedArgs, messageSecret); - }); + // Not supported: + // update(message) } initCode(); diff --git a/inject/android.js b/inject/android.js index c9e725d4a..74c0b19bd 100644 --- a/inject/android.js +++ b/inject/android.js @@ -2,18 +2,9 @@ * @module Android integration * @category Content Scope Scripts Integrations */ -import { load, init, update } from '../src/content-scope-features.js' +import { load, init } from '../src/content-scope-features.js' import { processConfig, isGloballyDisabled } from './../src/utils' -const allowedMessages = [ - 'getClickToLoadState', - 'getYouTubeVideoDetails', - 'openShareFeedbackPage', - 'setYoutubePreviewsEnabled', - 'unblockClickToLoadContent', - 'updateYouTubeCTLAddedFlag' -] - function initCode () { // @ts-expect-error https://app.asana.com/0/1201614831475344/1203979574128023/f const processedConfig = processConfig($CONTENT_SCOPE$, $USER_UNPROTECTED_DOMAINS$, $USER_PREFERENCES$) @@ -25,47 +16,10 @@ function initCode () { platform: processedConfig.platform }) - const messageSecret = processedConfig.messageSecret - // Receives messages from the platform - const messageCallback = processedConfig.messageCallback - // Sends messages to the platform - const messageInterface = processedConfig.messageInterface - - const wrappedUpdate = ((providedSecret, ...args) => { - if (providedSecret === messageSecret) { - update(...args) - } - }).bind() - - Object.defineProperty(window, messageCallback, { - value: wrappedUpdate - }) - - // @ts-ignore - const sendMessageToAndroid = window[messageInterface].process.bind(window[messageInterface]) - delete window[messageInterface] - init(processedConfig) - window.addEventListener('sendMessageProxy' + messageSecret, event => { - event.stopImmediatePropagation() - - if (!(event instanceof CustomEvent) || !event?.detail) { - return console.warn('no details in sendMessage proxy', event) - } - - const messageType = event.detail?.messageType - if (!allowedMessages.includes(messageType)) { - return console.warn('Ignoring invalid sendMessage messageType', messageType) - } - - const message = { - type: messageType, - options: event.detail?.options - } - const stringifiedArgs = JSON.stringify(message) - sendMessageToAndroid(stringifiedArgs, messageSecret) - }) + // Not supported: + // update(message) } initCode()