Created
January 21, 2021 19:05
-
-
Save Hypfer/935fece064f8e353da601c413b2ec9e1 to your computer and use it in GitHub Desktop.
Userscript which enables the Webinterface of a Yamaha RX-V473 AV Receiver
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 RX-V473 WebControl Restore | |
// @match http://192.168.*.* | |
// @version 1 | |
// @run-at document-start | |
// @grant GM_addStyle | |
// ==/UserScript== | |
(function(open) { | |
unsafeWindow.XMLHttpRequest.prototype.open = function(method, url, async, user, pass) { | |
this.origOnload = this.onload; | |
this.onload = function (httpObj) { | |
var xmlData = this.responseXML; | |
if (xmlData) { | |
var Cmd = ["Service","System", "Main_Zone", "Zone_2", "Zone_3", "Zone_4", | |
"Tuner", "USB", "HD_Radio" , "NET_RADIO" , "SERVER" , "SiriusXM" , | |
"Rhapsody" , "Napster" , "Pandora" , "AirPlay","iPod_USB"]; | |
var cmdname = ""; | |
for ( var i = 0; i < Cmd.length; i++ ) { | |
var zone = xmlData.getElementsByTagName(Cmd[i]); | |
if (zone.length == 1) { | |
cmdname = Cmd[i]; | |
break; | |
} | |
} | |
if (cmdname == "System") { | |
var Val = xmlData.getElementsByTagName("Model_Name"); | |
if (Val.length) { | |
if (Val[0].firstChild) { | |
Val[0].firstChild.nodeValue = "RX-V673"; | |
} | |
} | |
} | |
} | |
this.origOnload(); | |
} | |
open.call(this, method, url, async, user, pass); | |
}; | |
})(unsafeWindow.XMLHttpRequest.prototype.open); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment