Index: chrome/common/extensions/docs/examples/api/devtools/inspectedWindow/chrome-preprocessor/Panel/PreprocessorPanel.js |
diff --git a/chrome/common/extensions/docs/examples/api/devtools/inspectedWindow/chrome-preprocessor/Panel/PreprocessorPanel.js b/chrome/common/extensions/docs/examples/api/devtools/inspectedWindow/chrome-preprocessor/Panel/PreprocessorPanel.js |
deleted file mode 100644 |
index 2cdf41ab5195de061549e8564784bcef3c7e51f7..0000000000000000000000000000000000000000 |
--- a/chrome/common/extensions/docs/examples/api/devtools/inspectedWindow/chrome-preprocessor/Panel/PreprocessorPanel.js |
+++ /dev/null |
@@ -1,68 +0,0 @@ |
-// Copyright 2013 The Chromium Authors. All rights reserved. |
-// Use of this source code is governed by a BSD-style license that can be |
-// found in the LICENSE file. |
- |
-(function() { |
- |
-// This function is converted to a string and becomes the preprocessor |
-function preprocessor(source, url, listenerName) { |
- url = url ? url : '(eval)'; |
- url += listenerName ? '_' + listenerName : ''; |
- var prefix = 'window.__preprocessed = window.__preprocessed || [];\n'; |
- prefix += 'window.__preprocessed.push(\'' + url +'\');\n'; |
- var postfix = '\n//# sourceURL=' + url + '.js\n'; |
- return prefix + source + postfix; |
-} |
- |
-function extractPreprocessedFiles(onExtracted) { |
- var expr = 'window.__preprocessed'; |
- function onEval(files, isException) { |
- if (isException) |
- throw new Error('Eval failed for ' + expr, isException.value); |
- onExtracted(files); |
- } |
- chrome.devtools.inspectedWindow.eval(expr, onEval); |
-} |
- |
-function reloadWithPreprocessor(injectedScript) { |
- var options = { |
- ignoreCache: true, |
- userAgent: undefined, |
- injectedScript: '(' + injectedScript + ')()', |
- preprocessingScript: '(' + preprocessor + ')' |
- }; |
- chrome.devtools.inspectedWindow.reload(options); |
-} |
- |
-function demoPreprocessor() { |
- function onLoaded() { |
- extractPreprocessedFiles(updateUI); |
- } |
- var loadMonitor = new InspectedWindow.LoadMonitor(onLoaded); |
- reloadWithPreprocessor(loadMonitor.injectedScript); |
-} |
- |
-function listen() { |
- var reloadButton = document.querySelector('.reload-button'); |
- reloadButton.addEventListener('click', demoPreprocessor); |
-} |
- |
-window.addEventListener('load', listen); |
- |
-function createRow(url) { |
- var li = document.createElement('li'); |
- li.textContent = url; |
- return li; |
-} |
- |
-function updateUI(preprocessedFiles) { |
- var rowContainer = document.querySelector('.js-preprocessed-urls'); |
- rowContainer.innerHTML = ''; |
- preprocessedFiles.forEach(function(url) { |
- rowContainer.appendChild(createRow(url)); |
- }); |
-} |
- |
-})(); |
- |
- |