من حاسوب الى هاتف

للحاسوب

Tento skript by neměl být instalován přímo. Jedná se o knihovnu, kterou by měly jiné skripty využívat pomocí meta příkazu // @require https://update.greasyfork.org/scripts/583351/1857923/%D9%85%D9%86%20%D8%AD%D8%A7%D8%B3%D9%88%D8%A8%20%D8%A7%D9%84%D9%89%20%D9%87%D8%A7%D8%AA%D9%81.js

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

Autor
ghita katrina
Verze
0.0.1.20260618185650
Vytvořeno
18. 06. 2026
Aktualizováno
18. 06. 2026
velikost
1,2 KB
Licence
neuvedeno

// ==UserScript==
// @name Force Mobile View
// @namespace http://tampermonkey.net/
// @version 1.0
// @description تصفح المواقع بنسخة الهاتف وتفعيل ميزات اللمس
// @author Yassir
// @match *://*/*
// @grant none
// @run-at document-start
// ==/Class==

(function() {
'use strict';

// 1. تغيير الـ User-Agent لتبدو وكأنك تستخدم هاتف آيفون أو أندرويد
const mobileUA = "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1";

Object.defineProperty(navigator, 'userAgent', {
get: function () { return mobileUA; }
});

// 2. تفعيل ميزات اللمس (Touch Events) التي تحتاجها ميزات الهاتف في المواقع
if ('maxTouchPoints' in navigator) {
Object.defineProperty(navigator, 'maxTouchPoints', { get: () => 5 });
}
if ('msMaxTouchPoints' in navigator) {
Object.defineProperty(navigator, 'msMaxTouchPoints', { get: () => 5 });
}

// 3. محاكاة دعم اللمس في المستند
window.Ontouchstart = true;
})();