// ==UserScript== // @name Comcast Business SMCD3G Port Forward Autoconfig // @namespace http://tampermonkey.net/ // @version 0.3 // @description Easily/Automatically create port forwards, without having to sit and wait for each change to apply. Created to while diagnosing an issue with SMCD3G that caused it to forgets all configured port forwards, which seems to be a common problem for some xfinity customers as well. // @author firefish5000@kataomoi.moe // @include /https?:\/\/10\.\d{1,3}\.\d{1,3}\.\d{1,3}\/user/\index\.asp/ // @grant none // @downloadURL https://update.greasyfork.icu/scripts/28439/Comcast%20Business%20SMCD3G%20Port%20Forward%20Autoconfig.user.js // @updateURL https://update.greasyfork.icu/scripts/28439/Comcast%20Business%20SMCD3G%20Port%20Forward%20Autoconfig.meta.js // ==/UserScript== // [ "Application Name", Public port start, Public port end, Internal port Start, "Protocall", "Forward IP"] var Ports = [ ["HTTP", 80,80,80,'TCP','10.0.0.12'], ["HTTPS", 443,443,443,'TCP','10.0.0.12'], ["IKEv2-NAT-T", 4500,4500,4500,'UDP','10.0.0.12'], ["IPSEC-IKE", 500,500,500,'UDP','10.0.0.12'], ["IPSEC-ESP", 50,50,50,'ESP','10.0.0.12'], ["SSH", 2222,2222,22,'TCP','10.0.0.12'], ]; function dbg(txt) { console.log(txt); } function getElementByXpath(path,element=document) { return document.evaluate(path, element, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; } function getElementsByXpath(xpath, parent=document) { let results = []; let query = document.evaluate(xpath, parent, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (let i=0, length=query.snapshotLength; i