In 2.4.2 when the bookmarklet is used, the following code gives an permission denied exception in firefox on the bold part of the following code:
if( window.opener
&& [b]window.opener.b2evo_Callbacks[/b]
&& ( typeof window.opener.b2evo_Callbacks != "undefined" ) )
{ // callback in parent document (e.g. "Files" popup)
if( window.opener.b2evo_Callbacks.trigger_callback( "wrap_selection_for_"+myField.id, hook_params ) )
{
return;
}
}
Read here for more info:
http://forums.b2evolution.net/viewtopic.php?t=15898
I've developed a little fix that fixes this problem. Just replace the above pasted code with the following code in functions.js:
//It appears that in the bookmarklet in firefox window.opener not is null.
//Unfortunately firefox does not allow any reading / writing from the
//window.opener object and gives an Persmission Denied error.
//to avoid this error being raised, check if we are in bookmarklet mode
//and disable the opener access instead.
if (window.location.toString().indexOf('&mode=bookmarklet') ==-1) {
if( window.opener
&& window.opener.b2evo_Callbacks
&& ( typeof window.opener.b2evo_Callbacks != "undefined" ) )
{ // callback in parent document (e.g. "Files" popup)
if( window.opener.b2evo_Callbacks.trigger_callback( "wrap_selection_for_"+myField.id, hook_params ) )
{
return;
}
}
}
Hi, this happens in the editor (without bookmarklet involved). See my report here: http://forums.b2evolution.net/viewtopic.php?t=13150&highlight=b2evocallbacks
Do you think this fix will work for that problem? I don't think so, but I don't know much Javascript, so I better ask before tweaking the js source code.