!bvqkHNJoPXSDWubkQz:matrix.org

Gavin's Help

335 Members
Join my space Gavin's Chat https://matrix.to/#/#gavinfreeborn:matrix.org6 Servers

Load older messages


SenderMessageTime
30 May 2023
@_discord_992086463393050686:t2bot.iothehouseoffreacks ooooohhh 03:55:38
@_discord_992086463393050686:t2bot.iothehouseoffreacks so then in one file I put a function 03:55:43
@_discord_780550926964228136:t2bot.ioDoctorCringe
    browser.runtime.onMessage.addListener((message, sender) => {

        const tabId = sender.tab.id;
        const subject = message.subject;
        const action = message.action;

        console.debug("Tab: " + tabId + " - Received Message: '" + JSON.stringify(message) + "'");

        if (subject === "NetworkRequests") {
            if (action === "block" && unblockedTabs.includes(tabId))
                unblockedTabs.splice(unblockedTabs.indexOf(tabId), 1);
            else if (action === "unblock" && !unblockedTabs.includes(tabId))
                unblockedTabs.push(tabId);
        }

    });
03:55:45
@_discord_992086463393050686:t2bot.iothehouseoffreacks and then another i put the listner 03:55:46
@_discord_780550926964228136:t2bot.ioDoctorCringe like i have a listener in a background script like this 03:55:55
@_discord_780550926964228136:t2bot.ioDoctorCringe so the background script can block certain network requests until the content script says "ok, allow things through" 03:56:28
@_discord_780550926964228136:t2bot.ioDoctorCringe they talk back and forth through browser.runtime.onMessage 03:56:44
@_discord_780550926964228136:t2bot.ioDoctorCringe and browser.runtime.sendMessage 03:57:12
@_discord_992086463393050686:t2bot.iothehouseoffreacks I will try to setup a git repo and put all the files I have there 03:57:32
@_discord_780550926964228136:t2bot.ioDoctorCringe its basically so the browser wide script can communicate with the tab specific scripts 03:57:39
@_discord_992086463393050686:t2bot.iothehouseoffreacks wholly molly 03:57:51
@_discord_780550926964228136:t2bot.ioDoctorCringe yeah its kind of different than typical website javascript until you get used to it 03:58:13
@_discord_780550926964228136:t2bot.ioDoctorCringe but you realize its very necessary that it works this way once you see how extensions work 03:58:46
@_discord_780550926964228136:t2bot.ioDoctorCringe i recommend you clone the example extension repo and look at the code in whatever editor you use 03:59:07
@_discord_780550926964228136:t2bot.ioDoctorCringe its good to look at that code 03:59:13
@_discord_780550926964228136:t2bot.ioDoctorCringe helpful 03:59:15
@_discord_992086463393050686:t2bot.iothehouseoffreacks allright 03:59:30
@_discord_780550926964228136:t2bot.ioDoctorCringe its a lot of information to take in all at once because the flow is so different from website javascript files 03:59:46
@_discord_992086463393050686:t2bot.iothehouseoffreacks but most of their examples do something different than what I want to do 03:59:48
@_discord_992086463393050686:t2bot.iothehouseoffreacks getting used to website javascript files was hard enouph 04:00:02
@_discord_992086463393050686:t2bot.iothehouseoffreacks (at least for me) 04:00:11
@_discord_780550926964228136:t2bot.ioDoctorCringe i honestly dont remember its been so many years now lol 04:00:20
@_discord_780550926964228136:t2bot.ioDoctorCringe it was so long ago 04:00:24
@_discord_780550926964228136:t2bot.ioDoctorCringe and javascript was so different back then 04:00:36
@_discord_780550926964228136:t2bot.ioDoctorCringe honestly none of the example extensions are going to do what anyone wants to do they just demonstrate various techniques you need to use 04:01:12
@_discord_992086463393050686:t2bot.iothehouseoffreacks https://codeberg.org/zortazert/github-pages 04:02:51
31 May 2023
@_discord_689068124154494978:t2bot.ioDeathStroke19891 joined the room.05:07:56
1 Jun 2023
@_discord_1075341725251403779:t2bot.ioWatanabe joined the room.01:18:58
@_discord_394747892205617153:t2bot.ioWatanabe joined the room.01:19:25
@_discord_1084910931139624970:t2bot.ioColemak joined the room.05:22:07

There are no newer messages yet.


Back to Room ListRoom Version: 6