Development :  K-Meleon Forum
K-Meleon development related discussions. 
Page Info
Posted by: Andrew
Date: March 01, 2003 11:36PM

For you coders and hackers out there, does anyone want to tackle hooking up Page Info. in a non-macro way?

http://bugzilla.mozilla.org/show_bug.cgi?id=126867

Options: ReplyQuote
Re: Page Info
Posted by: MonkeeSage
Date: March 07, 2003 01:24AM

RE: Macroless Page Info.

========

\BrowserView.cpp:

Top:

ON_COMMAND(ID_VIEW_PAGE_INFO, OnViewPageInfo)



Somewhere after CBrowserView class construction:

void CBrowserView:surprised smileynViewPageInfo()
{
if(! mWebNav)
return;

// Get the URI object we want to view from the cache.
nsresult rv = NS_OK;
nsCOMPtr<nsIURI> currentURI;
rv = mWebNav->GetCurrentURI(getter_AddRefs(currentURI));
if(NS_FAILED(rv) || !currentURI)
return;

// Get the uri string associated with the nsIURI object
nsCAutoString uriString;
rv = currentURI->GetSpec(uriString);
if(NS_FAILED(rv))
return;

// Build the page info url
nsCAutoString viewPageInfoUrl;

if(uriString.Find("https://";, 0) == -1)
viewPageInfoUrl.Append("about:cache-entry?client=HTTP&sb=1&key=");
else
viewPageInfoUrl.Append("about:cache-entry?client=HTTP-memory-only&sb=1&key=");

viewPageInfoUrl.Append(uriString.get());

OpenURL(viewPageInfoUrl.get());
}


In BrowserView.h:

afx_msg void OnViewPageInfo();


In define.Map.cpp

DEFINEMAP_ADD(ID_VIEW_PAGE_INFO)


In Resource.h:

#define ID_VIEW_PAGE_INFO 32813

========


Now you can add the line to DocumentPopup {} in menus.cfg:

Page Info = ID_VIEW_PAGE_INFO


My packages will include builds with this feature in the next up.

smiling smiley


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Page Info
Posted by: MonkeeSage
Date: March 07, 2003 02:46AM

RE: Macroless Page Info.

========


\BrowserView.cpp:

Top:

ON_COMMAND(ID_VIEW_FRAME_INFO, OnViewPageInfo)



Somewhere after CBrowserView class construction:

void CBrowserView:surprised smileynViewFrameInfo()
{
if(! mWebNav)
return;

// Get the URI object we want to view from the cache.
nsresult rv = NS_OK;
nsCOMPtr<nsIURI> frameURI;
rv = NS_NewURI(getter_AddRefs(frameURI), mCtxMenuCurrentFrameURL);
if(NS_FAILED(rv))
return;

// Get the uri string associated with the nsIURI object
nsCAutoString uriString;
rv = frameURI->GetSpec(uriString);
if(NS_FAILED(rv))
return;

// Build the page info url
nsCAutoString viewFrameInfoUrl;

if(uriString.Find("https://";, 0) == -1)
viewFrameInfoUrl.Append("about:cache-entry?client=HTTP&sb=1&key=");
else
viewFrameInfoUrl.Append("about:cache-entry?client=HTTP-memory-only&sb=1&key=");

viewFrameInfoUrl.Append(uriString.get());

OpenURL(viewFrameInfoUrl.get());
}

In BrowserView.h:

afx_msg void OnViewFrameInfo();


In define.Map.cpp

DEFINEMAP_ADD(ID_VIEW_FRAME_INFO)


In Resource.h:

#define ID_VIEW_FRAME_INFO 32814


========

smiling smiley


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Page Info
Posted by: MonkeeSage
Date: March 07, 2003 02:50AM

Err that second one was supposed to say:

RE: Macroless Frame Info.


The first one was for Page info, the second for Frame info.


Shelumi`El
Jordan

S.D.G

Options: ReplyQuote
Re: Page Info
Posted by: asmpgmr
Date: March 07, 2003 10:03PM

MonkeeSage,

I'm not sure that's what they had in mind for this since it basically duplicates what my macros do. I think the goal is to have something along the lines of Netscape 4.x but not as elaborate as Mozilla. Using the cache means that this will only work for http and https pages and even then some unneeded stuff is displayed like the server and response header. Also the filesize and last modified date/time should be displayed for local files and image dimensions and color depth should be displayed for images. If you have Netscape 4.x on your system check out what it does for view page info on various pages and filetypes.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.