summaryrefslogtreecommitdiffstats
path: root/browser/components/asrouter/content-src/asrouter-utils.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /browser/components/asrouter/content-src/asrouter-utils.js
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz
firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/asrouter/content-src/asrouter-utils.js')
-rw-r--r--browser/components/asrouter/content-src/asrouter-utils.js79
1 files changed, 0 insertions, 79 deletions
diff --git a/browser/components/asrouter/content-src/asrouter-utils.js b/browser/components/asrouter/content-src/asrouter-utils.js
deleted file mode 100644
index 65d25cb907..0000000000
--- a/browser/components/asrouter/content-src/asrouter-utils.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-import { MESSAGE_TYPE_HASH as msg } from "modules/ActorConstants.sys.mjs";
-import { actionCreators as ac } from "common/Actions.sys.mjs";
-
-export const ASRouterUtils = {
- addListener(listener) {
- if (global.ASRouterAddParentListener) {
- global.ASRouterAddParentListener(listener);
- }
- },
- removeListener(listener) {
- if (global.ASRouterRemoveParentListener) {
- global.ASRouterRemoveParentListener(listener);
- }
- },
- sendMessage(action) {
- if (global.ASRouterMessage) {
- return global.ASRouterMessage(action);
- }
- throw new Error(`Unexpected call:\n${JSON.stringify(action, null, 3)}`);
- },
- blockById(id, options) {
- return ASRouterUtils.sendMessage({
- type: msg.BLOCK_MESSAGE_BY_ID,
- data: { id, ...options },
- });
- },
- modifyMessageJson(content) {
- return ASRouterUtils.sendMessage({
- type: msg.MODIFY_MESSAGE_JSON,
- data: { content },
- });
- },
- executeAction(button_action) {
- return ASRouterUtils.sendMessage({
- type: msg.USER_ACTION,
- data: button_action,
- });
- },
- unblockById(id) {
- return ASRouterUtils.sendMessage({
- type: msg.UNBLOCK_MESSAGE_BY_ID,
- data: { id },
- });
- },
- blockBundle(bundle) {
- return ASRouterUtils.sendMessage({
- type: msg.BLOCK_BUNDLE,
- data: { bundle },
- });
- },
- unblockBundle(bundle) {
- return ASRouterUtils.sendMessage({
- type: msg.UNBLOCK_BUNDLE,
- data: { bundle },
- });
- },
- overrideMessage(id) {
- return ASRouterUtils.sendMessage({
- type: msg.OVERRIDE_MESSAGE,
- data: { id },
- });
- },
- editState(key, value) {
- return ASRouterUtils.sendMessage({
- type: msg.EDIT_STATE,
- data: { [key]: value },
- });
- },
- sendTelemetry(ping) {
- return ASRouterUtils.sendMessage(ac.ASRouterUserEvent(ping));
- },
- getPreviewEndpoint() {
- return null;
- },
-};