Skip to content

Commit

Permalink
fixes merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mneunomne committed Jan 1, 2024
1 parent e912577 commit 6fd0ff8
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<script src="js/vapi.js"></script>
<script src="js/vapi-common.js"></script>
<script src="js/vapi-client.js"></script>
<script src="js/vapi-client-extra.js"></script> <!-- Adn needs vAPI broadcastListener-->
<script src="js/theme.js" type="module"></script>
<script src="js/i18n.js" type="module"></script>
<script src="js/dashboard-common.js" type="module"></script>
Expand Down
1 change: 0 additions & 1 deletion src/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
<script src="js/vapi.js"></script>
<script src="js/vapi-common.js"></script>
<script src="js/vapi-client.js"></script>
<script src="js/vapi-client-extra.js"></script> <!-- Adn needs vAPI broadcastListener-->
<script src="js/theme.js" type="module"></script>
<script src="js/i18n.js" type="module"></script>
<script src="js/dashboard.js" type="module"></script>
Expand Down
2 changes: 1 addition & 1 deletion src/js/adn/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import µb from '../background.js';
import staticFilteringReverseLookup from '../reverselookup.js';
import staticNetFilteringEngine from '../static-net-filtering.js'
import { broadcast, filteringBehaviorChanged, onBroadcast } from '../broadcast.js';
import { broadcast } from '../broadcast.js';

import dnt from './dnt.js'

Expand Down
3 changes: 2 additions & 1 deletion src/js/adn/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { renderNotifications, ReloadTab, addNotification } from './notifications
import { setCost, targetDomain, decodeEntities, isNonLatin, isCyrillic } from './adn-utils.js';
import { dom } from '../dom.js';
import uDom from './uDom.js';
import { broadcast, onBroadcast } from '../broadcast.js';

(function () {

Expand All @@ -54,7 +55,7 @@ import uDom from './uDom.js';
}
}, 10)

vAPI.broadcastListener.add(request => {
onBroadcast(request => {

switch (request.what) {

Expand Down
3 changes: 2 additions & 1 deletion src/js/adn/vault.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import { i18n$ } from "../i18n.js";
import uDom from './uDom.js';
import { renderNotifications } from './notifications.js';
import { broadcast, onBroadcast } from '../broadcast.js';

import {
byField,
Expand Down Expand Up @@ -79,7 +80,7 @@ var transitionTimeout = null
let gAds, gAdSets, gMin, gMax, gSliderRight, gSliderLeft, settings;
let lastAdDetectedTime, waitingAds = []; // stateful

vAPI.broadcastListener.add(request => {
onBroadcast(request => {
//console.log("GOT BROADCAST", request);
switch (request.what) {
case 'adAttempt':
Expand Down
4 changes: 2 additions & 2 deletions src/js/broadcast.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ let broadcastChannel;

export function broadcast(message) {
if ( broadcastChannel === undefined ) {
broadcastChannel = new self.BroadcastChannel('ADN'); // AdNauseam change (uBO -> ADN)
broadcastChannel = new self.BroadcastChannel('uBO'); // AdNauseam change (uBO -> ADN)
}
broadcastChannel.postMessage(message);
}
Expand All @@ -54,7 +54,7 @@ export async function broadcastToAll(message) {
/******************************************************************************/

export function onBroadcast(listener) {
const bc = new self.BroadcastChannel('ADN'); // AdNauseam change (uBO -> ADN)
const bc = new self.BroadcastChannel('uBO'); // AdNauseam change (uBO -> ADN)
bc.onmessage = ev => listener(ev.data || {});
return bc;
}
Expand Down
3 changes: 2 additions & 1 deletion src/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import { renderNotifications } from './adn/notifications.js'
import { dom, qs$ } from './dom.js';
import { onBroadcast } from './broadcast.js';

/******************************************************************************/

Expand Down Expand Up @@ -114,7 +115,7 @@ if ( self.location.hash.slice(1) === 'no-dashboard.html' ) {
}

/// ADN notification to appear on dashboard
vAPI.broadcastListener.add(request => {
onBroadcast(request => {
switch (request.what) {
case 'notifications':
renderNotifications(request.notifications, "dashboard");
Expand Down

0 comments on commit 6fd0ff8

Please sign in to comment.