Disable URL encoding of the query string in qtkwebit - qtwebkit

I'm using qtwebkit to build a DOM-XSS scanner. By default qtwebkit is automatically URL encoding/escaping the query part of the URL. Javascript gets the URL encoded.
For example, when you visit the URL
http://test.com/?param=value<b>value</b>&a=b
location.href will contain the value
http://test.com/?param=value%3Cb%3Evalue%3C/b%3E&a=b
This is a big problem for me in detecting DOM-XSS vulnerabilities because I don't know if the browser did the encoding or the webpage did it. I'm trying to disable this functionality but I'm lost in the qtwebkit source code.
Anybody can help me by telling me where exactly in the code (in what file) the URL encoding takes place so I can modify the source code and recompile it?
I've been browsing the source code for 3 days now and I didn't make any progress.
Thank you very much in advance for any help.

I have also encounter your problem on Qt5,but Qt4 don't has this problem.
I modified Qt source code "qurlrecode.cpp" 's static function recode
This solved my problem, but I think it is best to modify webkit source code on KURL, but I failed to build webkit on my machine successfully after wasting one whole day.

QURL.setEncodedUrl(const QByteArray & encodedUrl) can solve it
via..http://doc.qt.io/qt-4.8/qurl.html#setEncodedUrl

Related

Make PDF viewable online in the browser

Note: Before asking i searched some on embedding but couldn't get exactly what i wanted.
I have a resume file in the pdf format that i would like to display in my website without storing anywhere like google or other but on my own. I have static website [which i made using Jekyll] lets say https://www.example.com and what i actually need is to display my resume accessible in the following link https://www.example.com/resume
Some of them have long permalinks and i actually hate them. (Just saying)
Upload the PDF into the website's / or assets/ directory.
To make a link for HTML:
CV
To make a link for Markdown:
[CV](<PATH>/cv.pdf)
On Chrome, this has been around for a long time and plagues webdevs to this day. There seem to be no plans to change that anytime soon because that's just the way it was built. Chrome behaves slightly different when not online, so offline/local-testing will not always produce expected result.
My answer to you, for this question, is a suggestion. In order to make it cross-browser compatible, your mode of implementation should be:
Modal or,
Lightbox
Whether or not you are using a SSG should not matter here. Look for a bootstrap or material implementation.
On the client-side, it is possible with extension. I reckon this isn't helpful to you; but I'm including this information for future readers.

main.worker.js? What's that?

I am building a PDF viewer in Ionic 2 using the Mozilla PDF Viewer but have run into a problem. I have built pdf.js in accordance with these instructions. The code generated includes this line:
var worker = new Worker(workerSrc);
Chrome is complaining on this line that it cannot find the file GET http://localhost:8100/build/main.worker.js.
Now then, I have not come across web workers before, so I'm not sure what this error means or where to find, or build, this file. I notice that the build process also yields a file called pdf.worker.js, and I have strong suspicions that this might be the file it's after, although renaming it to main.worker.js had no effect.
I'm sure this is a very simple problem if you are in the know. What am I missing?
Ok, after a little more digging, I found this which pertains more to my situation. I am using Ionic 2 and I don't know how to generate the file referenced in this line:
pdfjsLib.PDFJS.workerSrc = '../../build/webpack/pdf.worker.bundle.js';
Can anyone illuminate my dark mind?

CasperJS not finding file that is clearly there

