Как перехватить javascript на сайте?

Суть вопроса-на сайте висит ява скрипт который фильтрует декстоп устройства,сам код примерно такой
if (typeof(window.orientation)=='undefined') {  
		window.location = 'http://url-to-white-land.com/';
}

Возможно ли перехватить или подменить значение window.orientation ?Спасибо
  • Вопрос задан
  • 202 просмотра
Пригласить эксперта
Ответы на вопрос 1
modestfake
@modestfake
Deprecated
This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.


Источник

Лучше вообще удалить этот скрипт или перед выполнением его написать
window.orientation = true

Для определения десктоп/мобайл можно проверять userAgent.
Примеры:
https://stackoverflow.com/questions/3514784/what-i...
https://stackoverflow.com/questions/11381673/detec...
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы