My Requirement - If I am opening multiple localhost tabs with the same url and if I am clicking on a button inside any tab, I want all the tabs to refresh.
Here I have a add button (for a simple add function), so while clicking it I want the additon to happen also want all the tabs to refresh. (I have not included the c# code for addition)
My source code:-
<script type="text/javascript">
function Refresh()
{
chrome.tabs.query({windowType:'normal'}, function(tabs) {
for(var i = 0; i < tabs.length; i++) {
chrome.tabs.update(tabs[i].id, {url: tabs[i].url});
}
});
return false;
}
</script>
<asp:Button ID="Button1" runat="server" onClick="Button1_Click" OnClientClick= "Refresh()" Text="Add" />
What I am getting is: Cannot read properties of undefined(reading 'query') at Refresh, at HTMLInputElement.onClick
The add function works fine but the refresh is not happening.