Skip to content

Instantly share code, notes, and snippets.

@techninja1008
Last active December 31, 2016 18:20
Show Gist options
  • Save techninja1008/fdf73fd200fcb16a45deea6b0d2b1fb7 to your computer and use it in GitHub Desktop.
Save techninja1008/fdf73fd200fcb16a45deea6b0d2b1fb7 to your computer and use it in GitHub Desktop.
DGS-1224T Fixer Userscript
// ==UserScript==
// @name DGS-1224T Fix
// @namespace http://wensley.eu/
// @version 0.1
// @description Fixes DGS-1224T UI
// @author Danny Wensley
// @match */*
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
(function() {
'use strict';
function doStuff(win){
var res = /onload="location.href='(.*)'"/.exec(win.document.documentElement.innerText);
win.location.href = res[1];
}
if(document.title === "DGS-1224T" || window.location.pathname === "/smartwizard.htm"){
setInterval(function(){
var frames = $('frame').toArray().concat($('iframe').toArray());
for(var i = 0; i < frames.length; i++){
if(frames[i].contentWindow.document.documentElement.innerText.match(/http-equiv='Page-Exit'/)){
doStuff(frames[i].contentWindow);
}
}
if(document.documentElement.innerText.match(/http-equiv='Page-Exit'/)){
doStuff(window);
}
}, 1000);
}
})();
@techninja1008
Copy link
Author

techninja1008 commented Dec 21, 2016

If you know how to use TamperMonkey, then use this as a userscript.

If you have never used TamperMonkey before, then go to http://tampermonkey.net/, and install the plugin for your browser. Afterwards, go to https://gist.github.com/techninja1008/fdf73fd200fcb16a45deea6b0d2b1fb7/raw/65a2311e8c694083cc37e11f438c6652fc239af6/fix.user.js, and click install. The UI should now work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment