How to get the source for a page using C/C++?

How to get the source for a webpage page using C/C++?

Scenario: I'm in a JavaScript callback (for example the callHook 
callback) and I have a JSContext * and a JSScript at my disposal. How 
can I get the page source code for this page?

One answer is get the filename from the script. That is great if its a 
local filename such as c:\myWebPage.html as I can open that using 
fopen() etc.

However if its a non-local file such as http://someWebAddress/page.html 
or one of the chrome:// pages then I can't open that. I don't want to 
fetch the page myself as the page content may be different for each call 
- I want the same source as the page which resulted in my script being 
called.

I've looked at the source for many days and weeks and this has defeated 
me. None of the JSD_* calls appear to be publicly available as DLL 
exports so I can't use those. Following ID_VIEW_SOURCE resource ids led 
me to some code which eventually displays the source code, but it does 
that in a Mozilla window and I lost track of the point at which the page 
code is available and then sent to the window. I require just the page 
source as an ANSI or Unicode string or character pointer, not a window 
containing the source.

If it makes any difference to the question I'm working on a Windows box. 
Given its cross platform I doubt it will make a difference, but thought 
I should mention it anyway.

Does anyone know how to do this?

If I've posted this to the wrong newsgroup please tell me where I should 
have posted this question. Hoping someone can help.

Stephen
-- 
Stephen Kellett
Object Media Limited    http://www.objmedia.demon.co.uk/software.html
Computer Consultancy, Software Development
Windows C++, Java, Assembler, Performance Analysis, Troubleshooting
0
Stephen
11/11/2005 1:45:11 PM
netscape.mozilla.browser 4970 articles. 0 followers. Follow

2 Replies
1226 Views

Similar Articles

[PageSpeed] 10
Get it on Google Play
Get it on Apple App Store

Stephen Kellett wrote:

> If I've posted this to the wrong newsgroup please tell me where I 
> should have posted this question. Hoping someone can help.

I know bits and pieces of your answer but probably not enough to be 
helpful. Try the embedding group?

-- 
Warning: May contain traces of nuts.
0
Neil
11/14/2005 10:38:59 AM
In message <dl9pg4$8p31@ripley.aoltw.net>, Neil <neil@parkwaycc.co.uk> 
writes
>I know bits and pieces of your answer but probably not enough to be 
>helpful. Try the embedding group?

OK. Thanks. I have reposted the question there. I'd be interested in 
your answers all the same.

Stephen
-- 
Stephen Kellett
Object Media Limited    http://www.objmedia.demon.co.uk/software.html
Computer Consultancy, Software Development
Windows C++, Java, Assembler, Performance Analysis, Troubleshooting
0
Stephen
11/14/2005 1:53:54 PM
Reply:

Similar Artilces:

how to access c# variable from c# code page into javascript function in html source page
hi, i work in asp.net2.0/c#.not much expert in javascript.i have a variable declared in the c# code behind page.assume the variable contains some value. i have a javascript function in the <script> </script> area of the html source view of the corresponding aspx(asp.net)page. my requirement is how do i access the variable from the c# code behind page  into the html page section.? i need to use the variable in the  javascript function  . please show some light on how to get the variable from the c# code section to the javascript function which is si...

C Components Using Watcom C/C++ Compiler
This is a cryptographically signed message in MIME format. --------------ms2646818B6AC700D6597C3859 Content-Type: multipart/mixed; boundary="------------E0BFC7D7A6CA166C48EDA143" This is a multi-part message in MIME format. --------------E0BFC7D7A6CA166C48EDA143 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Does anyone have an example of C skeleton files and Watcom C/C++ make file to compile and load C components into Jaguar using the Watcom C/C++ compiler/Linker? --------------E0BFC7D7A6CA166C48EDA143 Content-Type: text/x-vcard; ch...

