-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RPC keeps showing even after I switch/close tab #240
Comments
This is a known bug. The following may help:
|
I didn't actually try to reinstall it so I'm going to try that, but for the antivirus part I only use Windows Defender and it didn't recognize PreMiD or any of its connections as suspicious afaict so, I'll just try reinstalling it, if the issue presists, I'll let you know, thanks for the resppnse. |
Awesome. For this sort of issue, it is best if you raise your issue in our Support Discord server. discord.gg/premid |
Sure, so I keep this issue open? Then when I try the reinstall I go to the Discord? Right? |
Moving this to the Extension repo as it's a Extension bug but also Application bug could cause this. Should be fixed with v2.5 |
I don't know if something like that would work for Chrome, using the "active" and the "lastFocusedWindow" bools alongside each other to determine whether the tab is focused or not, there's already an implementation for this in tabPriority.ts async function but I'm not experienced enough with JS/TS to know why it's not working properly. function checkTabFocusState(tabId, callback) {
chrome.tabs.query({ active: true, lastFocusedWindow: true }, function(tabs) {
if (tabs.length > 0) {
const currentTab = tabs[0];
const isFocused = (currentTab.id === tabId);
callback(isFocused);
} else {
callback(false);
}
});
} And then use some event listeners to implement the above function: chrome.tabs.onActivated.addListener(function(activeInfo) {
checkTabFocusState(activeInfo.tabId, function(isFocused) {
if (isFocused) {
console.log(`Tab ${activeInfo.tabId} is now focused.`);
}
});
});
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
if (changeInfo.status === 'complete') {
checkTabFocusState(tabId, function(isFocused) {
if (isFocused) {
console.log(`Tab ${tabId} is now focused.`);
}
});
}
}); The "chrome.windows.onFocusChanged" can be used as well to detect if Chrome is even focused by the system in the first place, maybe the tab is focused but chrome is minimized, and if it's minimized the presence can still be show if a site is playing media which can be detected using the "audible" bool property for the tab object that is equivalent to the speaker icon appearing on the tab (as described in the docs) An alternative would be using the visibilitychange API but I don't actually think that would work properly across all browsers as it's not exactly designed for tab changes, I just thought I'd throw it here if it sparks something. |
Hey, @Timeraa thanks for the transfer (just noticed your comment a year+ later 💀, srry), I'm running 2.6, I have a new device now running Win11, I'm having the same exact issue as well as some other people who opened issues in the wrong repo again (idk who'd do such thing that's very weird). |
It should be a lot better now but we're working hard on it all |
I use only 2 presences, AniMixPlay and Twitch, both of them keep sticking to my Discord profile even after I switch tabs or even close them, it eventually closes (sometimes doesn't at all) but it's so random, sometimes it closes after a couple of minutes, some times an hour, sometimes even more
What it's supposed to do: Remove the presence from profile as soon as I switch/close the tab with the presence, or add an option for every presence (or all presences if adding the setting for everyone would be a pain) to toggle the sticky presence thing, whether it should keep the presence even when you switch tabs or not, and for closing tabs I don't think it should keep the presence at all, that's clearly a bug, and I don't know if someone else is having it.
Version: PreMiD v2.2.0 | Ext v2.2.3
OS: Windows 10 64-Bit Version 21H1
Browser: Google Chrome Version 104.0.5112.81 (Official Build) (64-bit)
The text was updated successfully, but these errors were encountered: