MCPcopy
hub / github.com/darkreader/darkreader / makeChromiumHappy

Function makeChromiumHappy

src/background/make-chromium-happy.ts:11–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9// closed conduit. It just sends a dummy message in response to incomming message
10// to utilise open conduit. This response message is not even used on the other side.
11export function makeChromiumHappy(): void {
12 if (!__CHROMIUM_MV2__) {
13 return;
14 }
15 chrome.runtime.onMessage.addListener((message: MessageUItoBG | MessageCStoBG, sender, sendResponse) => {
16 if (![
17 // Messenger
18 MessageTypeUItoBG.GET_DATA,
19 MessageTypeUItoBG.GET_DEVTOOLS_DATA,
20 MessageTypeUItoBG.APPLY_DEV_FIXES,
21 ].includes(message.type as MessageTypeUItoBG) &&
22 (message.type !== MessageTypeCStoBG.DOCUMENT_CONNECT || !isPanel(sender))) {
23 sendResponse({type: '¯\\_(ツ)_/¯'});
24 }
25 });
26}

Callers 1

index.tsFile · 0.90

Calls 2

isPanelFunction · 0.90
addListenerMethod · 0.45

Tested by

no test coverage detected