This actually originally generated from a problem I was having running SpookyJS, but managed to nail it down to a problem with the underlying CasperJS (and based on another stackoverflow question I was directed to, possibly even a PhantomJS problem).
We determined that the command CasperJS was failing on was:
casperjs C:\wwwroot\dra\node_modules\spooky\lib\bootstrap.js --spooky_lib=C:\wwwroot\dra\node_modules\spooky\lib\ --command=casperjs --port=8081 --transport=stdio
Which generates the following:
{"jsonrpc":"2.0","method":"emit","params":["error","CasperError: CasperJS couldn't find module C:\\wwwroot\\dra\\node_modules\\spooky\\lib\\bootstrap\\stdio-server",[{"file":"C:\\casperjs\\n1k0-casperjs-bc0da16\\batchbin\\..\\bin\\bootstrap.js","line":133,"function":"_require"},{"file":"C:\\wwwroot\\dra\\node_modules\\spooky\\lib\\bootstrap.js","line":34,"function":""}]]}
At first I thought the fact that it was generating double slashes was an issue, but I've since learned that that's simply the way it spits it out. It simply can't find the file. I've tried to reference the file a few different ways, but to no avail. And, yes, the file is most definitely there. It's looking for stdio-server.js which is exactly where it's looking for it. It's also not specific to this file. In the course of my testing, I commented out that line and it failed three lines later, in the same fashion, looking for a different file.
I'm using:
CasperJS 1.0.2
PhantomJS 1.9.0
I'm desperate to get this working (preferably today since I have to demo it to my boss), so if anyone has any input on this I'd be MOST appreciative!
Thank you.
You should be able to fix this by upgrading PhantomJS to 1.9.1
Here are links to the CasperJS issue and the PhantomJS issue regarding this problem.

Getting Cocoa method completions in Sublime Text 2

I've been playing with Sublime Text 2 the last few days and was wondering if anyone out there has had any success getting Cocoa method completions working yet? Is there a plugin (or in-progress project to create one) out there?
Any general comments on using Objective-C in Chocolat or Sublime Text 2 would also be welcome.
There is an in-progress Sublime Text package that connects to clang to get autocomplete data called SublimeClang I've not managed to successfully get it to work totally with Cocoa/UIKit Dev, but here's a screenshot
and my options, that are a start
In MacVim I use a plugin called Cocoa.vim which haves useful python scripts that generates a classes and methods files for autocompletion. I didn't try so much with ST2, but may be is posible to create a sublime-package or sublime-completions file with all this data.
For the moment, I only create a sublime-completions file with some snippets. If I find a way to make this work, I will tell you.
I let my SublimeClang configuration options if helps anybody. I've already some of the autocompletions working:
"options":[
"-Wall",
"-isystem", "/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/include/",
"-isystem", "/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/include/c++/4.2.1/",
"-I/usr/lib/clang/3.1/include/**",
"-I", "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include/",
"-arch","armv7",
"-isysroot", "/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk",
"-D__IPHONE_OS_VERSION_MIN_REQUIRED=50000",
"-ferror-limit=0"
]
Answering my own question here. A quick visit to the Sublime forums didn't turn up any leads nor did Google. It looks as though method completions for Objective-C aren't currently part of the default install nor available via 3rd-party quite yet.
This user http://b.rthr.me/wp/?p=368 claims to have gotten SublimeClang working. I may report back myself once I try it...

What is the correct way to upgrade a Lazarus project?

Some months ago I installed Lazarus 0.9.28 + FPC 2.2.4 to work on a new project. Some time after it I ran into some bugs related with image loading on a TImage. After googling a bit I found some information pointing to the fact that the bugs I was facing were already solved in a later version of FPC (can't remember the link now).
So I decided to download and install a newer version. This was around January and the latest stable version was not released yet, so I choose to install the snapshot Lazarus 0.9.31-29128 + FPC 2.4.2-2011-01-20. I opened my project with the new IDE and compiled it.
Luckily the bugs I faced were gone, but I have run into an IDE (?) one. After the upgrade, when I am on the code tab of some of my forms I do not see the code formatted. Instead I only see plain text, like this:
But on some forms I see the code formatted correctly, like this:
Anyone has run into this before? If yes, could you solve it and how? Or can anyone tell me what the correct way to upgrade a Lazarus project between versions is?
It is more of a nuisance than a real problem but still I would like to solve it. Any help would be appreciated.
EDIT
I noticed that in the forms where the code shows correctly highlighted the LCLVersion in the .lfm file is 0.9.28.2, while in the forms where the code shows like plain text that property in the .lfm file is 0.9.31. Could have something to do with the problem? I tried changing the value but it did not change anything.
Thanks in advance and best regards
I don't know if this is actually causing your problem, but Lazarus keeps a set of settings in application local. ($user\AppData\Local\lazarus on my vista).
This config dir is not erased upon deinstallation, and the new installation will reuse this.
In case of strange problems, remove the config dir, and let the current installation generate a new one.