Permalink
Browse files

Adding the Web Intents Debugger panel

  • Loading branch information...
1 parent 07f4f55 commit b75a0a87738a92ac67a2ae10bdb12cbb3e4b5525 @PaulKinlan committed Aug 21, 2012
@@ -0,0 +1,7 @@
+var onPanelCreated = function(panel) {
+};
+
+chrome.devtools.panels.create("Intent",
+ "webintents32.png",
+ "panel.html",
+ onPanelCreated);
@@ -0,0 +1 @@
+<script src="background.js"></script>
@@ -0,0 +1,23 @@
+window.addEventListener("load", function() {
+ chrome.devtools.inspectedWindow.eval(
+ "window.webkitIntent",
+ function(result, isException) {
+ if (isException || !!result == false) {
+ console.log("The page does not have any intent data");
+ var nodataEl = document.getElementById("nodata");
+ nodataEl.style.display = "block";
+ }
+ else {
+ var intentEl = document.getElementById("intent");
+ intentEl.style.display = "block";
+ console.log("The page has been invoked with the " + result + " intent");
+ var action = document.getElementById("action");
+ var type = document.getElementById("type");
+ var data = document.getElementById("data");
+ action.textContent = result.action;
+ type.textContent = result.type;
+ data.textContent = result.data;
+ }
+ }
+ );
+}, false);
@@ -0,0 +1,12 @@
+{
+ "name": "Intents Debugger",
+ "description" : "Debugger Panel for Chrome",
+ "devtools_page": "devtools.html",
+ "icons": {
+ "16": "webintents16.png",
+ "48": "webintents48.png",
+ "128": "webintents128.png"
+ },
+ "version": "0.0.0.4",
+ "manifest_version": 2
+}
@@ -0,0 +1,76 @@
+<html>
+ <head>
+ <script src="intent.js"></script>
+ <style>
+ table {
+ border-spacing: 0;
+ }
+
+ th {
+ background: -webkit-gradient(linear, left top, left bottom, from(#ECECEC), to(#D9D9D9));
+ border-bottom: 1px solid #A3A3A3;
+ height: 30px;
+ font-family: Lucida Grande, sans-serif;
+ font-size: 11px;
+ font-weight: bold;
+ border-spacing: 0;
+ }
+
+ td.key, th.key {
+ font-family: Lucida Grande, sans-serif;
+ font-size: 11px;
+ font-weight: bold;
+ border-right: solid 1px #ccc;
+ }
+
+ td.value {
+ font-family: Lucida Grande, sans-serif;
+ font-size: 11px;
+ }
+
+ thead {
+ border-spacing: 0;
+ }
+
+ table {
+ width: 100%;
+ margin: 0;
+ }
+
+ #nodata, #intent {
+ display: none
+ }
+
+ #nodata {
+ font-family: Lucida Grande, sans-serif;
+ font-size: 18px;
+ font-weight: bold;
+ padding: 50px;
+ color: black;
+ margin: 10px;
+ box-shadow: 0 0 5px black;
+ background-color: #eee;
+ }
+
+ body { margin: 0; padding: 0 }
+ </style>
+ </head>
+ <body>
+ <div id="nodata">There is no intent data available.</div>
+ <table id="intent">
+ <colgroup style="width: 150px; border-right: 1px solid #ccc;"></colgroup>
+ <colgroup style=""></colgroup>
+ <thead>
+ <tr>
+ <th class="key"></th>
+ <th>Value</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr><td class="key">Action</td><td id="action"></td></tr>
+ <tr><td class="key">Type</td><td id="type"></td></tr>
+ <tr><td class="key">Data</td><td id="data"></td></tr>
+ <tbody>
+ </table>
+ </body>
+</html>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b75a0a8

Please sign in to comment.