هذا سكربت جاهز للتثبيت مباشرة.
كل ما عليك فقط هو تعديل كلمة المرور في المكان المخصص.
السكربت (انسخه بالكامل كما هو)
المطلوب فقط: استبدل
PUT_YOUR_PASSWORD_HEREبكلمة مرور الراوتر لديك.
// ==UserScript==
// @name Huawei Router Auto Login (192.168.8.1)
// @namespace local.autologin.huawei
// @version 2.0
// @description Autofill + Auto Login without page refresh
// @match https://192.168.8.1/*
// @run-at document-idle
// ==/UserScript==
(function () {
'use strict';
const ROUTER_PASSWORD = 'PUT_YOUR_PASSWORD_HERE';
const PASS_SELECTOR = '#login_password';
function setNativeValue(el, value) {
const lastValue = el.value;
el.focus();
el.value = value;
el.dispatchEvent(new Event('input', { bubbles: true }));
el.dispatchEvent(new Event('change', { bubbles: true }));
el.dispatchEvent(new KeyboardEvent('keyup', { bubbles: true }));
if (lastValue !== value) {
el.dispatchEvent(new Event('blur', { bubbles: true }));
}
}
function clickLogin() {
const buttons = Array.from(document.querySelectorAll('button, input[type="button"], input[type="submit"]'));
const loginBtn = buttons.find(btn =>
/log\s?in/i.test(btn.innerText || btn.value || '')
);
if (loginBtn) {
loginBtn.click();
return true;
}
return false;
}
function attemptLogin() {
const passEl = document.querySelector(PASS_SELECTOR);
if (!passEl) return false;
if (!passEl.value) {
setNativeValue(passEl, ROUTER_PASSWORD);
}
setTimeout(() => {
clickLogin();
}, 300);
return true;
}
// مهم جدًا لواجهة Vue — نراقب التغييرات بدون ريفرش
const observer = new MutationObserver(() => {
attemptLogin();
});
observer.observe(document.body, {
childList: true,
subtree: true
});
// محاولة أولى مباشرة
attemptLogin();
})();
طريقة التركيب
-
تثبيت إضافة Tampermonkey على المتصفح.
-
الدخول إلى الإضافة ثم اختيار Create a new script.
-
حذف المحتوى الافتراضي.
-
لصق السكربت كاملًا.
-
تغيير كلمة المرور في هذا السطر فقط:
const ROUTER_PASSWORD = 'PUT_YOUR_PASSWORD_HERE';
-
حفظ السكربت.
-
الدخول إلى صفحة الراوتر:
https://192.168.8.1
وسيتم تسجيل الدخول تلقائيًا.