Page Load gets hit twice when using Javascript in ASP.NET using C#
Hi guys,I'm fairly new to Javascript so trying to implement it on my ASP.NET form has been a bit off a challenge.The problem I'm having is simple, if I don't use the Javascript the code works fine, when I implem,ent the Javascript in my ASP.NET code, Page Load is hit twice and in doing so clears out any previous work which has been done on the form.I build the Javascript on Client Side so I can get access the control names and then tie the Javascript to the buttons by the the OnClientClick, baring in mind the buttons allready have a OnClick event handler on the form. AutoEventWir...

About C and C++
Hello, I will resume it like this: On the criterias of "complexity" and "difficulty", the C and C++ programming languages are more complex and difficult than Object Pascal for example, so since they are more complex and difficult they are likely to create something like a darwinian filter who don't let the weaker humans among us humans to cross or to climb the social ladder, this is why i think that C and C++ do participate to social darwinism, this is why i say that C and C++ are bad. Thank you, Amine Moulay Ramdane. Amine Moulay Ramdane wrote: > He...

c# get surfer source page
need to get info from which inet address user surfed to my page. Thanks. You need to use Request.UrlReferrer, but be aware that this doesn't always work (e.g. when the browser is first opened - if they have your site as their homepage - or if the url is typed into the address bar). Steven BeyRecursion: see Recursion...

C++ or C#
HI, I have still seen that many big companies are still using C++ as their primary language of choice instead of C#. Like IBM stilll prefers C++ over c#. Any reason ???HighOnCodingWanna get high! Well not everybody has the .net framework installed. C++ will work on any platform, c# will not yet because the framework has not been ported to all platforms yet (e.g. mac). Also you have to think of the expense of a large company to retrain ALL its coders to use the new framework. Not exactly practical in the short term David LeggDave Legg Considering that they have a huge c...

C or C++
What's the difference in using C or C++ for ultralite developments?. Novice user. Thank you The ONLY difference is YOUR preference. There is no speed difference between the two. If you are very used to C++ but not used to SQL, then the C++ API maybe a better choice. If you are familiar with SQL, the embedded SQL may make more sense. -- David Fishburn Sybase - iAnywhere Solutions Professional Services Please only post to the newsgroup EBFs and Whitepapers http://www.sybase.com/products/mobilewireless/anywhere/ "Lorenzo Mota" <lorenzomota@aol.com> wro...

C/C++ Developer
My client is looking for rock star Mozilla engineers to join its growing team! This is a fantastic opportunity to develop Mozilla based web services for media delivery to mobile phones. The candidates will be actively involved in the planning, specification and development of the applications on the Mozilla platform. Responsibilities: The Mozilla expert will work on extending the framework and current Firefox code to develop a cutting edge browser solution. The responsibilities will include the following: 1. Extending the Mozilla framework and Firefox modules 2. Developing extens...

C/C++ Developer
My client is looking for rock star Mozilla engineers to join its growing team! This is a fantastic opportunity to develop Mozilla based web services for media delivery to mobile phones. The candidates will be actively involved in the planning, specification and development of the applications on the Mozilla platform. Responsibilities The Mozilla expert will work on extending the framework and current Firefox code to develop a cutting edge browser solution. The responsibilities will include the following: 1. Extending the Mozilla framework and Firefox modules 2. Developing extensi...

Standard C/C++ and Mozilla
tl;dr - I ask some questions near the end, you probably need to read the entire post to be able to insightfully answer them. The Mozilla codebase, which I define loosely as mozilla-central, comm-central, JS, NSS, NSPR, LDAP C SDKs, and any other small project included in mozilla-central that is built and maintained semi-independently, has organically and continuously grown from its original kernels which predate many of the modern standards used for C and C++. Thus, its APIs have impedance mismatches with what is more common in modern C/C++, which may deter would-be contributo...

C-C TB compile: some files are not compiled using ccache any more(???): mozilla/js/vm/*
Hi, I am using ccache for local compilation of comm-central TB. After the checkout a few hours ago, and tinkering with my local hg patch queues, I noticed some files are NOT compiled using ccache any more. (I was debugging a local ccache that groks -gsplit-dwarf option to gcc. This option and use of GNU ld.gold makes linking rather fast.) I have not figured out which files are not compiled using ccache completely, but, as starters, the files under comm-central/mozilla/js/src/* such as jsobj.cpp and friends, and the files below such as comm-central/mozilla/js/src/vm/* such a...

Using Project and C/C++ API - getting First Chance exception ...
Hi, I'm creating a UL application using the C/C++ API. I created a project in Sybase Central and typed in the following SQL statement. select UPrice, ItemDesc from Inventory where SKU = ? SKU, UPrice and ItemDesc are varchar types (different lengths for each). I run ulgen and get the .cpp, .hpp and .h files using the string below. 'ulgen -c "dsn=BDC" -t c++ -j Inventory -u InventoryPubAPI -f InventoryAPI' All looks good until I try to open the Record set. ----- int nlength = cs_ItemSKU.GetLength(); if ( GetDPSQL.Open( &ULConn_conn, cs_ItemSK...

BCB C++ compiler as choice to build open source c/c++ libraries
Quite a few years ago I noticed that a lot of the different C/C++ libraries dropped support for or didn't support the BCB C++ compiler in the favor of the Microsoft C++ compiler or gcc. Just to give you some examples: Qt dropped support for the Borland C++ compiler, and if you pick an open source cross platform C/C++ library it's very likely that the BCB C++ compiler won't be supported. Openssl comes to mind, htmltidy and so on. I have to admit, there are lots of c/c++ libraries out there, I haven't done a scientific evaluation and I don't have an exact number of the main...

How to run UNIX commands using C language ( C Language not C# langauge)
I am running Windows XP Professional and I want to run some UNIX commands from C langauge. Commands like semget and someother commands. Is there any tool that I can use with windows XP to run C language and use UNIX commands instead of installing the UNIX operating system. Thanks, HighOnCodingWanna get high! I think installing Linux is the way to go but have you looked at  http://www.cygwin.com?Cygwin is a Linux environment that run on Windows.  Check it out.    It's all over and I'm standin' prettyIn this dust that was a cityIf I could find a souvenier...

Web resources about - How to get the source for a page using C/C++? - netscape.mozilla.browser

Book sources - Wikipedia, the free encyclopedia
This page links to catalogs of libraries, booksellers, and other book sources where you will be able to search for the book with ISBN 9780226467313 ...

Swift Goes Open Source
Back at WWDC, Apple promised Swift would go open source by the end of the year. Today’s the day. The website has been overwhelmed most of the ...

Craig Federighi explains motivation behind making Swift open source & what the future holds
Earlier today Apple made good on its promise and released source code for its Swift programming language to the public . To go along with making ...

Fox News Source: San Bernardino Suspects Wore GoPro Cameras
... is a detail that adds another horrific layer to Wednesday’s mass shooting in San Bernardino. From a Fox News report : A law enforcement source ...

Apple Open Sources The Swift Programming Language
Back in June at WWDC 2015 Apple surprised a number of people by announcing that they would be making their Swift programming language open source ...

Apple takes the Swift programming language open source
First promised back at WWDC in June , Apple has just taken its Swift programming language open source with the introduction of a new site – swift.org ...

Apple Releases Swift as Open Source
CUPERTINO, California — December 3, 2015 — Apple® today announced that its Swift™ programming language is now open source. As an open source ...

Craig Federighi talks open source Swift and what’s coming in version 3.0
... Apple) When Apple unveiled Swift 2.0 at WWDC back in June, one of the bigger announcements was that the language would be going open source ...

Apple becomes open source champion with Swift programming language
One by one, companies are starting to embrace open source more and more. Microsoft has been a proponent of Linux and other open source solutions, ...

Ben Affleck source denies he hooked up with Abigail Kuklis from Batman
... to Star. “They’ve spent time together on both coasts.” But the tabloid then goes on to contradict its earlier claims, with its supposed source ...

Resources last updated: 12/4/2015 2:12:06 PM