mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-02 10:52:20 +01:00
Support for Android Firefox and m.youtube.com
should fix #68 and #143 List of changes: * Suppress mobile user agents in background script * Also look for the mobile equivalents of relevant HTML Elements * More consistently use get[Dis]LikeButton() instead of getButtons().children * Add mobile-specific css tweaks
This commit is contained in:
3 files changed
+59
-25
No files matched your search
@@ -46,8 +46,14 @@ browser.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||
toSend = [];
|
||||
}
|
||||
} else if (request.message == "fetch_from_youtube") {
|
||||
let headers = {}
|
||||
if (navigator && navigator.userAgent) {
|
||||
// Never request mobile version
|
||||
headers["User-Agent"] = navigator.userAgent.replace(/\(.*Mobile;/,"(X11; Linux x86_64;");
|
||||
}
|
||||
fetch(`https://www.youtube.com/watch?v=${request.videoId}`, {
|
||||
method: "GET",
|
||||
headers: headers
|
||||
})
|
||||
.then((response) => response.text())
|
||||
.then((text) => {
|
||||
|
||||
Reference in new issue
Block a user