Last active
January 10, 2018 14:31
-
-
Save pacochi/28e1533e3ca025350d919cb2d755ade4 to your computer and use it in GitHub Desktop.
スマホから Pawoo Music に曲を追加するための Deck バーを出します。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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