issue491: duckduckgo page mode does not work on xulrunner >= v 34

Priority: bug Status: chatting
Files
File name Uploaded Type Edit Remove
duckduckgo.patch kalleb, 2015-04-11.14:02:09 text/x-patch
Messages
msg1259 (view) Author: kalleb Date: 2015-04-09.18:42:58
1. Use Xulrunner v34.0.5.
2. Enable duckduckgo page mode in your conkerorrc.js - require("duckduckgo");
3. Do a search on duckduck go with the duckduckgo webjump
4. Press 'j' to navigate down in the search results

Expected
Navigation works

Actual
Nothing happens and the following error is logged:
Error: TypeError: window.nkda is not a function

I have investigate this some more and the problem can be found in the duckduckgo_call_command function.
The buffer.top_frame.wrappedJSObject does not expose the page defined functions on the window object.
This is true both outside and inside the sandbox.
This works fine in version 33.1.1 of the xulrunner package.

Don't know if this is a xulrunner bug or conkeror bug but something changed between the above mentioned
versions.

Note that this is not restricted to duckduckgo.com and it can easily be reproduced by creating your own
test case that tries to access paged defined global functions.
msg1260 (view) Author: kalleb Date: 2015-04-11.14:02:09
This can apparently be fixed by not assigning the window to the sandbox but instead add the function
objects directly to the sandbox. Seems as assigning a window to a sandbox somehow cripples the window object.

I attach a patch that solves the problem.

This assigns all nkfoo functions to the sandbox that can then be used by the script. I can't find
anything on the conkeror.org page about procedures external patches so I hope that this is alright.
History
Date User Action Args
2015-04-11 14:02:09kallebsetfiles: + duckduckgo.patch
status: unread -> chatting
messages: + msg1260
2015-04-09 18:42:58kallebcreate