Reputation: 414
I'm trying to trigger the "Desktop site" (and additionally know if it's already triggered) you can have on your mobile browser from JavaScript, is there a way to do that?
I saw some others topics that had the same issues but on their sides they were more about having a custom view for both or something along this way, while on my side I would just want to trigger this specific feature
Upvotes: 1
Views: 308
Reputation: 48357
(this is a comment, but its a bit long)
Upvoted here because although you are asking the wrong question, what sits behind that question is an interesting problem and not well documented.
The menu entry asserts some behaviour which is sent to the backend server. The backend server then delivers different content. For security reasons, a web page can interact with browser chrome (i.e. the furniture outside the view of the website in the window). So the answer to the question you asked, is that you cannot invoke this from javascript. However your problem is not invoking a menu item but rather creating the same effect as invoking the menu item.
Providing a toggle to change the presentation layer on the website is straightforward, however the question should really be,
How does this menu option change the behaviour of the site?
How to implement/integrate a parallel mechanism for achieving the same result.
Upvotes: 1