This is an XULRunner application (XULRunner 33.1) running on Ubuntu 14.04.
The XBL is here
Code: Select all
<?xml version="1.0"?>
<!DOCTYPE bindings>
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml">
<binding id="bookmarkitem">
<implementation>
<method name="test">
<![CDATA[
dump('***** hello *******');
]]>
</method>
</implementation>
</binding>
</bindings>
The XUL file
Code: Select all
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="bindings.css" type="text/css"?>
<dialog id="add-bookmark" title="Edit My Bookmarks"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
buttons="accept,cancel"
ondialogaccept="return doOK(event);">
<vbox id="list">
</vbox>
<script>
<![CDATA[
(function(){
var list = document.getElementById('list');
var item = document.createElement('bookmarkitem');
var data = window.arguments[0];
var temp;
for(let i = 0;i < data.length;i++){
temp = item.cloneNode();
temp.hello();
//original method call which caused the error
// commented out everything below until I could figure this out
//temp.setButtonAction();
/*temp.dbid = data[i].id;
temp.label = data[i].label);
dump(temp.label);
temp.url = data[i].url;
list.appendChild(temp);*/
}
})();
]]>
</script>
</dialog>
The CSS binding is below although the action binding (which I commented out and did not post) had content which was visible when this code was run so it's not like it isn't linking to the binding.
Code: Select all
bookmarkitem{
-moz-binding: url("chrome://nameofmyapp/content/bindings/bookmark.xbl#bookmarkitem");
}