S4WA / SoundCloud-Player

For all of the soundcloud heavy users.
https://akiba.cloud/soundcloud-player/
GNU General Public License v3.0
22 stars 6 forks source link

Improve messaging #21

Closed S4WA closed 4 months ago

S4WA commented 1 year ago

bruh https://stackoverflow.com/questions/27383224/chrome-extension-long-lived-message-connection-how-to-use-callback-functions

apades commented 1 year ago

a new way to listen audio event change with out interval 1s update to get page innerText, use this script in Tampermonkey

(function() {
    'use strict';
let _createElement = document.createElement.bind(document)

let index = 0
document.createElement = (...args) => {
  let el = _createElement(...args)
  if (args[0] === 'audio') {
    console.log('create audio', el)
    el.setAttribute('data-index', index++)
    el.addEventListener('play', (e) => {
      let el = e.target
      // let index = el.getAttribute('data-index')
      console.log('play', el)
    })
  }
  return el
}
})();

then you can see that website create a audio el, i click page play button and trigger this el play event, all audio event in mdn Image

S4WA commented 1 year ago

cool! i'll check it tonight. thanks apades!

apades commented 1 year ago

i think this is network problom  or soundcould lazy load bug, maybe you can open devTools to check this error  

apad @.***

 

------------------ 原始邮件 ------------------ 发件人: "Yuri @.>; 发送时间: 2022年12月2日(星期五) 晚上9:52 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [S4WA/SoundCloud-Player] Improve messaging (Issue #21)

sometime my likes on sc (https://soundcloud.com/you/likes) won't load new items and kept loading forever unless i reload the page. wonder if my code is causing it or it's just sc side's fault.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

S4WA commented 1 year ago

sorry i accidentally deleted my comment. i'll check devtool when it happened again.

S4WA commented 5 months ago

will seriously have to deal with it since i had a little change in my code around messaging and it became slower (i think it's not responding because of the nullpo kind of)