Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
スマホから Pawoo Music に曲を追加するための Deck バーを出します。
// ==UserScript==
// @name Pawoo Music deck bar for smartphone
// @namespace hen.acho.co
// @include https://music.pawoo.net/web/*
// @version 1.170911
// @description You can add music from your smartphone.
// @downloadURL https://gist.github.com/pacochi/28e1533e3ca025350d919cb2d755ade4/raw/pawoomusic_deck_sp.user.js
// @run-at document-idle
// @grant none
// ==/UserScript==
(e => {
document.head.appendChild(Object.assign(document.createElement('style'), { textContent: `
@media screen and (max-width:1024px) {
div.player-control{
display: flex;
}
}
.player-control.is-open div.control-bar__deck {
transform: scale(0.4) translate(-980px,-820px);
}
`}));
// innerWidth 偽装で常に 1025px を返す
// 参考: https://gist.github.com/unarist/71067609416aed633cf74eddb6feb725
Object.defineProperty(window, 'innerWidth',
Object.assign({}, Object.getOwnPropertyDescriptor(window, 'innerWidth'), {
get() { return 1025 }
})
);
//e = document.createEvent('UIEvents');
//e.initUIEvent('resize', true, true, window, 0);
e = new CustomEvent('resize');
window.dispatchEvent(e);
console.log(e,window.innerWidth);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment