diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 8501fdf..306f17f 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -58,7 +58,10 @@ const NOTIFICATION_BRIDGE: &str = r#"(function(){ TauriNotification.prototype=Object.create(EventTarget.prototype); TauriNotification.prototype.constructor=TauriNotification; TauriNotification.prototype.close=function(){}; - Object.defineProperty(TauriNotification,'permission',{get:function(){return 'granted';},configurable:true}); + // get-only 'permission' threw "Cannot set property permission ... which has + // only a getter" when the notification plugin / a polyfill assigned it. Add a + // no-op setter so the value stays 'granted' but assignment can't crash. + Object.defineProperty(TauriNotification,'permission',{get:function(){return 'granted';},set:function(){},configurable:true}); TauriNotification.requestPermission=function(){return Promise.resolve('granted');}; TauriNotification.maxActions=0; Object.defineProperty(window,'Notification',{value:TauriNotification,writable:true,configurable:true});