ruddhboy
ruddhboy
PD🧩 Plasmo Developers
Created by ruddhboy on 9/2/2024 in #👟framework
getInlineAnchor being invoked repeatedly, even after CSUI is rendered
is it normal for getInlineAnchor to be invoked repeatedly by the Plasmo framework, even after the anchor is found to exist and the CSUI renders? I have a very basic extension, where I just want to add a button next to the <body> element of the page. I have the following snippet
export const getInlineAnchor: PlasmoGetInlineAnchor = async () => {
console.log('getInlineAnchor');
return document.body;
};

const MyComponent = () => {
return <div>Hello World</div>;
};

export const config: PlasmoCSConfig = {
matches: ['https://www.linkedin.com/sales/search/people*'],
};

export const getShadowHostId = () => "plasmo-inline-example-unique-id"

export default MyComponent;
export const getInlineAnchor: PlasmoGetInlineAnchor = async () => {
console.log('getInlineAnchor');
return document.body;
};

const MyComponent = () => {
return <div>Hello World</div>;
};

export const config: PlasmoCSConfig = {
matches: ['https://www.linkedin.com/sales/search/people*'],
};

export const getShadowHostId = () => "plasmo-inline-example-unique-id"

export default MyComponent;
and despite my button rendering, I notice that getInlineAnchor is still printed out in console.
4 replies