Bug 244136 - View Document Source does not work for JS-generated pages
Summary: View Document Source does not work for JS-generated pages
Status: RESOLVED UNMAINTAINED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-10 16:35 UTC by Jonathan Marten
Modified: 2024-05-06 18:39 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Test HTML page (770 bytes, text/html)
2010-07-10 16:35 UTC, Jonathan Marten
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Marten 2010-07-10 16:35:01 UTC
Created attachment 48749 [details]
Test HTML page

Version:           unspecified (using Devel) 
OS:                Linux

It is possible for a page to be generated dynamically by opening a new window and writing a document using JavaScript.  The "View Document Source" action is available for such a page, but trying to do that displays an error message

  The file 'file:///usr/home/jjm/docs/' could not be opened: it is not a
  normal file, it is a folder.

"OK"-ing that message opens a new blank "Untitled - KWrite" window.


Reproducible: Always

Steps to Reproduce:
Test case attached.




Suspect that Konqueror is just passing the URL of the page to KWrite - unfortunately in this case there isn't one (or it is blank) and KWrite expands this blank URL to the path of the user's documents folder.

"View Page Source" in Firefox works in this case, and correctly displays the generated HTML.
Comment 1 Dawit Alemayehu 2011-12-15 17:56:47 UTC
Cannot reproduce. The test HTML page produces the same result in Firefox and Konqueror with either the webkit or khtml engines in KDE 4.7.4.
Comment 2 Jonathan Marten 2011-12-16 20:50:09 UTC
Does not work here with current master and KHTML (WebKit seems to have a separate problem for which I will raise another report).  Are you trying to view the source of the popup window HTML (the window with the title "Popup window" that says "Generated content - now try "View Document Source" here")?
Comment 3 Jonathan Marten 2011-12-16 20:51:48 UTC
Works in rekonq.
Comment 4 Dawit Alemayehu 2011-12-16 23:57:56 UTC
(In reply to comment #2)
> Does not work here with current master and KHTML (WebKit seems to have a
> separate problem for which I will raise another report).  Are you trying to
> view the source of the popup window HTML (the window with the title "Popup
> window" that says "Generated content - now try "View Document Source" here")?

Ooops. You are correct. I am wrong. I have no idea what khtml does. I will fix the webkit issue.
Comment 5 Dawit Alemayehu 2011-12-20 07:29:32 UTC
Git commit eb1fc9084e8c66fd65251fbcc53b43378b0b9135 by Dawit Alemayehu.
Committed on 20/12/2011 at 08:25.
Pushed by adawit into branch 'master'.

Show the correct information when View->View Document Source is selected.

CCBUG: 244136

M  +3    -2    src/kwebkitpart_ext.cpp

http://commits.kde.org/kwebkitpart/eb1fc9084e8c66fd65251fbcc53b43378b0b9135
Comment 6 Christoph Cullmann 2024-05-06 18:39:15 UTC
Dear user,

KHTML (and KJS) was a long time more or less unmaintained and got removed in KF6.

Please migrate to use a QWebEngine based HTML component.

We will do no further fixes or improvements to the KF5 branches of these components beside important security fixes.

For security issues, please see:

https://kde.org/info/security/

Sorry that we did not fix this issue during the life-time of KHTML.

Greetings
Christoph Cullmann