Paul
Paul

Reputation: 1383

Changing the JavaScript engine in side a web browser

It is possible to change the JavaScript engine being used inside a Web Browser?

Some additional information:

For testing mobile applications, I would like to be able to emulate the exact JavaScript engine being used by a web browser to find bugs.

If there anyway to change the javascript engine being used in a Browser such as Chrome or would I need to build my own browser?

Upvotes: 1

Views: 1518

Answers (3)

N1gthm4r3
N1gthm4r3

Reputation: 785

This is an interesting feature. I'd like to test Safari Javascriptcore engine in Chrome browser instead of V8. Because I noticed that some of my angular code is not rendered correcty on JavascriptCore engine and rendered correctly on other browsers. It'll be in handy when you found some bugs on ios devices and you have no mac device nearby.

UPD

I found browsers where you can change browser engine lunascape and avant. these browsers are triple engine browsers and you can switch between engines.

Upvotes: 2

Brian S
Brian S

Reputation: 5056

Generally, a given browser ships with a single JavaScript engine. There is no need to ship with multiple engines, because if additional features are required of the engine, they'll simply be added to the engine which the browser ships with.

I could potentially see the existence of a modular web browser which requires plugging in a JS engine separate from the main program (which could then result in the user having multiple JS engines on their machine), but I know of no such browser, and thus know of no means by which JS could be used to swap the engine.

I suppose you could implement EMCAScript in JavaScript, but that seems like a tremendous hassle.

In response to the edits to your question: I believe Chrome Dev Tools' mobile emulation will get you what you want instead of what you've asked for.

Upvotes: 0

Quentin
Quentin

Reputation: 943193

There are a number of open source browsers. It is theoretically possible to replace the JavaScript engines they use and compile your own executable. Indeed a number of browsers have changed engines during their history.

You'll probably need to make changes to the API to make them compatible though.


There's no way to do this from JavaScript, of course.

Upvotes: 0

Related Questions