MozillaZine

Where does firefox load page content

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
EtterSpirit
 
Posts: 3
Joined: March 25th, 2015, 7:42 am

Post Posted March 31st, 2015, 11:26 pm

Background

I am reworking the remote-browser plugin for a software called ettercap. I catch the HTTP Headers via Man in the Middle attack and extract the url. I have set a filter with an "Accept: ..." Statement so not everything will be opened. But some Ads and Images still manage to pass this filter and open themselves in my browser.

I was hoping to find a solution in the firefox source code. I already looked over various files and researched a lot.
I am guessing it has something to do with a Method called "HasHeaderValues" or a related
file.

I need to know how firefox knows an incoming link via HTTP-Package is an image/ad for the page it is working on or it is a new page which must open in a new tab.

Question

So the question is: In which file or method does firefox load external content like ads or images.

Thanks in advance

DanRaisch
Moderator

User avatar
 
Posts: 117346
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Post Posted April 1st, 2015, 5:08 am

Moving to Web Development.

trolly
Moderator

User avatar
 
Posts: 39864
Joined: August 22nd, 2005, 7:25 am

Post Posted April 1st, 2015, 7:02 am

Browser do not accept incoming calls, they initiate them.

Firefox makes a REQUEST and the server answers with a RESPONSE.
The response contains all information about the data sent like size and type.
Active content like JS can request additional data and open new windows.
The data itself does not contains any information where it belongs to. The browser makes that connection.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

EtterSpirit
 
Posts: 3
Joined: March 25th, 2015, 7:42 am

Post Posted April 8th, 2015, 7:37 am

Okay, I get what you are telling me.
Do you know in which .cpp or .js file this happens so I can have a look at the "Algorithm"?

Thanks in Advance

trolly
Moderator

User avatar
 
Posts: 39864
Joined: August 22nd, 2005, 7:25 am

Post Posted April 8th, 2015, 10:11 am

Not for the native firefox implementation.
If you want to know how to do it in JS (the scripts are loaded with the page):
http://www.w3schools.com/jsref/met_win_open.asp

You probably have to scan the embedded and external scripts which are loaded with/from the page. And maybe even asynchron requests.
http://www.w3schools.com/ajax/ajax_xmlh ... t_send.asp
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

Return to Web Development / Standards Evangelism


Who is online

Users browsing this forum: No registered users and 1 guest