Skip to content

Commit feb946f

Browse files
committed
Start new plugin
0 parents  commit feb946f

File tree

9 files changed

+183
-0
lines changed

9 files changed

+183
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[BUG]"
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
16+
17+
**Expected behavior**
18+
A clear and concise description of what you expected to happen.
19+
20+
**Logs**
21+
<details>
22+
<pre>[Please insert any logs here]</pre>
23+
</details>
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: feature-request
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020 GEDYS IntraWare GmbH
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# cordova-plugin-webview-proxy
2+
3+
## Experimental plugin to proxy requests on iOS

package.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "cordova-plugin-webview-proxy",
3+
"version": "0.0.1",
4+
"description": "Switch wenbview implementation",
5+
"cordova": {
6+
"id": "cordova-plugin-webview-proxy",
7+
"platforms": [
8+
"ios"
9+
]
10+
},
11+
"repository": {
12+
"type": "git",
13+
"url": "https://github.com/GEDYSIntraWare/cordova-plugin-webview-proxy.git"
14+
},
15+
"keywords": [
16+
"ecosystem:cordova",
17+
"cordova-ios",
18+
"cordova",
19+
"webview",
20+
"wkwebview",
21+
"ios"
22+
],
23+
"scripts": {
24+
"test": "paramedic.."
25+
},
26+
"author": "GEDYS IntraWare GmbH",
27+
"license": "MIT",
28+
"bugs": {
29+
"url": "https://github.com/GEDYSIntraWare/cordova-plugin-webview-proxy/issues"
30+
},
31+
"homepage": "https://github.com/GEDYSIntraWare/cordova-plugin-webview-proxy"
32+
}

plugin.xml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
id="cordova-plugin-webview-proxy"
5+
version="0.0.1">
6+
7+
<name>cordova-plugin-webview-proxy</name>
8+
<author>GEDYS IntraWare GmbH</author>
9+
<description>Plugin to proxy requests on iOS</description>
10+
<license>MIT</license>
11+
<engines>
12+
<engine name="cordova-ios" version=">=4.5.5" />
13+
</engines>
14+
<repo>https://github.com/GEDYSIntraWare/cordova-plugin-webview-proxy.git</repo>
15+
<issue>https://github.com/GEDYSIntraWare/cordova-plugin-webview-proxy/issues</issue>
16+
<keywords>cordova,webview,wkwebview,ios</keywords>
17+
18+
<js-module src="www/WebviewProxy.js" name="WebviewProxy">
19+
<clobbers target="WebviewProxy"/>
20+
</js-module>
21+
22+
<!-- ios -->
23+
<platform name="ios">
24+
<config-file target="config.xml" parent="/*">
25+
<feature name="WebviewProxy">
26+
<param name="ios-package" value="WebviewProxy" />
27+
<param name="onload" value="true" />
28+
</feature>
29+
</config-file>
30+
<source-file src="src/ios/WebviewProxy.m" />
31+
</platform>
32+
</plugin>

src/ios/WebviewProxy.m

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#import <Cordova/CDV.h>
2+
#import <WebKit/WebKit.h>
3+
#import <objc/runtime.h>
4+
5+
@interface WebviewProxy : CDVPlugin {
6+
7+
}
8+
9+
@end
10+
11+
@implementation WebviewProxy
12+
13+
- (BOOL) handleSchemeURL: (id <WKURLSchemeTask>)urlSchemeTask {
14+
NSLog(@"New plugin");
15+
return YES;
16+
}
17+
18+
- (void) pluginInitialize {
19+
NSLog(@"Proxy active on /_https_proxy");
20+
}
21+
22+
- (void) load:(CDVInvokedUrlCommand*)command {
23+
NSLog(@"dummy");
24+
}
25+
@end

www/WebviewProxy.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/* global cordova */
2+
3+
function WebviewProxy() {
4+
}
5+
6+
WebviewProxy.prototype.load = function (name, successCallback, errorCallback) {
7+
cordova.exec(
8+
successCallback,
9+
errorCallback,
10+
"WebviewProxy",
11+
"load",
12+
[name]
13+
);
14+
};
15+
16+
WebviewProxy.prototype.setHostname = function (name, successCallback, errorCallback) {
17+
cordova.exec(
18+
successCallback,
19+
errorCallback,
20+
"WebviewProxy",
21+
"setHostname",
22+
[name]
23+
);
24+
};
25+
26+
module.exports = new WebviewProxy();

0 commit comments

Comments
 (0)