MCPcopy
hub / github.com/Max-Eee/NeoPass / removeExistingToast

Function removeExistingToast

worker.js:1911–1940  ·  view source on GitHub ↗
(tabId)

Source from the content-addressed store, hash-verified

1909
1910// Function to remove any existing toast
1911function removeExistingToast(tabId) {
1912 chrome.scripting.executeScript({
1913 target: { tabId: tabId },
1914 func: function() {
1915 // Remove all possible toast types
1916 const toastSelectors = [
1917 '#neopass-active-toast',
1918 '#stealth-mode-toast',
1919 '.neopass-update-toast',
1920 '[id*="toast"]',
1921 '[class*="toast"]'
1922 ];
1923
1924 toastSelectors.forEach(selector => {
1925 const existingToasts = document.querySelectorAll(selector);
1926 existingToasts.forEach(toast => {
1927 if (toast && toast.parentNode) {
1928 toast.style.opacity = '0';
1929 toast.style.transform = 'translateY(10px) translateX(-50%)';
1930 setTimeout(() => {
1931 if (toast.parentNode) {
1932 toast.remove();
1933 }
1934 }, 100);
1935 }
1936 });
1937 });
1938 }
1939 });
1940}
1941
1942// Function to toggle and store toast opacity level
1943async function toggleToastOpacity() {

Callers 7

showUpdateToastFunction · 0.85
showOpacityLevelToastFunction · 0.85
showToastFunction · 0.85
showStealthToastFunction · 0.85
showMCQToastFunction · 0.85
showNPTELToastFunction · 0.85
showSpinnerToastFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected