@burnout426
Thank for confirm it. We are back to version 99.0.4788.88.
Latest posts made by kophaiem79
-
RE: Opera notification not workingGeneral
-
RE: Opera notification not workingGeneral
@burnout426
File: background.js
chrome.runtime.onMessage.addListener(data =>{
let m='notifier_id';
chrome.notifications.create(m, {title:'Demo title',message:'This is demo',iconUrl: 'icon128.png',type:'basic',requireInteraction:true,buttons: [{ title: 'Open' },{ title: 'Close' }]});
chrome.notifications.onButtonClicked.addListener(function(m,btnIdx){
if (btnIdx === 0)
{
console.log('Open new tab');
chrome.tabs.create({ url: 'https://google.com' });
chrome.notifications.clear(m);
return false;} else if (btnIdx === 1){ chrome.notifications.clear(m); } });
})
Save icon (name:icon128.png) in same folder. -
RE: Opera notification not workingGeneral
File 1: notifier.js
let url=window.location.href; if(url.indexOf('example.com')>-1){ document.addEventListener('click',()=>{ chrome.runtime.sendMessage(chrome.runtime.id,{data:'test'}); }) }
File 2:
chrome.runtime.onMessage.addListener(data =>{ let m='notifier_id'; chrome.notifications.create(m, {title:'Demo title',message:'This is demo',type:'basic',requireInteraction:true,buttons: [{ title: 'Open' },{ title: 'Close' }]}); chrome.notifications.onButtonClicked.addListener(function(m,btnIdx){ if (btnIdx === 0) { console.log('Open new tab'); chrome.tabs.create({ url: 'https://google.com' }); chrome.notifications.clear(m); return false; } else if (btnIdx === 1){ chrome.notifications.clear(m); } }); })
File 3:
{ "name": "Notifier Demo", "version": "1.0.0.0", "manifest_version": 3, "description": "Notifier Demo", "content_scripts": [ { "matches": ["https://www.example.com/"], "js": ["notifier.js"], "all_frames":true } ], "permissions": [ "notifications","tabs" ], "background":{"service_worker":"background.js"} }
How it work: go to https://www.example.com/, click anywhere will create a notifier. Click Open will open new tab google.com. Work on Edge, Chrome and old Opera browser. Not in my current version.
-
Opera notification not workingGeneral
Opera 116.0.5366.71
Windows 10 22H2 (0s build 19045.5371) Enterprise
My extension can push notification to windows but when user click button it not working (older version Opera 99 and other browser like newest Chrome still work!). Seem chrome.notifications.onButtonClicked.addListener not working. i want to know if it was bug or find a way to stop using native notification only browser notification.