Updating X.com (twitter) DOM with google extensions

Skip to first unread message

José Machacaz

Jun 24, 2024, 7:36:30 AMJun 24
to Chromium Extensions
I'm working on a small google chrome extension to my own use when i intend to intereact with  some parts of the dom on twitter (X). 

I'm using pure JS for this. 

reading documentation i came with this 

 chrome.tabs.onUpdated.addListener(async (tabID,tabStatus) => {
   if(tabStatus.status === "complete")// && loaded == false)
     console.log("tabStatus.status: " + tabStatus.status);
     console.log("tabStatus.loaded: " + loaded);

     let tabProps = await getTabProperties(tabID);
       loaded = true;

         injectImmediately: false,
         target : {tabId : tabID},
         args: [1],
         func : injectedFunction,

Please note the tab status check - in documentation states that two states (loading and complete). 

on my js function : 
async function injectedFunction(a) {
  console.log("count after delay: " + document.querySelectorAll(`[role="tab"]`).length);

this always return undenied. 
am i doing something wrong here ? 
Reply all
Reply to author
0 new messages