In pure JavaScript probably not , this is because native functions may not be written in JavaScript completely, usually they are "interfaces" , which are used to access a functionality of the browser or provide functionality for another feature at a level above.
This How to customize "Notification Web API" in Qt? is an example where I used QtWebkit (an API that uses the Webkit engine) and had to rewrite it via C ++ (actually Qt API) to be able to customize Desktop notifications. p>
An example, still speaking of Qt, webkit is possible to write its own functions, with QWebFrame::addToJavaScriptWindowObject
:
void Exemplo::setWebView( QWebView *view )
{
QWebPage *page = view->page();
frame = page->mainFrame();
define();
QObject::connect( frame, SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(define()) );
}
void Exemplo::define()
{
frame->addToJavaScriptWindowObject( QString("Exemplo"), this );
}
Of course the question has nothing to do with Qt , but what I want to explain is that in this way above I wrote an object like this:
window.Exemplo.foo();
This will allow me to access functions of my C ++ implementation.
In other words, you do not have to see the native code, since it is probably just an interface (in most cases / browsers), of course there may be some exceptions, but it will be one or the other.
So there's really not much reason to read the source code via JavaScript, because there is "no JavaScript code" there, these native functions probably only communicate with the browser / engine API and this triggers an existing browser.
Now if you just want to find out, regardless of JavaScript, you will have to read the source code of the browser (webkit, Gecko, presto, blink, trident, etc.) and browsers too (chromium, firefox, msedge) in their unpublished "versions", which are probably written in C
or C++
Blink
Blink is the fork of Webkit, used by Chrome and is also used in other browsers, such as Opera , Vivaldi , etc.
Extending this ( line 33 ):
Gecko
Gecko is the "engine" used by Firefox or other Mozilla products, such as , I'm not sure this is the appropriate repository, but it looks like the code you're looking for is this:
>