D28936: Use a Proxy object to detect changes within the MediaMetadata

2020-04-24 Thread Kai Uwe Broulik
broulik added a comment. Maybe if I overwrote `MediaMetadata` with a `Proxy` object already, then the website would never have a separate `Object` to work with.. hmm REPOSITORY R856 Plasma Browser Integration REVISION DETAIL https://phabricator.kde.org/D28936 To: broulik, #plasma, fvogt

D28936: Use a Proxy object to detect changes within the MediaMetadata

2020-04-24 Thread Fabian Vogt
fvogt added a comment. In D28936#656422 , @broulik wrote: > > this doesn't catch something like this > > Yeah it doesn't. I thought I could "monitor" an Object but the caller actually has to //use// the Proxy for it to detect anything :/ >

D28936: Use a Proxy object to detect changes within the MediaMetadata

2020-04-24 Thread Kai Uwe Broulik
broulik added a comment. > this doesn't catch something like this Yeah it doesn't. I thought I could "monitor" an Object but the caller actually has to //use// the Proxy for it to detect anything :/ Any ideas? :) INLINE COMMENTS > fvogt wrote in content-script.js:716 > That appears

D28936: Use a Proxy object to detect changes within the MediaMetadata

2020-04-24 Thread Fabian Vogt
fvogt added a comment. AFAICT (take with a grain of salt, I'm a JS n00b) this doesn't catch something like this: let a = {}; navigator.mediaSession.metadata = a; a["foo"] = "bar"; And behaves weirdly if you do: let a = navigator.mediaSession.metadata; navigator.m

D28936: Use a Proxy object to detect changes within the MediaMetadata

2020-04-18 Thread Kai Uwe Broulik
broulik created this revision. broulik added reviewers: Plasma, fvogt. Herald added a project: Plasma. Herald added a subscriber: plasma-devel. broulik requested review of this revision. REVISION SUMMARY According to spec [1] it is allowed to change properties within the `MediaMetadata` rather