| OLD | NEW |
| 1 <import src="/sky/framework/xmlhttprequest.sky" as="XMLHttpRequest" /> |
| 1 <script> | 2 <script> |
| 2 function Page() { | 3 function Page(delegate) { |
| 4 this.delegate_ = delegate; |
| 3 } | 5 } |
| 4 | 6 |
| 5 Page.prototype.enable = function() { | 7 Page.prototype.enable = function() { |
| 6 }; | 8 }; |
| 7 | 9 |
| 8 Page.prototype.canScreencast = function() { | 10 Page.prototype.canScreencast = function() { |
| 9 return { | 11 return { |
| 10 result: false | 12 result: false |
| 11 }; | 13 }; |
| 12 }; | 14 }; |
| 13 | 15 |
| 14 Page.prototype.canEmulate = function() { | 16 Page.prototype.canEmulate = function() { |
| 15 return { | 17 return { |
| 16 result: false | 18 result: false |
| 17 }; | 19 }; |
| 18 }; | 20 }; |
| 19 | 21 |
| 22 Page.prototype.getResourceContent = function(params, message_id) { |
| 23 var request = new XMLHttpRequest; |
| 24 request.onload = function() { |
| 25 var message = { |
| 26 'content' : request.responseText, |
| 27 }; |
| 28 this.delegate_.sendResponse(message_id, message); |
| 29 }.bind(this); |
| 30 request.open("GET", params.url); |
| 31 request.send(); |
| 32 |
| 33 return this.delegate_.ASYNC_RESPONSE; |
| 34 }; |
| 35 |
| 20 Page.prototype.getResourceTree = function() { | 36 Page.prototype.getResourceTree = function() { |
| 21 // Unclear if this is all needed, but if we don't return something here | 37 // Unclear if this is all needed, but if we don't return something here |
| 22 // the inspector hits an exception in WebInspector.ResourceTreeModel. | 38 // the inspector hits an exception in WebInspector.ResourceTreeModel. |
| 23 return { | 39 return { |
| 24 "frameTree": { | 40 "frameTree": { |
| 25 "frame": { | 41 "frame": { |
| 26 "id": 1, | 42 "id": "1", |
| 27 "loaderId": 1, | 43 "loaderId": "1", |
| 28 "url": document.URL, | 44 "url": document.URL, |
| 29 "mimeType": "text/html", | 45 "mimeType": "text/html", |
| 30 "securityOrigin": document.URL, | 46 "securityOrigin": document.URL, |
| 31 }, | 47 }, |
| 32 "resources": [], // FIXME | 48 "resources": [], // FIXME |
| 33 } | 49 } |
| 34 }; | 50 }; |
| 35 }; | 51 }; |
| 36 | 52 |
| 37 module.exports = Page; | 53 module.exports = Page; |
| 38 </script> | 54 </script> |
| OLD | NEW |