SoundCloud-Player icon indicating copy to clipboard operation
SoundCloud-Player copied to clipboard

Improve messaging

Open S4WA opened this issue 3 years ago • 4 comments

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

S4WA avatar Nov 13 '22 02:11 S4WA

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

apades avatar Dec 02 '22 06:12 apades

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

S4WA avatar Dec 02 '22 06:12 S4WA

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: @.***>

apades avatar Dec 03 '22 04:12 apades

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

S4WA avatar Dec 03 '22 11:12 S4WA

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)

S4WA avatar Jun 04 '24 06:06 S4WA