RichWidgetsExtension Extension Permission denied for to get property

RichWidgetsExtension Extension Permission denied for to get property

  
I am new to outsystems. And trying to run in Firefox the code using RichWidgetsExtension Extension and RunJavascript:
"if (parent.RichWidgets_Feedback_Message_notifyWidget)
 parent.OsNotifyWidget(parent.RichWidgets_Feedback_Message_notifyWidget,'" + Session.Feedback_Message.Feedback_Message.MessageType+ " " +EncodeJavaScript(MessageText) + "');
else
 OsNotifyWidget(RichWidgets_Feedback_Message_notifyWidget,'');
"
I receive error:
An exception occurred in the client script.
Error: Permission denied for to get property
Window.RichWidgets_Feedback_Message_notifyWidget from .

I changed to use just
"
  OsNotifyWidget(RichWidgets_Feedback_Message_notifyWidget, '" + Session.Feedback_Message.Feedback_Message.MessageType + " " + EncodeJavaScript(MessageText) + "');
"
It is working.

Questions: Is this the best solution?