0

I am working on a swing application with javafx control (WebView). In which I have to browse HTML files either in JEditorPane or WebView.

But the problem in my project is that I am trying to view HTML files which are encrypted with the help of a software htmlprotecter . It is encrypting the files by invoking the a prompt for entering a password after that the files can be opened in browser. Is there any procedure in Java in which I can pass the password to HTML file to disable javascript and file could be opened in Java programs?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
adesh
  • 1,157
  • 3
  • 18
  • 28
  • Why is the HTML encrypted to begin with? It's a pretty ludicrous proposal, since the browser needs plain HTML, which means any user can easily see the plain HTML as well. – deceze Nov 26 '12 at 13:18

1 Answers1

-1

two real possibilities that i see here...

1) the javascript "encryption" (are you sure you are not confusing this with some sort of encoding?) is extremely simplistic and you can emulate the "decryption" routine yourself by operating on the HTML content within java.

2) the "encryption" is very complex and your only option is to parse and run the javascript - which means utilizing some java-based javascript engine (which i have no knowledge of)

case 2 is probably more effort than it is worth.

in short, there is no simple way to pass the password to HTML file to disable javascript. you'll either have to decrypt/decode it yourself or actually run the javascript within java.

Alex Lynch
  • 951
  • 5
  • 11