Revert "[CB-2305] Add spec tests for InAppBrowser.insertCSS and InAppBrowser.executeScript APIs"
This reverts commit dbf631c43a76181e132a950a445e452ab44adf1e.
diff --git a/inappbrowser/index.html b/inappbrowser/index.html
index 51e1af3..cfa68b9 100644
--- a/inappbrowser/index.html
+++ b/inappbrowser/index.html
@@ -30,7 +30,7 @@
<script type="text/javascript" charset="utf-8" src="../cordova.js"></script>
- <script type="text/javascript" charset="utf-8">
+<script type="text/javascript" charset="utf-8">
var deviceReady = false;
@@ -62,38 +62,8 @@
}
);
}
+</script>
- function openWithStyle(url, cssUrl) {
- var iab = window.open(url, '_blank', 'location=yes');
- if (cssUrl) {
- iab.addEventListener('loadstop', function(event) {
- iab.insertCSS({file: cssUrl});
- });
- } else {
- iab.addEventListener('loadstop', function(event) {
- iab.insertCSS({code:'#style-update-literal { \ndisplay: block !important; \n}'});
- });
- }
- }
-
- function openWithScript(url, jsUrl) {
- var iab = window.open(url, '_blank', 'location=yes');
- if (jsUrl) {
- iab.addEventListener('loadstop', function(event) {
- iab.executeScript({file: jsUrl});
- });
- } else {
- iab.addEventListener('loadstop', function(event) {
- var code = '(function(){\n' +
- ' var header = document.getElementById("header");\n' +
- ' header.innerHTML = "Script literal successfully injected";\n' +
- ' return {result:header};\n' +
- '})()';
- iab.executeScript({code:code});
- });
- }
- }
- </script>
</head>
<body onload="init();" id="stage" class="theme">
@@ -132,12 +102,6 @@
<div class="btn large" onclick="openWithErrorHandler('x-ttp://www.invalid.com/');">Invalid Scheme</div>
<div class="btn large" onclick="openWithErrorHandler('http://www.inv;alid.com/');">Invalid Host</div>
<div class="btn large" onclick="openWithErrorHandler('nonexistent.html');">Missing File</div>
- <h1>CSS / JS Injection</h1>
- <div class="btn large" onclick="window.open('inject.html', '_blank');">Original Document</div>
- <div class="btn large" onclick="openWithStyle('inject.html','inject.css');">CSS File Injection</div>
- <div class="btn large" onclick="openWithStyle('inject.html');">CSS Literal Injection</div>
- <div class="btn large" onclick="openWithScript('inject.html', 'inject.js');">Script File Injection</div>
- <div class="btn large" onclick="openWithScript('inject.html');">Script Literal Injection</div>
<h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
</body>
-</html>
+</html>
diff --git a/inappbrowser/inject.css b/inappbrowser/inject.css
deleted file mode 100644
index 8e9904d..0000000
--- a/inappbrowser/inject.css
+++ /dev/null
@@ -1,3 +0,0 @@
-#style-update-file {
- display: block !important;
-}
diff --git a/inappbrowser/inject.html b/inappbrowser/inject.html
deleted file mode 100644
index 2dacafe..0000000
--- a/inappbrowser/inject.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!DOCTYPE html>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-
-<html>
- <head>
- <meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,maximum-scale=1.0,initial-scale=1.0" />
- <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1 -->
- <title>Cordova Mobile Spec</title>
- <link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no title" charset="utf-8">
- <script type="text/javascript" charset="utf-8" src="../cordova.js"></script>
- </head>
- <body id="stage" class="theme">
- <h1 id="header">InAppBrowser - Script / Style Injection Test</h1>
- <h2 id="style-update-file" style="display:none">Style updated from file</h2>
- <h2 id="style-update-literal" style="display:none">Style updated from literal</h2>
- </body>
- <script>
- function updateUserAgent() {
- document.getElementById("u-a").textContent = navigator.userAgent;
- }
- updateUserAgent();
- window.setInterval(updateUserAgent, 1500);
- </script>
-</html>
diff --git a/inappbrowser/inject.js b/inappbrowser/inject.js
deleted file mode 100644
index 982c8bd..0000000
--- a/inappbrowser/inject.js
+++ /dev/null
@@ -1,2 +0,0 @@
-var d = document.getElementById("header")
-d.innerHTML = "Script file successfully injected";