combine.fm/chrome/src/spotify.js

42 lines
1.2 KiB
JavaScript
Raw Normal View History

2017-10-23 17:58:23 +01:00
const apiUrl = 'https://combine.fm';
function contextClick(e) {
console.log(e);
}
console.log('attach');
window.addEventListener('click', contextClick);
// document.addSelectorListener('iframe', (outerEvent) => {
// document.addEventListener('click', contextClick);
// outerEvent.target.contentDocument.addEventListener('click', contextClick);
// document.removeSelectorListener('.front iframe');
// iframes[outerEvent.target.src] = true;
// });
// document.addSelectorListener('#context-actions-area iframe', (outerEvent) => {
// outerEvent.target.addEventListener('load', () => {
// const ul = outerEvent.target.contentDocument.querySelector('.dropdown-interior-menu');
//
// for (let node of ul.childNodes) {
// console.log(node);
// }
//
//
// const li = document.createElement('li');
// ul.appendChild(li);
// const a = document.createElement('a');
2017-10-23 17:58:23 +01:00
// a.innerText = 'Open in Combine.fm'
// a.href = apiUrl;
// a.target = '_blank';
// a.addEventListener('click', (e) => {
// e.preventDefault();
// window.open(apiUrl + '/spotify/' + match[1] + '/' + match[2], '_blank');
// });
// li.appendChild(a);
// });
// });