├── .editorconfig ├── .github ├── issue_template.md └── pull_request_template.md ├── .gitignore ├── .prettierrc.json ├── .travis.yml ├── .vscode └── settings.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── demo ├── .editorconfig ├── .gitignore ├── .prettierignore ├── App_Resources │ ├── Android │ │ ├── app.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── res │ │ │ ├── drawable-hdpi │ │ │ ├── background.png │ │ │ └── logo.png │ │ │ ├── drawable-ldpi │ │ │ ├── background.png │ │ │ └── logo.png │ │ │ ├── drawable-mdpi │ │ │ ├── background.png │ │ │ └── logo.png │ │ │ ├── drawable-nodpi │ │ │ └── splash_screen.xml │ │ │ ├── drawable-xhdpi │ │ │ ├── background.png │ │ │ └── logo.png │ │ │ ├── drawable-xxhdpi │ │ │ ├── background.png │ │ │ └── logo.png │ │ │ ├── drawable-xxxhdpi │ │ │ ├── background.png │ │ │ └── logo.png │ │ │ ├── drawable │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ └── ic_launcher.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-v21 │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ │ ├── values-v29 │ │ │ └── styles.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── ic_launcher_background.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ └── iOS │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── icon-1024.png │ │ │ ├── icon-20.png │ │ │ ├── icon-20@2x.png │ │ │ ├── icon-20@3x.png │ │ │ ├── icon-29.png │ │ │ ├── icon-29@2x.png │ │ │ ├── icon-29@3x.png │ │ │ ├── icon-40.png │ │ │ ├── icon-40@2x.png │ │ │ ├── icon-40@3x.png │ │ │ ├── icon-60@2x.png │ │ │ ├── icon-60@3x.png │ │ │ ├── icon-76.png │ │ │ ├── icon-76@2x.png │ │ │ └── icon-83.5@2x.png │ │ ├── Contents.json │ │ ├── LaunchScreen.AspectFill.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchScreen-AspectFill.png │ │ │ ├── LaunchScreen-AspectFill@2x.png │ │ │ └── LaunchScreen-AspectFill@3x.png │ │ └── LaunchScreen.Center.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchScreen-Center.png │ │ │ ├── LaunchScreen-Center@2x.png │ │ │ └── LaunchScreen-Center@3x.png │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── build.xcconfig ├── app │ ├── app-root.xml │ ├── app.css │ ├── app.ts │ ├── assets │ │ └── test-data │ │ │ ├── css │ │ │ └── local-stylesheet.css │ │ │ ├── html │ │ │ ├── css-not-predefined.html │ │ │ ├── css-predefined-link-tags.html │ │ │ ├── empty.html │ │ │ ├── javascript-calls-x-local.html │ │ │ └── javascript-calls.html │ │ │ └── js │ │ │ └── local-javascript.js │ ├── main-page.ts │ ├── main-page.xml │ └── main-view-model.ts ├── nativescript.config.ts ├── package.json ├── references.d.ts ├── tsconfig.json ├── webpack.config.js └── www │ └── index.html ├── native-src ├── android │ ├── .gitignore │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── webviewinterface │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── dk │ │ │ └── nota │ │ │ └── webviewinterface │ │ │ └── WebViewBridgeInterface.java │ │ └── res │ │ └── values │ │ └── strings.xml ├── build-android.sh ├── build-ios.sh └── ios │ ├── .gitignore │ └── NotaWebViewExt │ ├── NotaWebViewExt.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── NotaWebViewExt.xcscheme │ └── xcuserdata │ │ └── b044552.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist │ ├── NotaWebViewExt │ ├── Constants.swift │ ├── Info.plist │ ├── NotaWebViewExt.h │ └── WKWebviewCustomSchemeHandler.swift │ └── NotaWebViewExtTests │ ├── Info.plist │ └── NotaWebViewExtTests.swift ├── patches └── apply-patches.sh ├── publish ├── pack.sh ├── package-lock.json ├── package.json ├── publish-alpha.sh └── publish.sh ├── src ├── .gitignore ├── .npmignore ├── .prettierignore ├── angular │ ├── index.ts │ ├── package.json.base │ └── tsconfig.angular.json ├── make-bridge-loader.ts ├── nativescript-webview-bridge-loader.ts.tmpl ├── package.json ├── platforms │ ├── android │ │ └── webviewinterface.aar │ └── ios │ │ └── NotaWebViewExt.xcframework │ │ ├── Info.plist │ │ ├── ios-arm64_armv7 │ │ └── NotaWebViewExt.framework │ │ │ ├── Headers │ │ │ ├── NotaWebViewExt-Swift.h │ │ │ └── NotaWebViewExt.h │ │ │ ├── Info.plist │ │ │ ├── Modules │ │ │ ├── NotaWebViewExt.swiftmodule │ │ │ │ ├── arm.swiftdoc │ │ │ │ ├── arm.swiftinterface │ │ │ │ ├── arm64-apple-ios.swiftdoc │ │ │ │ ├── arm64-apple-ios.swiftinterface │ │ │ │ ├── arm64.swiftdoc │ │ │ │ ├── arm64.swiftinterface │ │ │ │ ├── armv7-apple-ios.swiftdoc │ │ │ │ ├── armv7-apple-ios.swiftinterface │ │ │ │ ├── armv7.swiftdoc │ │ │ │ └── armv7.swiftinterface │ │ │ └── module.modulemap │ │ │ ├── NotaWebViewExt │ │ │ └── _CodeSignature │ │ │ └── CodeResources │ │ └── ios-arm64_i386_x86_64-simulator │ │ └── NotaWebViewExt.framework │ │ ├── Headers │ │ ├── NotaWebViewExt-Swift.h │ │ └── NotaWebViewExt.h │ │ ├── Info.plist │ │ ├── Modules │ │ ├── NotaWebViewExt.swiftmodule │ │ │ ├── arm64-apple-ios-simulator.swiftdoc │ │ │ ├── arm64-apple-ios-simulator.swiftinterface │ │ │ ├── arm64.swiftdoc │ │ │ ├── arm64.swiftinterface │ │ │ ├── i386-apple-ios-simulator.swiftdoc │ │ │ ├── i386-apple-ios-simulator.swiftinterface │ │ │ ├── i386.swiftdoc │ │ │ ├── i386.swiftinterface │ │ │ ├── x86_64-apple-ios-simulator.swiftdoc │ │ │ ├── x86_64-apple-ios-simulator.swiftinterface │ │ │ ├── x86_64.swiftdoc │ │ │ └── x86_64.swiftinterface │ │ └── module.modulemap │ │ ├── NotaWebViewExt │ │ └── _CodeSignature │ │ └── CodeResources ├── polyfills │ └── .gitkeep ├── tsconfig.aot.json ├── tsconfig.json ├── tsfmt.json ├── types │ ├── android │ │ └── webviewinterface.d.ts │ ├── ios │ │ └── NotaWebViewExt.d.ts │ └── url.d.ts ├── vue │ ├── index.d.ts │ └── index.ts ├── webview-ext-common.ts ├── webview-ext.android.ts ├── webview-ext.d.ts └── webview-ext.ios.ts ├── tslint.json ├── unittest ├── .editorconfig ├── .gitignore ├── .prettierignore ├── App_Resources │ ├── Android │ │ ├── app.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── res │ │ │ ├── drawable-hdpi │ │ │ ├── background.png │ │ │ └── logo.png │ │ │ ├── drawable-ldpi │ │ │ ├── background.png │ │ │ └── logo.png │ │ │ ├── drawable-mdpi │ │ │ ├── background.png │ │ │ └── logo.png │ │ │ ├── drawable-nodpi │ │ │ └── splash_screen.xml │ │ │ ├── drawable-xhdpi │ │ │ ├── background.png │ │ │ └── logo.png │ │ │ ├── drawable-xxhdpi │ │ │ ├── background.png │ │ │ └── logo.png │ │ │ ├── drawable-xxxhdpi │ │ │ ├── background.png │ │ │ └── logo.png │ │ │ ├── drawable │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ └── ic_launcher.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-v21 │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ │ ├── values-v29 │ │ │ └── styles.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── ic_launcher_background.xml │ │ │ └── styles.xml │ └── iOS │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── icon-1024.png │ │ │ ├── icon-20.png │ │ │ ├── icon-20@2x.png │ │ │ ├── icon-20@3x.png │ │ │ ├── icon-29.png │ │ │ ├── icon-29@2x.png │ │ │ ├── icon-29@3x.png │ │ │ ├── icon-40.png │ │ │ ├── icon-40@2x.png │ │ │ ├── icon-40@3x.png │ │ │ ├── icon-60@2x.png │ │ │ ├── icon-60@3x.png │ │ │ ├── icon-76.png │ │ │ ├── icon-76@2x.png │ │ │ └── icon-83.5@2x.png │ │ ├── Contents.json │ │ ├── LaunchScreen.AspectFill.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchScreen-AspectFill.png │ │ │ ├── LaunchScreen-AspectFill@2x.png │ │ │ └── LaunchScreen-AspectFill@3x.png │ │ └── LaunchScreen.Center.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchScreen-Center.png │ │ │ ├── LaunchScreen-Center@2x.png │ │ │ └── LaunchScreen-Center@3x.png │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── build.xcconfig ├── app │ ├── app-root.xml │ ├── app.css │ ├── app.ts │ ├── assets │ │ ├── css │ │ │ └── local-stylesheet.css │ │ ├── html │ │ │ ├── css-not-predefined.html │ │ │ ├── css-predefined-link-tags.html │ │ │ ├── empty.html │ │ │ ├── javascript-calls-x-local.html │ │ │ ├── javascript-calls.html │ │ │ ├── test with spaces.html │ │ │ └── test.html │ │ └── js │ │ │ └── local-javascript.js │ ├── main-page.ts │ ├── main-page.xml │ ├── main-view-model.ts │ └── tests │ │ └── example.ts ├── karma.conf.js ├── nativescript.config.ts ├── package.json ├── references.d.ts ├── tsconfig.json └── webpack.config.js └── www-src ├── .prettierignore ├── LICENSE ├── metadata-view-port.ts ├── ns-webview-bridge.ts ├── package-lock.json ├── package.json └── tsconfig.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 4 7 | end_of_line = lf 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | ### Make sure to check the demo app(s) for sample usage 2 | 3 | ### Make sure to check the existing issues in this repository 4 | 5 | ### If the demo apps cannot help and there is no issue for your problem, tell us about it 6 | Please, ensure your title is less than 63 characters long and starts with a capital 7 | letter. 8 | 9 | ### Which platform(s) does your issue occur on? 10 | - iOS/Android/Both 11 | - iOS/Android versions 12 | - emulator or device. What type of device? Which modal of device? 13 | 14 | ### Please, provide the following version numbers that your issue occurs with: 15 | 16 | - CLI: (run `tns --version` to fetch it) 17 | - iOS: XCode version. 18 | - nodejs: (run `node --version` to fetch it) 19 | - tns-core-modules: (run `npm ls tns-core-modules` in your project to fetch it.) 20 | - Runtime(s): (look for the `"tns-android"` and `"tns-ios"` properties in the `package.json` file of your project) 21 | - Plugin(s): (look for the version numbers in the `package.json` file of your 22 | project and paste your dependencies and devDependencies here) 23 | 24 | ### Please, tell us how to recreate the issue in as much detail as possible. 25 | Describe the steps to reproduce it. 26 | 27 | ### Is there any code involved? 28 | Please provide the smallest possible project needed to demonstrate the problem. 29 | It is very difficult to debug issues with small code snippets. 30 | 31 | If there is JavaScript code invalued inside the webview, this needs to be provided with the project. 32 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | ## PR Checklist 11 | 12 | - [ ] The PR title follows our guidelines: https://github.com/Notalib/nativescript-webview-ext/blob/master/CONTRIBUTING.md#commit-messages. 13 | - [ ] There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it. 14 | - [ ] All existing tests are passing. 15 | - [ ] On Android 16 | - [ ] On iOS 9 17 | - [ ] On iOS 10 18 | - [ ] On iOS 11 19 | - [ ] On iOS 12+ 20 | - [ ] Tests for the changes are included 21 | 22 | ## What is the current behavior? 23 | 24 | 25 | ## What is the new behavior? 26 | 27 | 28 | Fixes/Implements/Closes #[Issue Number]. 29 | 30 | 31 | 32 | 41 | 42 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .idea 3 | .DS_Store 4 | *.js 5 | *.js.map 6 | *.log 7 | src/*.d.ts 8 | !src/index.d.ts 9 | !src/references.d.ts 10 | !src/scripts/*.js 11 | !seed-tests/*.js 12 | seed-tests/seed-copy/**/*.* 13 | seed-tests/seed-copy-new-git-repo/**/*.* 14 | !demo/karma.conf.js 15 | demo/*.d.ts 16 | !demo/references.d.ts 17 | demo/lib 18 | demo/platforms 19 | node_modules 20 | publish/src 21 | publish/package 22 | demo/report/report.html 23 | demo/report/stats.json 24 | !package-lock.json 25 | typings 26 | tests/test-runner/index.d.ts 27 | tests/tsconfig.tns.json 28 | **/*.metadata.json 29 | src/angular/index.d.ts 30 | UserInterfaceState.xcuserstate 31 | Podfile.lock 32 | .migration_backup/ 33 | .update_backup 34 | package-lock.json 35 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "always", 3 | "bracketSpacing": true, 4 | "printWidth": 160, 5 | "semi": true, 6 | "singleQuote": false, 7 | "tabWidth": 4, 8 | "trailingComma": "all" 9 | } 10 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | matrix: 2 | include: 3 | - stage: "Lint" 4 | language: node_js 5 | os: linux 6 | node_js: "8" 7 | script: cd src && npm run ci.lint 8 | - stage: "Build /w Webpack" 9 | os: osx 10 | env: 11 | - Platform="iOS" 12 | osx_image: xcode10.2 13 | language: node_js 14 | node_js: "8" 15 | jdk: oraclejdk8 16 | script: 17 | - cd src && npm run ci.test.android 18 | - language: android 19 | os: linux 20 | env: 21 | - Platform="Android" 22 | jdk: oraclejdk8 23 | before_install: nvm install 8 24 | script: 25 | - cd src && npm run ci.test.ios 26 | # TODO: E2E tests 27 | # - os: linux 28 | # language: android 29 | # dist: precise 30 | # sudo: required 31 | # jdk: oraclejdk8 32 | # before_script: 33 | # - echo no | android create avd --force -n test -t android-21 -b armeabi-v7a 34 | # - emulator -avd test -no-audio -no-window & 35 | # - android-wait-for-emulator 36 | # before_install: 37 | # - nvm install 6 38 | # script: cd src && npm run test.android 39 | 40 | android: 41 | components: 42 | - tools 43 | - platform-tools 44 | - build-tools-28.0.3 45 | - android-28 46 | - extra-android-m2repository 47 | 48 | before_cache: 49 | - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock 50 | 51 | cache: 52 | directories: 53 | - .nvm 54 | - $HOME/.gradle/caches/ 55 | - $HOME/.gradle/wrapper/ 56 | 57 | before_install: 58 | - sudo pip install --upgrade pip 59 | - sudo pip install six 60 | 61 | install: 62 | - echo no | npm install -g nativescript 63 | - tns usage-reporting disable 64 | - tns error-reporting disable 65 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[typescript]": { 3 | "editor.formatOnSave": true, 4 | "files.trimTrailingWhitespace": true 5 | }, 6 | "[javascript]": { 7 | "editor.formatOnSave": true, 8 | "files.trimTrailingWhitespace": true 9 | }, 10 | "[css]": { 11 | "editor.formatOnSave": true, 12 | "files.trimTrailingWhitespace": true 13 | }, 14 | "[scss]": { 15 | "editor.formatOnSave": true, 16 | "files.trimTrailingWhitespace": true 17 | }, 18 | "[html]": { 19 | "editor.formatOnSave": true, 20 | "files.trimTrailingWhitespace": true 21 | }, 22 | "files.watcherExclude": { 23 | "{demo,unittest}/platforms": true, 24 | "{demo,unittest}/platforms/**/*": true, 25 | ".git/objects/**": true, 26 | ".git/subtree-cache/**": true, 27 | "{demo,unittest,www-src,src}/node_modules/**/*": true, 28 | "{demo,unittest,www-src,src}/node_modules": true, 29 | "**/*.d.ts": { 30 | "when": "$(basename).ts" 31 | }, 32 | "**/*.js": { 33 | "when": "$(basename).ts" 34 | } 35 | }, 36 | "search.exclude": { 37 | "{demo,unittest}/platforms": true, 38 | "{demo,unittest}/platforms/**/*": true, 39 | "{demo,unittest,www-src,src}/node_modules/**/*": true, 40 | "{demo,unittest,www-src,src}/node_modules": true 41 | }, 42 | "files.exclude": { 43 | "**/.DS_Store": true, 44 | "**/.git": true, 45 | "**/.hg": true, 46 | "**/.svn": true, 47 | "**/*.d.ts": { 48 | "when": "$(basename).ts" 49 | }, 50 | "**/*.js": { 51 | "when": "$(basename).ts" 52 | }, 53 | "**/*.metadata.json": true, 54 | "{demo,unittest,www-src,src}/node_modules": true, 55 | "{demo,unittest,www-src,src}/node_modules/**/*": true, 56 | "{demo,unittest}/platforms": true, 57 | "{demo,unittest}/platforms/**/*": true 58 | }, 59 | "cSpell.words": [ 60 | "APPICON", 61 | "ASSETCATALOG", 62 | "Freiling", 63 | "HTMLX", 64 | "IPHONEOS", 65 | "Morten", 66 | "NSURL", 67 | "Notalib", 68 | "OUTDIR", 69 | "Overide", 70 | "Podfile", 71 | "Polyfill", 72 | "Polyfills", 73 | "Sjøgren", 74 | "Tmpl", 75 | "WKUI", 76 | "WKURL", 77 | "armeabi", 78 | "bootstrapper", 79 | "devtool", 80 | "dont", 81 | "downlevel", 82 | "endregion", 83 | "filepath", 84 | "filewalker", 85 | "huba", 86 | "justlaunch", 87 | "localfile", 88 | "mabs", 89 | "nativescript", 90 | "nsconfig", 91 | "null'ing", 92 | "opentype", 93 | "oraclejdk", 94 | "packagr", 95 | "pathinfo", 96 | "podspec", 97 | "preinstall", 98 | "preprocessors", 99 | "prettierrc", 100 | "promisify", 101 | "readonly", 102 | "stringify", 103 | "stringify'able", 104 | "symlinked", 105 | "toplevel", 106 | "tscwatch", 107 | "uglifyjs", 108 | "uiwebview", 109 | "unittest", 110 | "unregister", 111 | "webview", 112 | "webview's", 113 | "webviewdemo", 114 | "webviewexttest", 115 | "webviewinterface", 116 | "webviews", 117 | "wkwebview", 118 | "xcode", 119 | "xhtm" 120 | ], 121 | } 122 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # NativeScript Community Code of Conduct 2 | 3 | Our community members come from all walks of life and are all at different stages of their personal and professional journeys. To support everyone, we've prepared a short code of conduct. Our mission is best served in an environment that is friendly, safe, and accepting; free from intimidation or harassment. 4 | 5 | Towards this end, certain behaviors and practices will not be tolerated. 6 | 7 | ## tl;dr 8 | 9 | - Be respectful. 10 | - We're here to help. 11 | - Abusive behavior is never tolerated. 12 | - Violations of this code may result in swift and permanent expulsion from the NativeScript community channels. 13 | 14 | ## Administrators 15 | 16 | - Dan Wilson (@DanWilson on Slack) 17 | - Jen Looper (@jen.looper on Slack) 18 | - TJ VanToll (@tjvantoll on Slack) 19 | 20 | ## Scope 21 | 22 | We expect all members of the NativeScript community, including administrators, users, facilitators, and vendors to abide by this Code of Conduct at all times in our community venues, online and in person, and in one-on-one communications pertaining to NativeScript affairs. 23 | 24 | This policy covers the usage of the NativeScript Slack community, as well as the NativeScript support forums, NativeScript GitHub repositories, the NativeScript website, and any NativeScript-related events. This Code of Conduct is in addition to, and does not in any way nullify or invalidate, any other terms or conditions related to use of NativeScript. 25 | 26 | The definitions of various subjective terms such as "discriminatory", "hateful", or "confusing" will be decided at the sole discretion of the NativeScript administrators. 27 | 28 | ## Friendly, Harassment-Free Space 29 | 30 | We are committed to providing a friendly, safe, and welcoming environment for all, regardless of gender identity, sexual orientation, disability, ethnicity, religion, age, physical appearance, body size, race, or similar personal characteristics. 31 | 32 | We ask that you please respect that people have differences of opinion regarding technical choices, and acknowledge that every design or implementation choice carries a trade-off and numerous costs. There is seldom a single right answer. A difference of technology preferences is never a license to be rude. 33 | 34 | Any spamming, trolling, flaming, baiting, or other attention-stealing behaviour is not welcome, and will not be tolerated. 35 | 36 | Harassing other users of NativeScript is never tolerated, whether via public or private media. 37 | 38 | Avoid using offensive or harassing package names, nicknames, or other identifiers that might detract from a friendly, safe, and welcoming environment for all. 39 | 40 | Harassment includes, but is not limited to: harmful or prejudicial verbal or written comments related to gender identity, sexual orientation, disability, ethnicity, religion, age, physical appearance, body size, race, or similar personal characteristics; inappropriate use of nudity, sexual images, and/or sexually explicit language in public spaces; threats of physical or non-physical harm; deliberate intimidation, stalking or following; harassing photography or recording; sustained disruption of talks or other events; inappropriate physical contact; and unwelcome sexual attention. 41 | 42 | ## Acceptable Content 43 | 44 | The NativeScript administrators reserve the right to make judgement calls about what is and isn't appropriate in published content. These are guidelines to help you be successful in our community. 45 | 46 | Content must contain something applicable to the previously stated goals of the NativeScript community. "Spamming", that is, publishing any form of content that is not applicable, is not allowed. 47 | 48 | Content must not contain illegal or infringing content. You should only publish content to NativeScript properties if you have the right to do so. This includes complying with all software license agreements or other intellectual property restrictions. For example, redistributing an MIT-licensed module with the copyright notice removed, would not be allowed. You will be responsible for any violation of laws or others’ intellectual property rights. 49 | 50 | Content must not be malware. For example, content (code, video, pictures, words, etc.) which is designed to maliciously exploit or damage computer systems, is not allowed. 51 | 52 | Content name, description, and other visible metadata must not include abusive, inappropriate, or harassing content. 53 | 54 | ## Reporting Violations of this Code of Conduct 55 | 56 | If you believe someone is harassing you or has otherwise violated this Code of Conduct, please contact the administrators and send us an abuse report. If this is the initial report of a problem, please include as much detail as possible. It is easiest for us to address issues when we have more context. 57 | 58 | ## Consequences 59 | 60 | All content published to the NativeScript community channels is hosted at the sole discretion of the NativeScript administrators. 61 | 62 | Unacceptable behavior from any community member, including sponsors, employees, customers, or others with decision-making authority, will not be tolerated. 63 | 64 | Anyone asked to stop unacceptable behavior is expected to comply immediately. 65 | 66 | If a community member engages in unacceptable behavior, the NativeScript administrators may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning (and without refund in the case of a paid event or service). 67 | 68 | ## Addressing Grievances 69 | 70 | If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify the administrators. We will do our best to ensure that your grievance is handled appropriately. 71 | 72 | In general, we will choose the course of action that we judge as being most in the interest of fostering a safe and friendly community. 73 | 74 | ## Contact Info 75 | Please contact Dan Wilson @DanWilson if you need to report a problem or address a grievance related to an abuse report. 76 | 77 | You are also encouraged to contact us if you are curious about something that might be "on the line" between appropriate and inappropriate content. We are happy to provide guidance to help you be a successful part of our community. 78 | 79 | ## Credit and License 80 | 81 | This Code of Conduct borrows heavily from the WADE Code of Conduct, which is derived from the NodeBots Code of Conduct, which in turn borrows from the npm Code of Conduct, which was derived from the Stumptown Syndicate Citizen's Code of Conduct, and the Rust Project Code of Conduct. 82 | 83 | This document may be reused under a Creative Commons Attribution-ShareAlike License. -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to NativeScript Plugin Seed 2 | 3 | :+1: First of all, thank you for taking the time to contribute! :+1: 4 | 5 | Here are some guides on how to do that: 6 | 7 | 8 | 9 | - [Code of Conduct](#code-of-conduct) 10 | - [Reporting Bugs](#reporting-bugs) 11 | - [Requesting Features](#requesting-features) 12 | - [Submitting a PR](#submitting-a-pr) 13 | - [Where to Start](#where-to-start) 14 | 15 | 16 | 17 | ## Code of Conduct 18 | Help us keep a healthy and open community. We expect all participants in this project to adhere to the [NativeScript Code Of Conduct](https://github.com/NativeScript/codeofconduct). 19 | 20 | 21 | ## Reporting Bugs 22 | 23 | 1. Always update to the most recent master release; the bug may already be resolved. 24 | 2. Search for similar issues in the issues list for this repo; it may already be an identified problem. 25 | 3. If this is a bug or problem that is clear, simple, and is unlikely to require any discussion -- it is OK to open an issue on GitHub with a reproduction of the bug including workflows and screenshots. If possible, submit a Pull Request with a failing test, entire application or module. If you'd rather take matters into your own hands, fix the bug yourself (jump down to the [Submitting a PR](#submitting-a-pr) section). 26 | 27 | ## Requesting Features 28 | 29 | 1. Use Github Issues to submit feature requests. 30 | 2. First, search for a similar request and extend it if applicable. This way it would be easier for the community to track the features. 31 | 3. When requesting a new feature, please provide as much detail as possible about why you need the feature in your apps. We prefer that you explain a need rather than explain a technical solution for it. That might trigger a nice conversation on finding the best and broadest technical solution to a specific need. 32 | 33 | ## Submitting a PR 34 | 35 | Before you begin: 36 | * Make sure there is an issue for the bug or feature you will be working on. 37 | 38 | Following these steps is the best way to get your code included in the project: 39 | 40 | 1. Fork and clone the nativescript-plugin-seed repo: 41 | ```bash 42 | git clone https://github.com//nativescript-plugin-seed.git 43 | # Navigate to the newly cloned directory 44 | cd nativescript-plugin-seed 45 | # Add an "upstream" remote pointing to the original repo. 46 | git remote add upstream https://github.com/NativeScript/nativescript-plugin-seed.git 47 | ``` 48 | 2. Create a branch for your PR 49 | ```bash 50 | git checkout -b master 51 | ``` 52 | 53 | 3. The fun part! Make your code changes. Make sure you: 54 | - Follow the [code conventions guide](https://github.com/NativeScript/NativeScript/blob/master/CodingConvention.md). 55 | - Follow the [commit message guidelines](https://github.com/NativeScript/NativeScript/blob/pr-template/CONTRIBUTING.md#commit-messages) 56 | - Setup your development workflow. The seed itself is a plugin so you can follow the [development setup][https://github.com/NativeScript/nativescript-plugin-seed#development-setup] described in the README. 57 | - Write unit tests for your fix or feature. If this is not possible, explain how your change can be tested. 58 | > NOTE: For changes in the postclone step, make sure you create tests in `seed-tests/postclone.tests.js`! 59 | 60 | 4. Before you submit your PR: 61 | - Rebase your changes to the latest master: `git pull --rebase upstream master`. 62 | - Ensure all unit test are green. How? 63 | - Go to `seed-tests` 64 | - Run `npm install` 65 | - Run `npm run test.ios` or `npm run test.android` 66 | - Ensure your changes pass tslint validation. (run `npm run tslint` in the root of the repo). 67 | 68 | 6. Push your fork. If you have rebased you might have to use force-push your branch: 69 | ``` 70 | git push origin --force 71 | ``` 72 | 73 | 7. [Submit your pull request](https://github.com/NativeScript/nativescript-plugin-seed/compare) and compare to `NativeScript/nativescript-plugin-seed`. Please, fill in the Pull Request template - it will help us better understand the PR and increase the chances of it getting merged quickly. 74 | 75 | It's our turn from there on! We will review the PR and discuss changes you might have to make before merging it! Thanks! 76 | 77 | ## Where to Start 78 | 79 | If you want to contribute, but you are not sure where to start - look for issues labeled [`help wanted`](https://github.com/NativeScript/nativescript-plugin-seed/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22). 80 | -------------------------------------------------------------------------------- /demo/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | trim_trailing_whitespace = true 7 | charset = utf-8 8 | 9 | [*.json] 10 | indent_style = space 11 | indent_size = 2 12 | 13 | [*.js] 14 | indent_style = space 15 | indent_size = 2 16 | 17 | [*.ts] 18 | indent_style = space 19 | indent_size = 2 -------------------------------------------------------------------------------- /demo/.gitignore: -------------------------------------------------------------------------------- 1 | # NativeScript 2 | hooks/ 3 | node_modules/ 4 | platforms/ 5 | 6 | # Logs 7 | logs 8 | *.log 9 | npm-debug.log* 10 | yarn-debug.log* 11 | yarn-error.log* 12 | 13 | # General 14 | .DS_Store 15 | .AppleDouble 16 | .LSOverride 17 | .idea 18 | .cloud 19 | .project 20 | tmp/ 21 | typings/ 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | -------------------------------------------------------------------------------- /demo/.prettierignore: -------------------------------------------------------------------------------- 1 | **/*.d.ts 2 | **/node_modules 3 | **/platforms 4 | -------------------------------------------------------------------------------- /demo/App_Resources/Android/app.gradle: -------------------------------------------------------------------------------- 1 | // Add your native dependencies here: 2 | 3 | // Uncomment to add recyclerview-v7 dependency 4 | //dependencies { 5 | // implementation 'com.android.support:recyclerview-v7:+' 6 | //} 7 | 8 | // If you want to add something to be applied before applying plugins' include.gradle files 9 | // e.g. project.ext.googlePlayServicesVersion = "15.0.1" 10 | // create a file named before-plugins.gradle in the current directory and place it there 11 | 12 | android { 13 | defaultConfig { 14 | minSdkVersion 19 15 | generatedDensities = [] 16 | } 17 | aaptOptions { 18 | additionalParameters "--no-version-vectors" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 26 | 27 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/drawable-hdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/Android/src/main/res/drawable-hdpi/background.png -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/drawable-hdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/Android/src/main/res/drawable-hdpi/logo.png -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/drawable-ldpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/Android/src/main/res/drawable-ldpi/background.png -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/drawable-ldpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/Android/src/main/res/drawable-ldpi/logo.png -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/drawable-mdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/Android/src/main/res/drawable-mdpi/background.png -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/drawable-mdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/Android/src/main/res/drawable-mdpi/logo.png -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/drawable-xhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/Android/src/main/res/drawable-xhdpi/background.png -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/Android/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/Android/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/Android/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/Android/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/Android/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/values-v21/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #65ADF1 4 | -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 13 | 14 | 15 | 18 | 19 | 20 | 23 | 24 | 28 | -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/values-v29/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 11 | 12 | -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F5F5F5 4 | #757575 5 | #65ADF1 6 | #272734 7 | -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | WebViewExt demo 4 | WebViewExt Demo 5 | 6 | 7 | -------------------------------------------------------------------------------- /demo/App_Resources/Android/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 17 | 18 | 20 | 21 | 22 | 29 | 30 | 32 | 33 | 34 | 39 | 40 | 42 | 43 | -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "icon-20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "icon-20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "icon-29.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "icon-29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "icon-29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "icon-40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "icon-40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "icon-60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "icon-60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "icon-20.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "icon-20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "icon-29.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "icon-29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "icon-40.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "icon-40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "icon-76.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "icon-76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "icon-83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "icon-1024.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-AspectFill.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-AspectFill@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchScreen-AspectFill@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-Center.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-Center@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchScreen-Center@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png -------------------------------------------------------------------------------- /demo/App_Resources/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiresFullScreen 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /demo/App_Resources/iOS/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /demo/App_Resources/iOS/build.xcconfig: -------------------------------------------------------------------------------- 1 | // You can add custom settings here 2 | // for example you can uncomment the following line to force distribution code signing 3 | // CODE_SIGN_IDENTITY = iPhone Distribution 4 | // To build for device with XCode you need to specify your development team. 5 | // DEVELOPMENT_TEAM = YOUR_TEAM_ID; 6 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 7 | -------------------------------------------------------------------------------- /demo/app/app-root.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /demo/app/app.css: -------------------------------------------------------------------------------- 1 | @import "@nativescript/theme/css/core.css"; 2 | @import "@nativescript/theme/css/default.css"; 3 | 4 | -------------------------------------------------------------------------------- /demo/app/app.ts: -------------------------------------------------------------------------------- 1 | /* 2 | In NativeScript, the app.ts file is the entry point to your application. 3 | You can use this file to perform app-level initialization, but the primary 4 | purpose of the file is to pass control to the app’s first module. 5 | */ 6 | 7 | import { Application } from '@nativescript/core' 8 | 9 | Application.run({ moduleName: 'app-root' }) 10 | 11 | /* 12 | Do not place any code after the application has been started as it will not 13 | be executed on iOS. 14 | */ 15 | -------------------------------------------------------------------------------- /demo/app/assets/test-data/css/local-stylesheet.css: -------------------------------------------------------------------------------- 1 | .red { 2 | margin: 0; 3 | padding: 0; 4 | font-weight: bolder; 5 | background-color: blue; 6 | color: green; 7 | font-size: 20pt; 8 | } 9 | 10 | body, 11 | html { 12 | margin: 0; 13 | padding: 0; 14 | background-color: purple; 15 | } 16 | -------------------------------------------------------------------------------- /demo/app/assets/test-data/html/css-not-predefined.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Inject stylesheet via x-local 5 | 6 | 7 |

RED

8 | 9 | 10 | -------------------------------------------------------------------------------- /demo/app/assets/test-data/html/css-predefined-link-tags.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Load predefined x-local stylesheet 5 | 6 | 7 | 8 |

RED

9 | 10 | 11 | -------------------------------------------------------------------------------- /demo/app/assets/test-data/html/empty.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Blank 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo/app/assets/test-data/html/javascript-calls-x-local.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /demo/app/assets/test-data/html/javascript-calls.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 35 | 36 | 37 |

RED

38 |
39 |

Should overide url?

40 | Go to google - should not load 41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /demo/app/assets/test-data/js/local-javascript.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | function getNumber() { 4 | return 42; 5 | } 6 | 7 | function getNumberFloat() { 8 | return 3.14; 9 | } 10 | 11 | function getFalse() { 12 | return false; 13 | } 14 | 15 | function getTruth() { 16 | return true; 17 | } 18 | 19 | function getString() { 20 | return 'string result from webview JS function'; 21 | } 22 | 23 | function getArray() { 24 | return [1.5, true, "hello"]; 25 | } 26 | 27 | function getObject() { 28 | return { 29 | prop: "test", 30 | name: "object-test", 31 | values: [ 32 | 42, 33 | 3.14 34 | ] 35 | }; 36 | } 37 | 38 | function setupEventListener() { 39 | window.nsWebViewBridge.on('tns-message', function (args) { 40 | window.nsWebViewBridge.emit('web-message', args); 41 | }); 42 | } 43 | 44 | function testPromiseResolve() { 45 | return new Promise(function(resolve) { 46 | setTimeout(function() { 47 | resolve(42); 48 | }, 100); 49 | }); 50 | } 51 | 52 | function testPromiseReject() { 53 | return new Promise(function(resolve, reject) { 54 | setTimeout(function() { 55 | reject(new Error('The Cake is a Lie')); 56 | }, 100); 57 | }); 58 | } -------------------------------------------------------------------------------- /demo/app/main-page.ts: -------------------------------------------------------------------------------- 1 | import { Button, EventData, Page, Trace as trace } from "@nativescript/core"; 2 | import { EnterFullscreenEventData, LoadEventData, LoadFinishedEventData, ShouldOverrideUrlLoadEventData, WebViewExt } from "@nota/nativescript-webview-ext"; 3 | import * as fastEqual from "fast-deep-equal"; 4 | 5 | let webview: WebViewExt; 6 | let page: Page; 7 | 8 | trace.setCategories("NOTA"); 9 | trace.enable(); 10 | 11 | // Event handler for Page 'loaded' event attached in main-page.xml 12 | export function pageLoaded(args: EventData) { 13 | page = args.object as Page; 14 | } 15 | 16 | let gotMessageData: any = null; 17 | export function webviewLoaded(args: LoadEventData) { 18 | webview = args.object; 19 | 20 | if (global.isAndroid) { 21 | webview.src = "http://10.0.2.2:8080"; 22 | } else { 23 | webview.src = "http://localhost:8080"; 24 | } 25 | 26 | webview.on(WebViewExt.shouldOverrideUrlLoadingEvent, (args: ShouldOverrideUrlLoadEventData) => { 27 | console.log(`${args.httpMethod} ${args.url}`); 28 | if (args.url.includes("google.com")) { 29 | args.cancel = true; 30 | } 31 | }); 32 | 33 | webview.on(WebViewExt.loadFinishedEvent, (args: LoadFinishedEventData) => { 34 | console.log(`WebViewExt.loadFinishedEvent: ${args.url}`); 35 | webview.loadStyleSheetFile("local-stylesheet.css", "~/assets/test-data/css/local-stylesheet.css", false); 36 | }); 37 | 38 | webview.on("gotMessage", (msg) => { 39 | gotMessageData = msg.data; 40 | console.log(`webview.gotMessage: ${JSON.stringify(msg.data)} (${typeof msg})`); 41 | }); 42 | } 43 | 44 | async function executeJavaScriptTest(js: string, expected?: T): Promise { 45 | try { 46 | const res = await webview.executeJavaScript(js); 47 | console.log(`executeJavaScript '${js}' => ${JSON.stringify(res)} (${typeof res})`); 48 | const jsonRes = JSON.stringify(res); 49 | const expectedJson = JSON.stringify(expected); 50 | if (expected !== undefined && !fastEqual(expected, res)) { 51 | throw new Error(`Expected: ${expectedJson}. Got: ${jsonRes}`); 52 | } 53 | 54 | return res; 55 | } catch (err) { 56 | console.log(`executeJavaScript '${js}' => ERROR: ${err}`); 57 | throw err; 58 | } 59 | } 60 | 61 | export async function runTests() { 62 | console.time("runTests"); 63 | 64 | await executeJavaScriptTest("callFromNativeScript()"); 65 | 66 | const expected = { 67 | huba: "hop", 68 | }; 69 | const gotJson = JSON.stringify(gotMessageData); 70 | 71 | if (fastEqual(expected, gotMessageData)) { 72 | console.log(`executeJavaScript via message 'callFromNativeScript()' => ${gotJson} (${typeof gotMessageData})`); 73 | } else { 74 | throw new Error(`Expected: ${JSON.stringify(expected)}. Got: ${gotJson}`); 75 | } 76 | 77 | await executeJavaScriptTest("getNumber()", 42); 78 | await executeJavaScriptTest("getNumberFloat()", 3.14); 79 | await executeJavaScriptTest("getBoolean()", false); 80 | await executeJavaScriptTest("getString()", "string result from webview JS function"); 81 | await executeJavaScriptTest("getArray()", [1.5, true, "hello"]); 82 | await executeJavaScriptTest("getObject()", { name: "object-test", prop: "test", values: [42, 3.14] }); 83 | 84 | console.timeEnd("runTests"); 85 | } 86 | 87 | let closeFullscreen: () => void; 88 | export function enterFullscreen(eventData: EnterFullscreenEventData) { 89 | page.actionBarHidden = true; 90 | 91 | closeFullscreen = eventData.exitFullscreen; 92 | 93 | const button = page.getViewById("test_button") as Button; 94 | if (button) { 95 | button.visibility = "collapse"; 96 | } 97 | } 98 | 99 | export function exitFullscreen() { 100 | page.actionBarHidden = false; 101 | const button = page.getViewById("test_button") as Button; 102 | if (button) { 103 | button.visibility = "visible"; 104 | } 105 | 106 | closeFullscreen = null; 107 | } 108 | -------------------------------------------------------------------------------- /demo/app/main-page.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /demo/app/main-view-model.ts: -------------------------------------------------------------------------------- 1 | import { Observable } from "@nativescript/core/data/observable"; 2 | 3 | export class HelloWorldModel extends Observable { 4 | public message: string; 5 | } 6 | -------------------------------------------------------------------------------- /demo/nativescript.config.ts: -------------------------------------------------------------------------------- 1 | import { NativeScriptConfig } from '@nativescript/core'; 2 | 3 | export default { 4 | id: 'org.nativescript.demo2', 5 | appPath: 'app', 6 | appResourcesPath: 'App_Resources', 7 | android: { 8 | v8Flags: '--expose_gc', 9 | markingMode: 'none' 10 | } 11 | } as NativeScriptConfig; -------------------------------------------------------------------------------- /demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@nativescript/template-hello-world-ts", 3 | "main": "app/app.ts", 4 | "version": "8.0.5", 5 | "author": "NativeScript Team ", 6 | "description": "NativeScript Application", 7 | "license": "SEE LICENSE IN ", 8 | "publishConfig": { 9 | "access": "public" 10 | }, 11 | "files": [ 12 | "app", 13 | "App_Resources", 14 | "hooks", 15 | "tools", 16 | "!tools/assets", 17 | ".editorconfig", 18 | "references.d.ts", 19 | "tsconfig.json" 20 | ], 21 | "keywords": [ 22 | "nativescript", 23 | "mobile", 24 | "{N}", 25 | "template" 26 | ], 27 | "repository": "", 28 | "bugs": { 29 | "url": "https://github.com/NativeScript/NativeScript/issues" 30 | }, 31 | "homepage": "https://github.com/NativeScript/nativescript-app-templates", 32 | "dependencies": { 33 | "@nativescript/core": "~8.0.0", 34 | "@nativescript/theme": "~3.0.1", 35 | "@nota/nativescript-webview-ext": "file:../src" 36 | }, 37 | "devDependencies": { 38 | "@nativescript/android": "8.0.0", 39 | "@nativescript/types": "~8.0.0", 40 | "@nativescript/webpack": "^5.0.4", 41 | "typescript": "~4.0.0" 42 | }, 43 | "private": "true", 44 | "readme": "NativeScript Application" 45 | } 46 | -------------------------------------------------------------------------------- /demo/references.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /demo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "esnext", 4 | "target": "es2017", 5 | "moduleResolution": "node", 6 | "experimentalDecorators": true, 7 | "emitDecoratorMetadata": true, 8 | "noEmitHelpers": true, 9 | "noEmitOnError": true, 10 | "skipLibCheck": true, 11 | "lib": ["es2017", "dom"], 12 | "baseUrl": ".", 13 | "paths": { 14 | "~/*": ["app/*"], 15 | "@/*": ["app/*"] 16 | } 17 | }, 18 | "files": ["./references.d.ts"], 19 | "exclude": ["node_modules", "platforms"] 20 | } 21 | -------------------------------------------------------------------------------- /demo/webpack.config.js: -------------------------------------------------------------------------------- 1 | const webpack = require("@nativescript/webpack"); 2 | 3 | module.exports = (env) => { 4 | webpack.init(env); 5 | 6 | // Learn how to customize: 7 | // https://docs.nativescript.org/webpack 8 | 9 | return webpack.resolveConfig(); 10 | }; 11 | 12 | 13 | -------------------------------------------------------------------------------- /demo/www/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 47 | 48 | 49 |

RED

50 |
51 |

Should overide url?

52 | Go to google - should not load 53 |
54 | 55 |
56 |
57 | 58 |
59 |
60 | 61 |
62 |
63 | 64 | 65 | -------------------------------------------------------------------------------- /native-src/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/libraries 5 | /.idea/modules.xml 6 | /.idea/workspace.xml 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | .settings 12 | .project 13 | .classpath 14 | -------------------------------------------------------------------------------- /native-src/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.5.3' 11 | 12 | 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | } 23 | } 24 | 25 | task clean(type: Delete) { 26 | delete rootProject.buildDir 27 | } 28 | -------------------------------------------------------------------------------- /native-src/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | 15 | android.useAndroidX=true 16 | android.enableJetifier=true -------------------------------------------------------------------------------- /native-src/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/native-src/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /native-src/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jan 29 22:45:40 CET 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /native-src/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /native-src/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /native-src/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':webviewinterface' 2 | -------------------------------------------------------------------------------- /native-src/android/webviewinterface/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /native-src/android/webviewinterface/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 28 5 | 6 | defaultConfig { 7 | minSdkVersion 19 8 | targetSdkVersion 28 9 | versionCode 1 10 | versionName "1.0" 11 | 12 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 13 | 14 | } 15 | 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | 23 | } 24 | 25 | dependencies { 26 | implementation fileTree(dir: 'libs', include: ['*.jar']) 27 | 28 | implementation 'androidx.appcompat:appcompat:1.1.0' 29 | testImplementation 'junit:junit:4.12' 30 | androidTestImplementation 'androidx.test:runner:1.2.0' 31 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 32 | } 33 | 34 | -------------------------------------------------------------------------------- /native-src/android/webviewinterface/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /native-src/android/webviewinterface/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /native-src/android/webviewinterface/src/main/java/dk/nota/webviewinterface/WebViewBridgeInterface.java: -------------------------------------------------------------------------------- 1 | package dk.nota.webviewinterface; 2 | 3 | import android.webkit.JavascriptInterface; 4 | 5 | public class WebViewBridgeInterface { 6 | public WebViewBridgeInterface() { 7 | } 8 | 9 | @JavascriptInterface 10 | public void emitEvent(String eventName, String data) { 11 | this.emitEventToNativeScript(eventName, data); 12 | } 13 | 14 | public void emitEventToNativeScript(String eventName, String data) { 15 | // Extend this function in nativescript 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /native-src/android/webviewinterface/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | WebView Interface 3 | 4 | -------------------------------------------------------------------------------- /native-src/build-android.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | function wd() { 5 | cd $(dirname $0) 6 | echo $PWD 7 | } 8 | (cd android && ./gradlew build) 9 | 10 | NATIVE_SRC_DIR=$(wd); 11 | 12 | AAR_PATH="${NATIVE_SRC_DIR}/android/webviewinterface/build/outputs/aar/webviewinterface-release.aar" 13 | TARGET_PATH="${NATIVE_SRC_DIR}/../src/platforms/android/" 14 | TARGET_FILE="webviewinterface.aar" 15 | 16 | mkdir -p "${TARGET_PATH}" 17 | cp -v "${AAR_PATH}" "${TARGET_PATH}/${TARGET_FILE}" 18 | -------------------------------------------------------------------------------- /native-src/build-ios.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Based on https://appspector.com/blog/xcframeworks 6 | 7 | ROOT_DIR="$(git rev-parse --show-toplevel)" 8 | 9 | PROJECT_NAME="NotaWebViewExt" 10 | 11 | # set framework folder name 12 | FRAMEWORK_FOLDER_NAME="${PROJECT_NAME}" 13 | 14 | IOS_PROJECT_DIR="${ROOT_DIR}/native-src/ios/${FRAMEWORK_FOLDER_NAME}" 15 | 16 | cd ${IOS_PROJECT_DIR} 17 | 18 | # set framework name or read it from project by this variable 19 | FRAMEWORK_NAME="${PROJECT_NAME}" 20 | 21 | # xcframework path 22 | FRAMEWORK_PATH="${ROOT_DIR}/src/platforms/ios/${FRAMEWORK_NAME}.xcframework" 23 | 24 | TMP_DIR="/tmp/xcf" 25 | 26 | # set path for iOS simulator archive 27 | SIMULATOR_ARCHIVE_PATH="${TMP_DIR}/${FRAMEWORK_FOLDER_NAME}/simulator.xcarchive" 28 | 29 | # set path for iOS device archive 30 | IOS_DEVICE_ARCHIVE_PATH="${TMP_DIR}/${FRAMEWORK_FOLDER_NAME}/iOS.xcarchive" 31 | 32 | ARCHIVE_SUBPATH="Products/Library/Frameworks/${FRAMEWORK_NAME}.framework" 33 | 34 | rm -rf "${TMP_DIR}" "${FRAMEWORK_PATH}" 35 | 36 | echo "Deleted ${TMP_DIR}" 37 | 38 | echo "Archiving ${FRAMEWORK_NAME}" 39 | 40 | xcodebuild archive \ 41 | -scheme "${FRAMEWORK_NAME}" \ 42 | -destination="generic/platform=iOS Simulator" \ 43 | -archivePath "${SIMULATOR_ARCHIVE_PATH}" \ 44 | -sdk iphonesimulator \ 45 | SKIP_INSTALL=NO \ 46 | BUILD_LIBRARIES_FOR_DISTRIBUTION=YES 47 | 48 | xcodebuild archive \ 49 | -scheme "${FRAMEWORK_FOLDER_NAME}" \ 50 | -destination="generic/platform=iOS" \ 51 | -archivePath "${IOS_DEVICE_ARCHIVE_PATH}" \ 52 | -sdk iphoneos \ 53 | SKIP_INSTALL=NO \ 54 | BUILD_LIBRARIES_FOR_DISTRIBUTION=YES 55 | 56 | # Creating XCFramework 57 | xcodebuild -create-xcframework \ 58 | -framework "${SIMULATOR_ARCHIVE_PATH}/${ARCHIVE_SUBPATH}" \ 59 | -framework "${IOS_DEVICE_ARCHIVE_PATH}/${ARCHIVE_SUBPATH}" \ 60 | -output "${FRAMEWORK_PATH}" 61 | 62 | rm -rf "${SIMULATOR_ARCHIVE_PATH}" "${IOS_DEVICE_ARCHIVE_PATH}" 63 | 64 | ## Workaround for https://github.com/Notalib/nativescript-webview-ext/issues/71 65 | rm -rf ${FRAMEWORK_PATH}/ios-*/NotaWebViewExt.framework/Frameworks 66 | -------------------------------------------------------------------------------- /native-src/ios/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /native-src/ios/NotaWebViewExt/NotaWebViewExt.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /native-src/ios/NotaWebViewExt/NotaWebViewExt.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /native-src/ios/NotaWebViewExt/NotaWebViewExt.xcodeproj/xcshareddata/xcschemes/NotaWebViewExt.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 54 | 60 | 61 | 67 | 68 | 69 | 70 | 72 | 73 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /native-src/ios/NotaWebViewExt/NotaWebViewExt.xcodeproj/xcuserdata/b044552.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | NotaWebViewExt.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | A7F549C623CDE81E00A14B54 16 | 17 | primary 18 | 19 | 20 | A7F549CF23CDE81E00A14B54 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /native-src/ios/NotaWebViewExt/NotaWebViewExt/Constants.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Constants.swift 3 | // NotaWebViewExt 4 | // 5 | // Created by Morten Anton Bach Sjøgren on 14/01/2020. 6 | // Copyright © 2020 Morten Anton Bach Sjøgren. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct Constants { 12 | static let customURLScheme = "x-local" 13 | 14 | static let mimeType: [String: String] = [ 15 | "html": "text/html", 16 | "htm": "text/html", 17 | "xhtml": "text/html", 18 | "xhtm": "text/html", 19 | "css": "text/css", 20 | "gif": "image/gif", 21 | "jpeg": "image/jpeg", 22 | "jpg": "image/jpeg", 23 | "js": "text/javascript", 24 | "otf": "application/vnd.ms-opentype", 25 | "png": "image/png", 26 | "svg": "image/svg+xml", 27 | "ttf": "application/x-font-ttf", 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /native-src/ios/NotaWebViewExt/NotaWebViewExt/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /native-src/ios/NotaWebViewExt/NotaWebViewExt/NotaWebViewExt.h: -------------------------------------------------------------------------------- 1 | // 2 | // NotaWebViewExt.h 3 | // NotaWebViewExt 4 | // 5 | // Created by Morten Anton Bach Sjøgren on 14/01/2020. 6 | // Copyright © 2020 Morten Anton Bach Sjøgren. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for NotaWebViewExt. 12 | FOUNDATION_EXPORT double NotaWebViewExtVersionNumber; 13 | 14 | //! Project version string for NotaWebViewExt. 15 | FOUNDATION_EXPORT const unsigned char NotaWebViewExtVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /native-src/ios/NotaWebViewExt/NotaWebViewExt/WKWebviewCustomSchemeHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WKWebviewCustomSchemeHandler.swift 3 | // NotaWebViewExt 4 | // 5 | // Created by Morten Anton Bach Sjøgren on 14/01/2020. 6 | // Copyright © 2020 Morten Anton Bach Sjøgren. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import WebKit; 11 | 12 | enum WebErrors: Error { 13 | case RequestFailedError 14 | } 15 | 16 | @available(iOS 11, *) 17 | @objc 18 | public class CustomUrlSchemeHandler: NSObject,WKURLSchemeHandler { 19 | var resourceDict: [String: String] = [:]; 20 | 21 | @objc 22 | public func resolveFilePath(_ url: URL) -> String? { 23 | NSLog("CustomUrlSchemeHandler.resolveFilePath(%@)", url.absoluteString); 24 | guard url.absoluteString.starts(with: Constants.customURLScheme) else { 25 | NSLog("CustomUrlSchemeHandler.resolveFilePath(%@) - invalid scheme", url.absoluteString); 26 | return nil 27 | } 28 | let urlStr = url.host! + url.path 29 | NSLog("CustomUrlSchemeHandler.resolveFilePath(%@) - path(%@)", url.absoluteString, urlStr); 30 | guard let filepath = self.getRegisteredLocalResource(forKey: urlStr) else { 31 | NSLog("CustomUrlSchemeHandler.resolveFilePath(%@) - no path", url.absoluteString); 32 | return nil; 33 | } 34 | 35 | NSLog("CustomUrlSchemeHandler.resolveFilePath(%@) - path(%@) - filepath(%@)", url.absoluteString, urlStr, filepath); 36 | return filepath 37 | } 38 | 39 | @objc 40 | public func resolveMimeTypeFrom(filepath: String) -> String { 41 | let ext = URL(fileURLWithPath: filepath).pathExtension; 42 | NSLog("CustomUrlSchemeHandler.resolveMimeTypeFrom(%@) - ext(%@)", filepath, ext) 43 | if let mimetype = Constants.mimeType[ext] { 44 | NSLog("CustomUrlSchemeHandler.resolveMimeTypeFrom(%@) - ext(%@) -> mimetype(%@)", filepath, ext, mimetype) 45 | return mimetype 46 | } 47 | 48 | return "application/octet-stream" 49 | } 50 | 51 | @objc 52 | public func webView(_ webView: WKWebView, start urlSchemeTask: WKURLSchemeTask) { 53 | NSLog("CustomUrlSchemeHandler"); 54 | DispatchQueue.global().async { 55 | NSLog("CustomUrlSchemeHandler -> global async"); 56 | guard let url = urlSchemeTask.request.url, url.scheme == Constants.customURLScheme else { 57 | NSLog("CustomUrlSchemeHandler - NO URL") 58 | urlSchemeTask.didFailWithError(WebErrors.RequestFailedError) 59 | return; 60 | } 61 | NSLog("CustomUrlSchemeHandler - URL(%@)", url.absoluteString) 62 | guard let filepath = self.resolveFilePath(url) else { 63 | NSLog("CustomUrlSchemeHandler - URL(%@) no path", url.absoluteString) 64 | urlSchemeTask.didFailWithError(WebErrors.RequestFailedError) 65 | return; 66 | } 67 | let mimeType = self.resolveMimeTypeFrom(filepath: filepath); 68 | NSLog("CustomUrlSchemeHandler - URL(%@) path(%@)", url.absoluteString, filepath) 69 | guard let data = NSData.init(contentsOfFile: filepath) else { 70 | NSLog("CustomUrlSchemeHandler - URL(%@) path(%@) no data", url.absoluteString, filepath) 71 | urlSchemeTask.didFailWithError(WebErrors.RequestFailedError) 72 | return; 73 | } 74 | 75 | let urlResponse = HTTPURLResponse.init(url: url, statusCode: 200, httpVersion: "HTTP/1.1", headerFields: ["Content-Type": mimeType, "Access-Control-Allow-Origin": "*"]) 76 | 77 | urlSchemeTask.didReceive(urlResponse!) 78 | urlSchemeTask.didReceive(data as Data) 79 | urlSchemeTask.didFinish() 80 | } 81 | } 82 | 83 | @objc 84 | public func webView(_ webView: WKWebView, stop urlSchemeTask: WKURLSchemeTask) { 85 | urlSchemeTask.didFailWithError(WebErrors.RequestFailedError) 86 | } 87 | 88 | @objc 89 | public func registerLocalResource(forKey: String, filepath: String) { 90 | self.resourceDict[forKey] = filepath; 91 | } 92 | 93 | @objc 94 | public func unregisterLocalResource(forKey: String) { 95 | self.resourceDict.removeValue(forKey: forKey) 96 | } 97 | 98 | @objc 99 | public func getRegisteredLocalResource(forKey: String) -> String? { 100 | return self.resourceDict[forKey] 101 | } 102 | 103 | @objc 104 | public func clearRegisteredLocalResource() { 105 | self.resourceDict = [:] 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /native-src/ios/NotaWebViewExt/NotaWebViewExtTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /native-src/ios/NotaWebViewExt/NotaWebViewExtTests/NotaWebViewExtTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NotaWebViewExtTests.swift 3 | // NotaWebViewExtTests 4 | // 5 | // Created by Morten Anton Bach Sjøgren on 14/01/2020. 6 | // Copyright © 2020 Morten Anton Bach Sjøgren. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import NotaWebViewExt 11 | 12 | class NotaWebViewExtTests: XCTestCase { 13 | 14 | override func setUp() { 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDown() { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | } 21 | 22 | func testExample() { 23 | // This is an example of a functional test case. 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testPerformanceExample() { 28 | // This is an example of a performance test case. 29 | self.measure { 30 | // Put the code you want to measure the time of here. 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /patches/apply-patches.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | realpath() { 3 | [[ $1 = /* ]] && echo "$1" || (cd "$PWD/${1#./}" && echo $PWD); 4 | } 5 | 6 | apply_patch() { 7 | PATCH=$1 8 | patch -p0 -N --dry-run --silent -i $PATCH 2>&1 > /dev/null 9 | if [[ $? -eq 0 ]]; then 10 | patch -p0 -N --silent -i $PATCH 11 | if [[ $? -eq 0 ]]; then 12 | echo "APPLIED PATCH: ${PATCH}"; 13 | else 14 | echo "COULN't APPLY THE PATCH: ${PATCH}"; 15 | exit 127 16 | fi 17 | else 18 | patch -p0 -N -R --dry-run --silent -i $PATCH 2>&1 > /dev/null 19 | if [[ $? -eq 0 ]]; then 20 | echo "ALREADY APPLIED: ${PATCH}"; 21 | else 22 | echo "CANNOT APPLY THE PATCH: ${PATCH}"; 23 | exit 127 24 | fi 25 | fi 26 | } 27 | 28 | PATCH_DIR=$(realpath $(dirname $0)); 29 | ROOT=$(git rev-parse --show-toplevel); 30 | 31 | echo -e "Applying local patches from ${PATCH_DIR}\n"; 32 | 33 | cd $ROOT 34 | for patch in $PATCH_DIR/*.patch; do 35 | apply_patch $patch 36 | done 37 | 38 | echo -e "\nDONE - Applying local patches from ${PATCH_DIR}"; 39 | -------------------------------------------------------------------------------- /publish/pack.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | wd() { 5 | cd $(dirname $0) 6 | echo $PWD 7 | } 8 | 9 | install(){ 10 | npm i 11 | } 12 | 13 | WORKDIR=$(wd) 14 | SOURCE_DIR="${WORKDIR}/../src"; 15 | TO_SOURCE_DIR="${WORKDIR}/src"; 16 | PACK_DIR="${WORKDIR}/package"; 17 | ROOT_DIR="${WORKDIR}/.."; 18 | PUBLISH=--publish 19 | 20 | cd $WORKDIR; 21 | 22 | pack() { 23 | echo "Clearing ${TO_SOURCE_DIR} and ${PACK_DIR}..." 24 | cd "${WORKDIR}" 25 | npx rimraf "${PACK_DIR}" 26 | 27 | # copy src 28 | echo 'Copying src...' 29 | rsync -a \ 30 | --delete \ 31 | --delete-excluded \ 32 | --exclude hooks \ 33 | --exclude www \ 34 | --exclude node_modules \ 35 | --exclude platforms \ 36 | --exclude "*.metadata.json" \ 37 | --exclude "*.js" \ 38 | --exclude "*.tgz" \ 39 | --exclude "*.d.ts" \ 40 | --exclude "*.map" \ 41 | --exclude "*.css" \ 42 | --include "references.d.ts" \ 43 | --include "nativescript-webview-bridge-loader.d.ts" \ 44 | --include "webview-ext.d.ts" \ 45 | "${SOURCE_DIR}/" \ 46 | "${ROOT_DIR}/LICENSE" \ 47 | "${ROOT_DIR}/README.md" \ 48 | "${TO_SOURCE_DIR}/" 49 | 50 | rsync -a \ 51 | "${SOURCE_DIR}/webview-ext.d.ts" \ 52 | "${TO_SOURCE_DIR}" 53 | 54 | rsync -a \ 55 | --delete \ 56 | "${SOURCE_DIR}/platforms/" \ 57 | "${TO_SOURCE_DIR}/platforms/" 58 | 59 | rsync -a \ 60 | --delete \ 61 | "${SOURCE_DIR}/types/" \ 62 | "${TO_SOURCE_DIR}/types/" 63 | 64 | # compile package and copy files required by npm 65 | echo 'Building /src...' 66 | cd "${TO_SOURCE_DIR}" 67 | npm run build 68 | cd "${WORKDIR}" 69 | 70 | if [[ ! -f "${TO_SOURCE_DIR}/www/ns-webview-bridge.js" ]]; then 71 | echo "${TO_SOURCE_DIR}/www/ns-webview-bridge.js is missing"; 72 | exit 127 73 | fi 74 | 75 | echo 'Creating package...' 76 | # create package dir 77 | mkdir "${PACK_DIR}" 78 | 79 | POSTINSTALL_SCRIPT=$(npx json -f "${TO_SOURCE_DIR}"/package.json scripts.postinstall) 80 | npx json -e "this.scripts={}" -I -f "${TO_SOURCE_DIR}"/package.json 81 | npx json -e "this.scripts.postinstall='${POSTINSTALL_SCRIPT}'" -I -f "${TO_SOURCE_DIR}"/package.json 82 | npx json -e "delete this.devDependencies" -I -f "${TO_SOURCE_DIR}"/package.json 83 | 84 | # create the package 85 | cd "${PACK_DIR}" 86 | npm pack "${TO_SOURCE_DIR}" 87 | 88 | # delete source directory used to create the package 89 | cd "${WORKDIR}" 90 | npx rimraf "${TO_SOURCE_DIR}" 91 | } 92 | 93 | install && pack 94 | -------------------------------------------------------------------------------- /publish/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nativescript-publish", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "balanced-match": { 8 | "version": "1.0.0", 9 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 10 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 11 | "dev": true 12 | }, 13 | "brace-expansion": { 14 | "version": "1.1.11", 15 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 16 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 17 | "dev": true, 18 | "requires": { 19 | "balanced-match": "^1.0.0", 20 | "concat-map": "0.0.1" 21 | } 22 | }, 23 | "concat-map": { 24 | "version": "0.0.1", 25 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 26 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 27 | "dev": true 28 | }, 29 | "fs.realpath": { 30 | "version": "1.0.0", 31 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 32 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 33 | "dev": true 34 | }, 35 | "glob": { 36 | "version": "7.1.3", 37 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", 38 | "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", 39 | "dev": true, 40 | "requires": { 41 | "fs.realpath": "^1.0.0", 42 | "inflight": "^1.0.4", 43 | "inherits": "2", 44 | "minimatch": "^3.0.4", 45 | "once": "^1.3.0", 46 | "path-is-absolute": "^1.0.0" 47 | } 48 | }, 49 | "inflight": { 50 | "version": "1.0.6", 51 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 52 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 53 | "dev": true, 54 | "requires": { 55 | "once": "^1.3.0", 56 | "wrappy": "1" 57 | } 58 | }, 59 | "inherits": { 60 | "version": "2.0.3", 61 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 62 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", 63 | "dev": true 64 | }, 65 | "json": { 66 | "version": "10.0.0", 67 | "resolved": "https://registry.npmjs.org/json/-/json-10.0.0.tgz", 68 | "integrity": "sha512-iK7tAZtpoghibjdB1ncCWykeBMmke3JThUe+rnkD4qkZaglOIQ70Pw7r5UJ4lyUT+7gnw7ehmmLUHDuhqzQD+g==", 69 | "dev": true 70 | }, 71 | "minimatch": { 72 | "version": "3.1.2", 73 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 74 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 75 | "dev": true, 76 | "requires": { 77 | "brace-expansion": "^1.1.7" 78 | } 79 | }, 80 | "ncp": { 81 | "version": "2.0.0", 82 | "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", 83 | "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=", 84 | "dev": true 85 | }, 86 | "once": { 87 | "version": "1.4.0", 88 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 89 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 90 | "dev": true, 91 | "requires": { 92 | "wrappy": "1" 93 | } 94 | }, 95 | "path-is-absolute": { 96 | "version": "1.0.1", 97 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 98 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 99 | "dev": true 100 | }, 101 | "rimraf": { 102 | "version": "2.6.3", 103 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", 104 | "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", 105 | "dev": true, 106 | "requires": { 107 | "glob": "^7.1.3" 108 | } 109 | }, 110 | "wrappy": { 111 | "version": "1.0.2", 112 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 113 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 114 | "dev": true 115 | } 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /publish/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nativescript-publish", 3 | "version": "1.0.0", 4 | "description": "Publish helper", 5 | "devDependencies": { 6 | "json": "^10.0.0", 7 | "ncp": "^2.0.0", 8 | "rimraf": "^2.5.0" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /publish/publish-alpha.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PACK_DIR=package; 4 | 5 | publish() { 6 | cd $PACK_DIR 7 | echo 'Publishing to npm...' 8 | npm publish *.tgz --tag alpha 9 | } 10 | 11 | ./pack.sh && publish 12 | -------------------------------------------------------------------------------- /publish/publish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PACK_DIR=package; 4 | 5 | publish() { 6 | cd $PACK_DIR 7 | echo 'Publishing to npm...' 8 | npm publish *.tgz 9 | } 10 | 11 | ./pack.sh && publish -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | ./www 2 | platforms/ios/Podfile 3 | platforms/ios/NotaWebViewExt/NotaWebViewExt.xcodeproj/xcuserdata 4 | platforms/ios/NotaWebViewExt/NotaWebViewExt.podspec 5 | nativescript-webview-bridge-loader.ts 6 | polyfills 7 | platforms/android/nativescript_webview_ext.aar 8 | angular/dist 9 | angular/nota-webview-ext-angular.d.ts 10 | angular/package.json 11 | -------------------------------------------------------------------------------- /src/.npmignore: -------------------------------------------------------------------------------- 1 | *.ts 2 | !*.d.ts 3 | tsconfig*.json 4 | tsfmt.json 5 | hooks 6 | polyfills 7 | make-bridge-loader.* 8 | .prettierignore 9 | nativescript-webview-bridge-loader.ts.tmpl 10 | www 11 | -------------------------------------------------------------------------------- /src/.prettierignore: -------------------------------------------------------------------------------- 1 | **/*.d.ts 2 | **/node_modules 3 | **/platforms 4 | nativescript-webview-bridge-loader.ts 5 | -------------------------------------------------------------------------------- /src/angular/index.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from "@angular/core"; 2 | import { isKnownView, NativeScriptCommonModule, registerElement } from "@nativescript/angular"; 3 | 4 | const webviewElementName = "WebViewExt"; 5 | 6 | if (!isKnownView(webviewElementName)) { 7 | registerElement(webviewElementName, () => require("@nota/nativescript-webview-ext").WebViewExt); 8 | } 9 | 10 | @NgModule() 11 | export class WebViewExtModule { 12 | imports: [NativeScriptCommonModule]; 13 | } 14 | -------------------------------------------------------------------------------- /src/angular/package.json.base: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nota-webview-ext-angular", 3 | "ngPackage": { 4 | "lib": { 5 | "entryFile": "index.ts", 6 | "umdModuleIds": { 7 | "@nativescript/core": "ns-core", 8 | "@nativescript/angular": "ns-angular", 9 | "@nota/nativescript-webview-ext": "ns-nota-webview-ext" 10 | } 11 | }, 12 | "whitelistedNonPeerDependencies": [ 13 | "." 14 | ] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/angular/tsconfig.angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../node_modules/ng-packagr/lib/ts/conf/tsconfig.ngc.json", 3 | "compilerOptions": { 4 | "types": ["node"], 5 | "baseUrl": ".", 6 | "paths": { 7 | "@nota/nativescript-webview-ext": [ 8 | "../" 9 | ], 10 | "@nota/nativescript-webview-ext/*": [ 11 | "../*" 12 | ] 13 | } 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/make-bridge-loader.ts: -------------------------------------------------------------------------------- 1 | require("tslib"); 2 | 3 | const fs = require("fs"); 4 | const Terser = require("terser"); 5 | const { promisify } = require("util"); 6 | 7 | const fsWriteFile = promisify(fs.writeFile); 8 | const fsReadFile = promisify(fs.readFile); 9 | 10 | async function nativescriptWebviewBridgeLoader() { 11 | let template = await fsReadFile("./nativescript-webview-bridge-loader.ts.tmpl", "UTF-8"); 12 | 13 | const values = { 14 | fetchPolyfill: await fsReadFile("./node_modules/whatwg-fetch/dist/fetch.umd.js", "UTF-8"), 15 | promisePolyfill: await fsReadFile("./node_modules/promise-polyfill/dist/polyfill.js", "UTF-8"), 16 | webViewBridge: await fsReadFile("./www/ns-webview-bridge.js", "UTF-8"), 17 | metadataViewPort: await fsReadFile("./www/metadata-view-port.js", "UTF-8"), 18 | }; 19 | 20 | for (const [name, value] of Object.entries(values)) { 21 | const terserRes = await Terser.minify(value, { 22 | compress: true, 23 | mangle: false, 24 | }); 25 | template = template.replace(``, JSON.stringify(terserRes.code)); 26 | } 27 | 28 | await fsWriteFile("./nativescript-webview-bridge-loader.ts", template); 29 | } 30 | 31 | async function worker() { 32 | await nativescriptWebviewBridgeLoader(); 33 | } 34 | 35 | worker(); 36 | -------------------------------------------------------------------------------- /src/nativescript-webview-bridge-loader.ts.tmpl: -------------------------------------------------------------------------------- 1 | export const fetchPolyfill: string = ; 2 | export const promisePolyfill: string = ; 3 | export const webViewBridge: string = ; 4 | export const metadataViewPort: string = ; 5 | -------------------------------------------------------------------------------- /src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@nota/nativescript-webview-ext", 3 | "version": "8.0.2", 4 | "description": "Extended WebView for NativeScript which adds 'x-local' scheme for local-files. events between WebView and native-layer, javascript execution, injecting CSS and JS-files.", 5 | "main": "webview-ext", 6 | "typings": "webview-ext.d.ts", 7 | "nativescript": { 8 | "platforms": { 9 | "android": "8.0.0", 10 | "ios": "8.0.0" 11 | } 12 | }, 13 | "scripts": { 14 | "setup": "ts-patch install", 15 | "build": "npm ci && rimraf www && npm-run-all setup build:webview-bridge make-bridge-loader ng-packagr tsc", 16 | "build:typings": "npm run build && (cd ../demo && TNS_TYPESCRIPT_DECLARATIONS_PATH=\"$PWD/../typings\" tns build ios) && cp ../typings/i386/*NotaWebViewExt.d.ts types/ios/NotaWebViewExt.d.ts", 17 | "build:webview-bridge": "export WWW_OUTDIR=$PWD/www; cd $(git rev-parse --show-toplevel)/www-src && npm i && npm run build -- --outDir ${WWW_OUTDIR}", 18 | "build:webview-bridge:watch": "npm run build:webview-bridge -- -w", 19 | "ci.run.test.android": "cd ../unittest && npm run ci.test.android", 20 | "ci.run.test.ios": "cd ../unittest && npm run ci.test.ios", 21 | "ci.test.android": "npm run build && npm-run-all test.install ci.run.test.android", 22 | "ci.test.ios": "npm run build && npm-run-all test.install ci.run.test.ios", 23 | "ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**'", 24 | "clean": "cd ../demo && rimraf hooks node_modules platforms && cd ../src && rimraf node_modules && npm run plugin.link", 25 | "demo.android": "npm run build && npm-run-all demo.install --parallel build:webview-bridge:watch plugin.tscwatch run.demo.android run.http-server", 26 | "demo.install": "cd ../demo && rm -f package-lock.json && npm install && npm install ../src", 27 | "demo.ios": "npm run build && npm-run-all demo.install --parallel build:webview-bridge:watch plugin.tscwatch run.demo.ios run.http-server", 28 | "demo.reset": "git clean -d -x -f ../demo && npm install", 29 | "format": "prettier --write --config ../.prettierrc.json angular/index.ts vue/index.ts *.ts", 30 | "format:check": "prettier -c --config ../.prettierrc.json angular/index.ts vue/index.ts *.ts", 31 | "lint:www": "cd ../www-src && npm run lint", 32 | "lint": "npm-run-all format:check tslint lint:www", 33 | "make-bridge-loader": "ts-node ./make-bridge-loader.ts", 34 | "ng-packagr": "cp angular/package.json.base angular/package.json && ng-packagr -p angular/package.json -c angular/tsconfig.angular.json && cp -av angular/dist/* angular/", 35 | "plugin.link": "npm link && cd ../demo && npm link nativescript-webview-ext && cd ../src", 36 | "plugin.prepare": "npm run tsc && cd ../demo && tns plugin remove nativescript-webview-ext && tns plugin add ../src", 37 | "plugin.tscwatch": "npm run build:webview-bridge && npm run tsc -- -w", 38 | "run.demo.android": "cd ../demo && tns debug android", 39 | "run.demo.ios": "cd ../demo && tns debug ios", 40 | "run.http-server": "cd ../demo/www && npx hs -p 8080 --cors", 41 | "run.test.android": "cd ../unittest && tns test android", 42 | "run.test.ios": "cd ../unittest && tns test ios", 43 | "test.android": "npm run build && npm-run-all test.install --parallel build:webview-bridge:watch plugin.tscwatch run.test.android", 44 | "test.install": "cd ../unittest && rm -f package-lock.json && npm install && npm install ../src", 45 | "test.ios": "npm run build && npm-run-all test.install --parallel build:webview-bridge:watch plugin.tscwatch run.test.ios", 46 | "test.reset": "git clean -d -x -f ../unittest && npm install", 47 | "tsc": "npx tsc -skipLibCheck", 48 | "tslint": "tslint '**/*.ts' --config ../tslint.json --exclude \"**/node_modules/**\" --exclude \"**/*.d.ts\" --exclude \"**/platforms/**\"" 49 | }, 50 | "keywords": [ 51 | "NativeScript", 52 | "JavaScript", 53 | "Android", 54 | "iOS", 55 | "WebView", 56 | "WkWebView" 57 | ], 58 | "author": { 59 | "name": "Nota", 60 | "email": "app@nota.dk", 61 | "url": "https://nota.dk" 62 | }, 63 | "contributors": [ 64 | { 65 | "name": "Morten Anton Bach Sjøgren", 66 | "url": "http://mabs.dk", 67 | "email": "m_abs@mabs.dk" 68 | }, 69 | { 70 | "name": "Daniel Dam Freiling", 71 | "email": "dfg@nota.dk" 72 | } 73 | ], 74 | "repository": { 75 | "type": "git", 76 | "url": "https://github.com/Notalib/nativescript-webview-ext.git" 77 | }, 78 | "bugs": { 79 | "url": "https://github.com/Notalib/nativescript-webview-ext/issues" 80 | }, 81 | "license": "Apache-2.0", 82 | "homepage": "https://github.com/Notalib/nativescript-webview-ext#readme", 83 | "devDependencies": { 84 | "@angular/animations": "^11.2.11", 85 | "@angular/common": "^11.2.11", 86 | "@angular/compiler": "^11.2.11", 87 | "@angular/compiler-cli": "^11.2.11", 88 | "@angular/core": "^11.2.11", 89 | "@angular/forms": "^11.2.11", 90 | "@angular/platform-browser": "^11.2.11", 91 | "@angular/platform-browser-dynamic": "^11.2.11", 92 | "@angular/router": "^11.2.11", 93 | "@nativescript/angular": "~11.2.0", 94 | "@nativescript/core": "^8.0.2", 95 | "@nativescript/types": "^8.0.1", 96 | "@nativescript/webpack": "^5.0.4", 97 | "@types/node": "^14.14.41", 98 | "nativescript-vue": "^2.9.0", 99 | "ng-packagr": "~11.2.4", 100 | "npm-run-all": "^4.1.5", 101 | "postcss": "^8.2.10", 102 | "prettier": "^2.2.1", 103 | "promise-polyfill": "~8.2.0", 104 | "prompt": "^1.1.0", 105 | "rimraf": "^3.0.2", 106 | "rxjs": "^6.6.7", 107 | "terser": "^5.6.1", 108 | "ts-node": "^9.1.1", 109 | "ts-patch": "^1.3.2", 110 | "tslib": "^2.2.0", 111 | "tslint": "^6.1.3", 112 | "typescript": "~4.1.5", 113 | "whatwg-fetch": "~3.6.2", 114 | "zone.js": "~0.11.4" 115 | }, 116 | "dependencies": { 117 | "url": "^0.11.0" 118 | }, 119 | "bootstrapper": "nativescript-plugin-seed" 120 | } 121 | -------------------------------------------------------------------------------- /src/platforms/android/webviewinterface.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/src/platforms/android/webviewinterface.aar -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AvailableLibraries 6 | 7 | 8 | LibraryIdentifier 9 | ios-arm64_i386_x86_64-simulator 10 | LibraryPath 11 | NotaWebViewExt.framework 12 | SupportedArchitectures 13 | 14 | arm64 15 | i386 16 | x86_64 17 | 18 | SupportedPlatform 19 | ios 20 | SupportedPlatformVariant 21 | simulator 22 | 23 | 24 | LibraryIdentifier 25 | ios-arm64_armv7 26 | LibraryPath 27 | NotaWebViewExt.framework 28 | SupportedArchitectures 29 | 30 | arm64 31 | armv7 32 | 33 | SupportedPlatform 34 | ios 35 | 36 | 37 | CFBundlePackageType 38 | XFWK 39 | XCFrameworkFormatVersion 40 | 1.0 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Headers/NotaWebViewExt.h: -------------------------------------------------------------------------------- 1 | // 2 | // NotaWebViewExt.h 3 | // NotaWebViewExt 4 | // 5 | // Created by Morten Anton Bach Sjøgren on 14/01/2020. 6 | // Copyright © 2020 Morten Anton Bach Sjøgren. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for NotaWebViewExt. 12 | FOUNDATION_EXPORT double NotaWebViewExtVersionNumber; 13 | 14 | //! Project version string for NotaWebViewExt. 15 | FOUNDATION_EXPORT const unsigned char NotaWebViewExtVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Info.plist -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/arm.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/arm.swiftdoc -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/arm.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) 3 | // swift-module-flags: -target armv7-apple-ios9.3 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name NotaWebViewExt 4 | import Foundation 5 | @_exported import NotaWebViewExt 6 | import Swift 7 | import WebKit 8 | @_inheritsConvenienceInitializers @available(iOS 11, *) 9 | @objc public class CustomUrlSchemeHandler : ObjectiveC.NSObject, WebKit.WKURLSchemeHandler { 10 | @objc public func resolveFilePath(_ url: Foundation.URL) -> Swift.String? 11 | @objc public func resolveMimeTypeFrom(filepath: Swift.String) -> Swift.String 12 | @objc public func webView(_ webView: WebKit.WKWebView, start urlSchemeTask: WebKit.WKURLSchemeTask) 13 | @objc public func webView(_ webView: WebKit.WKWebView, stop urlSchemeTask: WebKit.WKURLSchemeTask) 14 | @objc public func registerLocalResource(forKey: Swift.String, filepath: Swift.String) 15 | @objc public func unregisterLocalResource(forKey: Swift.String) 16 | @objc public func getRegisteredLocalResource(forKey: Swift.String) -> Swift.String? 17 | @objc public func clearRegisteredLocalResource() 18 | @objc deinit 19 | @objc override dynamic public init() 20 | } 21 | -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/arm64-apple-ios.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/arm64-apple-ios.swiftdoc -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/arm64-apple-ios.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) 3 | // swift-module-flags: -target arm64-apple-ios9.3 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name NotaWebViewExt 4 | import Foundation 5 | @_exported import NotaWebViewExt 6 | import Swift 7 | import WebKit 8 | @_inheritsConvenienceInitializers @available(iOS 11, *) 9 | @objc public class CustomUrlSchemeHandler : ObjectiveC.NSObject, WebKit.WKURLSchemeHandler { 10 | @objc public func resolveFilePath(_ url: Foundation.URL) -> Swift.String? 11 | @objc public func resolveMimeTypeFrom(filepath: Swift.String) -> Swift.String 12 | @objc public func webView(_ webView: WebKit.WKWebView, start urlSchemeTask: WebKit.WKURLSchemeTask) 13 | @objc public func webView(_ webView: WebKit.WKWebView, stop urlSchemeTask: WebKit.WKURLSchemeTask) 14 | @objc public func registerLocalResource(forKey: Swift.String, filepath: Swift.String) 15 | @objc public func unregisterLocalResource(forKey: Swift.String) 16 | @objc public func getRegisteredLocalResource(forKey: Swift.String) -> Swift.String? 17 | @objc public func clearRegisteredLocalResource() 18 | @objc deinit 19 | @objc override dynamic public init() 20 | } 21 | -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/arm64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/arm64.swiftdoc -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/arm64.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) 3 | // swift-module-flags: -target arm64-apple-ios9.3 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name NotaWebViewExt 4 | import Foundation 5 | @_exported import NotaWebViewExt 6 | import Swift 7 | import WebKit 8 | @_inheritsConvenienceInitializers @available(iOS 11, *) 9 | @objc public class CustomUrlSchemeHandler : ObjectiveC.NSObject, WebKit.WKURLSchemeHandler { 10 | @objc public func resolveFilePath(_ url: Foundation.URL) -> Swift.String? 11 | @objc public func resolveMimeTypeFrom(filepath: Swift.String) -> Swift.String 12 | @objc public func webView(_ webView: WebKit.WKWebView, start urlSchemeTask: WebKit.WKURLSchemeTask) 13 | @objc public func webView(_ webView: WebKit.WKWebView, stop urlSchemeTask: WebKit.WKURLSchemeTask) 14 | @objc public func registerLocalResource(forKey: Swift.String, filepath: Swift.String) 15 | @objc public func unregisterLocalResource(forKey: Swift.String) 16 | @objc public func getRegisteredLocalResource(forKey: Swift.String) -> Swift.String? 17 | @objc public func clearRegisteredLocalResource() 18 | @objc deinit 19 | @objc override dynamic public init() 20 | } 21 | -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/armv7-apple-ios.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/armv7-apple-ios.swiftdoc -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/armv7-apple-ios.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) 3 | // swift-module-flags: -target armv7-apple-ios9.3 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name NotaWebViewExt 4 | import Foundation 5 | @_exported import NotaWebViewExt 6 | import Swift 7 | import WebKit 8 | @_inheritsConvenienceInitializers @available(iOS 11, *) 9 | @objc public class CustomUrlSchemeHandler : ObjectiveC.NSObject, WebKit.WKURLSchemeHandler { 10 | @objc public func resolveFilePath(_ url: Foundation.URL) -> Swift.String? 11 | @objc public func resolveMimeTypeFrom(filepath: Swift.String) -> Swift.String 12 | @objc public func webView(_ webView: WebKit.WKWebView, start urlSchemeTask: WebKit.WKURLSchemeTask) 13 | @objc public func webView(_ webView: WebKit.WKWebView, stop urlSchemeTask: WebKit.WKURLSchemeTask) 14 | @objc public func registerLocalResource(forKey: Swift.String, filepath: Swift.String) 15 | @objc public func unregisterLocalResource(forKey: Swift.String) 16 | @objc public func getRegisteredLocalResource(forKey: Swift.String) -> Swift.String? 17 | @objc public func clearRegisteredLocalResource() 18 | @objc deinit 19 | @objc override dynamic public init() 20 | } 21 | -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/armv7.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/armv7.swiftdoc -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/armv7.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) 3 | // swift-module-flags: -target armv7-apple-ios9.3 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name NotaWebViewExt 4 | import Foundation 5 | @_exported import NotaWebViewExt 6 | import Swift 7 | import WebKit 8 | @_inheritsConvenienceInitializers @available(iOS 11, *) 9 | @objc public class CustomUrlSchemeHandler : ObjectiveC.NSObject, WebKit.WKURLSchemeHandler { 10 | @objc public func resolveFilePath(_ url: Foundation.URL) -> Swift.String? 11 | @objc public func resolveMimeTypeFrom(filepath: Swift.String) -> Swift.String 12 | @objc public func webView(_ webView: WebKit.WKWebView, start urlSchemeTask: WebKit.WKURLSchemeTask) 13 | @objc public func webView(_ webView: WebKit.WKWebView, stop urlSchemeTask: WebKit.WKURLSchemeTask) 14 | @objc public func registerLocalResource(forKey: Swift.String, filepath: Swift.String) 15 | @objc public func unregisterLocalResource(forKey: Swift.String) 16 | @objc public func getRegisteredLocalResource(forKey: Swift.String) -> Swift.String? 17 | @objc public func clearRegisteredLocalResource() 18 | @objc deinit 19 | @objc override dynamic public init() 20 | } 21 | -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module NotaWebViewExt { 2 | umbrella header "NotaWebViewExt.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module NotaWebViewExt.Swift { 9 | header "NotaWebViewExt-Swift.h" 10 | requires objc 11 | } 12 | -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/NotaWebViewExt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_armv7/NotaWebViewExt.framework/NotaWebViewExt -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Headers/NotaWebViewExt.h: -------------------------------------------------------------------------------- 1 | // 2 | // NotaWebViewExt.h 3 | // NotaWebViewExt 4 | // 5 | // Created by Morten Anton Bach Sjøgren on 14/01/2020. 6 | // Copyright © 2020 Morten Anton Bach Sjøgren. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for NotaWebViewExt. 12 | FOUNDATION_EXPORT double NotaWebViewExtVersionNumber; 13 | 14 | //! Project version string for NotaWebViewExt. 15 | FOUNDATION_EXPORT const unsigned char NotaWebViewExtVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Info.plist -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/arm64-apple-ios-simulator.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/arm64-apple-ios-simulator.swiftdoc -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/arm64-apple-ios-simulator.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) 3 | // swift-module-flags: -target arm64-apple-ios9.3-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name NotaWebViewExt 4 | import Foundation 5 | @_exported import NotaWebViewExt 6 | import Swift 7 | import WebKit 8 | @_inheritsConvenienceInitializers @available(iOS 11, *) 9 | @objc public class CustomUrlSchemeHandler : ObjectiveC.NSObject, WebKit.WKURLSchemeHandler { 10 | @objc public func resolveFilePath(_ url: Foundation.URL) -> Swift.String? 11 | @objc public func resolveMimeTypeFrom(filepath: Swift.String) -> Swift.String 12 | @objc public func webView(_ webView: WebKit.WKWebView, start urlSchemeTask: WebKit.WKURLSchemeTask) 13 | @objc public func webView(_ webView: WebKit.WKWebView, stop urlSchemeTask: WebKit.WKURLSchemeTask) 14 | @objc public func registerLocalResource(forKey: Swift.String, filepath: Swift.String) 15 | @objc public func unregisterLocalResource(forKey: Swift.String) 16 | @objc public func getRegisteredLocalResource(forKey: Swift.String) -> Swift.String? 17 | @objc public func clearRegisteredLocalResource() 18 | @objc deinit 19 | @objc override dynamic public init() 20 | } 21 | -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/arm64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/arm64.swiftdoc -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/arm64.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) 3 | // swift-module-flags: -target arm64-apple-ios9.3-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name NotaWebViewExt 4 | import Foundation 5 | @_exported import NotaWebViewExt 6 | import Swift 7 | import WebKit 8 | @_inheritsConvenienceInitializers @available(iOS 11, *) 9 | @objc public class CustomUrlSchemeHandler : ObjectiveC.NSObject, WebKit.WKURLSchemeHandler { 10 | @objc public func resolveFilePath(_ url: Foundation.URL) -> Swift.String? 11 | @objc public func resolveMimeTypeFrom(filepath: Swift.String) -> Swift.String 12 | @objc public func webView(_ webView: WebKit.WKWebView, start urlSchemeTask: WebKit.WKURLSchemeTask) 13 | @objc public func webView(_ webView: WebKit.WKWebView, stop urlSchemeTask: WebKit.WKURLSchemeTask) 14 | @objc public func registerLocalResource(forKey: Swift.String, filepath: Swift.String) 15 | @objc public func unregisterLocalResource(forKey: Swift.String) 16 | @objc public func getRegisteredLocalResource(forKey: Swift.String) -> Swift.String? 17 | @objc public func clearRegisteredLocalResource() 18 | @objc deinit 19 | @objc override dynamic public init() 20 | } 21 | -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/i386-apple-ios-simulator.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/i386-apple-ios-simulator.swiftdoc -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/i386-apple-ios-simulator.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) 3 | // swift-module-flags: -target i386-apple-ios9.3-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name NotaWebViewExt 4 | import Foundation 5 | @_exported import NotaWebViewExt 6 | import Swift 7 | import WebKit 8 | @_inheritsConvenienceInitializers @available(iOS 11, *) 9 | @objc public class CustomUrlSchemeHandler : ObjectiveC.NSObject, WebKit.WKURLSchemeHandler { 10 | @objc public func resolveFilePath(_ url: Foundation.URL) -> Swift.String? 11 | @objc public func resolveMimeTypeFrom(filepath: Swift.String) -> Swift.String 12 | @objc public func webView(_ webView: WebKit.WKWebView, start urlSchemeTask: WebKit.WKURLSchemeTask) 13 | @objc public func webView(_ webView: WebKit.WKWebView, stop urlSchemeTask: WebKit.WKURLSchemeTask) 14 | @objc public func registerLocalResource(forKey: Swift.String, filepath: Swift.String) 15 | @objc public func unregisterLocalResource(forKey: Swift.String) 16 | @objc public func getRegisteredLocalResource(forKey: Swift.String) -> Swift.String? 17 | @objc public func clearRegisteredLocalResource() 18 | @objc deinit 19 | @objc override dynamic public init() 20 | } 21 | -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/i386.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/i386.swiftdoc -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/i386.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) 3 | // swift-module-flags: -target i386-apple-ios9.3-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name NotaWebViewExt 4 | import Foundation 5 | @_exported import NotaWebViewExt 6 | import Swift 7 | import WebKit 8 | @_inheritsConvenienceInitializers @available(iOS 11, *) 9 | @objc public class CustomUrlSchemeHandler : ObjectiveC.NSObject, WebKit.WKURLSchemeHandler { 10 | @objc public func resolveFilePath(_ url: Foundation.URL) -> Swift.String? 11 | @objc public func resolveMimeTypeFrom(filepath: Swift.String) -> Swift.String 12 | @objc public func webView(_ webView: WebKit.WKWebView, start urlSchemeTask: WebKit.WKURLSchemeTask) 13 | @objc public func webView(_ webView: WebKit.WKWebView, stop urlSchemeTask: WebKit.WKURLSchemeTask) 14 | @objc public func registerLocalResource(forKey: Swift.String, filepath: Swift.String) 15 | @objc public func unregisterLocalResource(forKey: Swift.String) 16 | @objc public func getRegisteredLocalResource(forKey: Swift.String) -> Swift.String? 17 | @objc public func clearRegisteredLocalResource() 18 | @objc deinit 19 | @objc override dynamic public init() 20 | } 21 | -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/x86_64-apple-ios-simulator.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/x86_64-apple-ios-simulator.swiftdoc -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/x86_64-apple-ios-simulator.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) 3 | // swift-module-flags: -target x86_64-apple-ios9.3-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name NotaWebViewExt 4 | import Foundation 5 | @_exported import NotaWebViewExt 6 | import Swift 7 | import WebKit 8 | @_inheritsConvenienceInitializers @available(iOS 11, *) 9 | @objc public class CustomUrlSchemeHandler : ObjectiveC.NSObject, WebKit.WKURLSchemeHandler { 10 | @objc public func resolveFilePath(_ url: Foundation.URL) -> Swift.String? 11 | @objc public func resolveMimeTypeFrom(filepath: Swift.String) -> Swift.String 12 | @objc public func webView(_ webView: WebKit.WKWebView, start urlSchemeTask: WebKit.WKURLSchemeTask) 13 | @objc public func webView(_ webView: WebKit.WKWebView, stop urlSchemeTask: WebKit.WKURLSchemeTask) 14 | @objc public func registerLocalResource(forKey: Swift.String, filepath: Swift.String) 15 | @objc public func unregisterLocalResource(forKey: Swift.String) 16 | @objc public func getRegisteredLocalResource(forKey: Swift.String) -> Swift.String? 17 | @objc public func clearRegisteredLocalResource() 18 | @objc deinit 19 | @objc override dynamic public init() 20 | } 21 | -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/NotaWebViewExt.swiftmodule/x86_64.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) 3 | // swift-module-flags: -target x86_64-apple-ios9.3-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name NotaWebViewExt 4 | import Foundation 5 | @_exported import NotaWebViewExt 6 | import Swift 7 | import WebKit 8 | @_inheritsConvenienceInitializers @available(iOS 11, *) 9 | @objc public class CustomUrlSchemeHandler : ObjectiveC.NSObject, WebKit.WKURLSchemeHandler { 10 | @objc public func resolveFilePath(_ url: Foundation.URL) -> Swift.String? 11 | @objc public func resolveMimeTypeFrom(filepath: Swift.String) -> Swift.String 12 | @objc public func webView(_ webView: WebKit.WKWebView, start urlSchemeTask: WebKit.WKURLSchemeTask) 13 | @objc public func webView(_ webView: WebKit.WKWebView, stop urlSchemeTask: WebKit.WKURLSchemeTask) 14 | @objc public func registerLocalResource(forKey: Swift.String, filepath: Swift.String) 15 | @objc public func unregisterLocalResource(forKey: Swift.String) 16 | @objc public func getRegisteredLocalResource(forKey: Swift.String) -> Swift.String? 17 | @objc public func clearRegisteredLocalResource() 18 | @objc deinit 19 | @objc override dynamic public init() 20 | } 21 | -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module NotaWebViewExt { 2 | umbrella header "NotaWebViewExt.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module NotaWebViewExt.Swift { 9 | header "NotaWebViewExt-Swift.h" 10 | requires objc 11 | } 12 | -------------------------------------------------------------------------------- /src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/NotaWebViewExt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/src/platforms/ios/NotaWebViewExt.xcframework/ios-arm64_i386_x86_64-simulator/NotaWebViewExt.framework/NotaWebViewExt -------------------------------------------------------------------------------- /src/polyfills/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/src/polyfills/.gitkeep -------------------------------------------------------------------------------- /src/tsconfig.aot.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "lib": [ 6 | "es6", 7 | "dom", 8 | "es2015.iterable" 9 | ], 10 | "emitDecoratorMetadata": true, 11 | "moduleResolution": "node" 12 | }, 13 | "files": [ 14 | "angular/index.ts" 15 | ], 16 | "angularCompilerOptions": { 17 | "skipTemplateCodegen": true 18 | } 19 | } -------------------------------------------------------------------------------- /src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "strictNullChecks": true, 5 | "allowUnreachableCode": false, 6 | "allowUnusedLabels": false, 7 | "declaration": true, 8 | "downlevelIteration": true, 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "inlineSourceMap": true, 12 | "inlineSources": true, 13 | "lib": [ 14 | "es6", 15 | "dom", 16 | "es2015.iterable", 17 | "es2017.object" 18 | ], 19 | "module": "esnext", 20 | "moduleResolution": "node", 21 | "noEmitHelpers": true, 22 | "noEmitOnError": false, 23 | "noFallthroughCasesInSwitch": true, 24 | "noImplicitAny": false, 25 | "noImplicitReturns": true, 26 | "noImplicitUseStrict": false, 27 | "noLib": false, 28 | "noUnusedLocals": true, 29 | "pretty": false, 30 | "removeComments": true, 31 | "skipLibCheck": true, 32 | "target": "ES2017", 33 | "plugins": [{ 34 | "transform": "@nativescript/webpack/dist/transformers/NativeClass/index.js", 35 | "type": "raw" 36 | }] 37 | }, 38 | "exclude": ["node_modules", "platforms"] 39 | } 40 | -------------------------------------------------------------------------------- /src/tsfmt.json: -------------------------------------------------------------------------------- 1 | { 2 | "indentSize": 4, 3 | "tabSize": 4 4 | } 5 | -------------------------------------------------------------------------------- /src/types/android/webviewinterface.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare namespace dk { 4 | export namespace nota { 5 | export namespace webviewinterface { 6 | export class WebViewBridgeInterface { 7 | public emitEvent(param0: string, param1: string): void; 8 | public emitEventToNativeScript(param0: string, param1: string): void; 9 | public constructor(); 10 | } 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/types/ios/NotaWebViewExt.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare class CustomUrlSchemeHandler extends NSObject { 4 | 5 | static alloc(): CustomUrlSchemeHandler; // inherited from NSObject 6 | 7 | static new(): CustomUrlSchemeHandler; // inherited from NSObject 8 | 9 | checkTcpPortForListenWithPort(port: number): boolean; 10 | 11 | clearRegisteredLocalResource(): void; 12 | 13 | getRegisteredLocalResourceForKey(forKey: string): string; 14 | 15 | registerLocalResourceForKeyFilepath(forKey: string, filepath: string): void; 16 | 17 | resolveFilePath(url: NSURL): string; 18 | 19 | resolveMimeTypeFromFilepath(filepath: string): string; 20 | 21 | unregisterLocalResourceForKey(forKey: string): void; 22 | 23 | webViewStartURLSchemeTask(webView: WKWebView, urlSchemeTask: WKURLSchemeTask): void; 24 | 25 | webViewStopURLSchemeTask(webView: WKWebView, urlSchemeTask: WKURLSchemeTask): void; 26 | } 27 | 28 | declare var NotaWebViewExtVersionNumber: number; 29 | 30 | declare var NotaWebViewExtVersionString: interop.Reference; 31 | -------------------------------------------------------------------------------- /src/types/url.d.ts: -------------------------------------------------------------------------------- 1 | declare module "url" { 2 | export interface ParsedUrlQuery { 3 | [key: string]: string | string[]; 4 | } 5 | 6 | export class Url { 7 | protocol?: string | null; 8 | slashes?: boolean | null; 9 | auth?: string | null; 10 | host?: string | null; 11 | port?: string | null; 12 | hostname?: string | null; 13 | hash?: string | null; 14 | search?: string | null; 15 | query?: string | null | ParsedUrlQuery; 16 | pathname?: string | null; 17 | path?: string | null; 18 | href?: string | null; 19 | public format(): string; 20 | public resolve(relative: Url): string; 21 | public resolveObject(source: string, relative: string): Url; 22 | } 23 | 24 | export function parse(input: string): Url; 25 | export function format(url: Url): string; 26 | export function resolve(source: Url, relative: Url): string; 27 | export function resolveObject(source: string, relative: string): Url; 28 | } 29 | -------------------------------------------------------------------------------- /src/vue/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/vue/index.ts: -------------------------------------------------------------------------------- 1 | import Vue from "nativescript-vue"; 2 | 3 | const webviewElementName = "WebViewExt"; 4 | Vue.registerElement(webviewElementName, () => require("@nota/nativescript-webview-ext").WebViewExt); 5 | -------------------------------------------------------------------------------- /src/webview-ext.d.ts: -------------------------------------------------------------------------------- 1 | import { LoadEventData, WebViewEventData, WebViewExtBase, LoadFinishedEventData, LoadStartedEventData } from "./webview-ext-common"; 2 | 3 | export * from "./webview-ext-common"; 4 | 5 | /** 6 | * Represents a standard WebView widget. 7 | */ 8 | export class WebViewExt extends WebViewExtBase {} 9 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "linterOptions": { 3 | "exclude": [ 4 | "**/platforms", 5 | "**/node_modules" 6 | ] 7 | }, 8 | "rules": { 9 | "newline-before-return": true, 10 | "class-name": true, 11 | "comment-format": [ 12 | true, 13 | "check-space" 14 | ], 15 | "indent": [ 16 | true, 17 | "spaces", 18 | 4 19 | ], 20 | "no-duplicate-variable": true, 21 | "no-eval": true, 22 | "no-internal-module": true, 23 | "no-trailing-whitespace": true, 24 | "no-var-keyword": true, 25 | "one-line": [ 26 | true, 27 | "check-open-brace", 28 | "check-whitespace" 29 | ], 30 | "ordered-imports": true, 31 | "prefer-template": true, 32 | "quotemark": [ 33 | false, 34 | "double" 35 | ], 36 | "semicolon": [ 37 | true, 38 | "always" 39 | ], 40 | "triple-equals": [ 41 | true, 42 | "allow-null-check" 43 | ], 44 | "typedef-whitespace": [ 45 | true, 46 | { 47 | "call-signature": "nospace", 48 | "index-signature": "nospace", 49 | "parameter": "nospace", 50 | "property-declaration": "nospace", 51 | "variable-declaration": "nospace" 52 | } 53 | ], 54 | "variable-name": [ 55 | true, 56 | "ban-keywords" 57 | ], 58 | "whitespace": [ 59 | true, 60 | "check-branch", 61 | "check-decl", 62 | "check-operator", 63 | "check-separator", 64 | "check-type" 65 | ] 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /unittest/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | trim_trailing_whitespace = true 7 | charset = utf-8 8 | 9 | [*.json] 10 | indent_style = space 11 | indent_size = 2 12 | 13 | [*.js] 14 | indent_style = space 15 | indent_size = 2 16 | 17 | [*.ts] 18 | indent_style = space 19 | indent_size = 2 -------------------------------------------------------------------------------- /unittest/.gitignore: -------------------------------------------------------------------------------- 1 | # NativeScript 2 | hooks/ 3 | node_modules/ 4 | platforms/ 5 | 6 | # Logs 7 | logs 8 | *.log 9 | npm-debug.log* 10 | yarn-debug.log* 11 | yarn-error.log* 12 | 13 | # General 14 | .DS_Store 15 | .AppleDouble 16 | .LSOverride 17 | .idea 18 | .cloud 19 | .project 20 | tmp/ 21 | typings/ 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | -------------------------------------------------------------------------------- /unittest/.prettierignore: -------------------------------------------------------------------------------- 1 | **/*.d.ts 2 | **/node_modules 3 | **/platforms 4 | -------------------------------------------------------------------------------- /unittest/App_Resources/Android/app.gradle: -------------------------------------------------------------------------------- 1 | // Add your native dependencies here: 2 | 3 | // Uncomment to add recyclerview-v7 dependency 4 | //dependencies { 5 | // implementation 'com.android.support:recyclerview-v7:+' 6 | //} 7 | 8 | // If you want to add something to be applied before applying plugins' include.gradle files 9 | // e.g. project.ext.googlePlayServicesVersion = "15.0.1" 10 | // create a file named before-plugins.gradle in the current directory and place it there 11 | 12 | android { 13 | defaultConfig { 14 | minSdkVersion 17 15 | generatedDensities = [] 16 | } 17 | aaptOptions { 18 | additionalParameters "--no-version-vectors" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/drawable-hdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/Android/src/main/res/drawable-hdpi/background.png -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/drawable-hdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/Android/src/main/res/drawable-hdpi/logo.png -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/drawable-ldpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/Android/src/main/res/drawable-ldpi/background.png -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/drawable-ldpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/Android/src/main/res/drawable-ldpi/logo.png -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/drawable-mdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/Android/src/main/res/drawable-mdpi/background.png -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/drawable-mdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/Android/src/main/res/drawable-mdpi/logo.png -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/drawable-xhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/Android/src/main/res/drawable-xhdpi/background.png -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/Android/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/Android/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/Android/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/Android/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/Android/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/values-v21/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #65ADF1 4 | -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 13 | 14 | 15 | 18 | 19 | 20 | 23 | 24 | 28 | -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/values-v29/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 11 | 12 | -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F5F5F5 4 | #757575 5 | #65ADF1 6 | #272734 7 | -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /unittest/App_Resources/Android/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 17 | 18 | 20 | 21 | 22 | 29 | 30 | 32 | 33 | 34 | 39 | 40 | 42 | 43 | -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "icon-20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "icon-20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "icon-29.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "icon-29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "icon-29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "icon-40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "icon-40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "icon-60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "icon-60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "icon-20.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "icon-20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "icon-29.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "icon-29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "icon-40.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "icon-40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "icon-76.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "icon-76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "icon-83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "icon-1024.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-AspectFill.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-AspectFill@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchScreen-AspectFill@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-Center.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-Center@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchScreen-Center@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Notalib/nativescript-webview-ext/be17735d5243fbbf09f10fc8cea48192680dd757/unittest/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiresFullScreen 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /unittest/App_Resources/iOS/build.xcconfig: -------------------------------------------------------------------------------- 1 | // You can add custom settings here 2 | // for example you can uncomment the following line to force distribution code signing 3 | // CODE_SIGN_IDENTITY = iPhone Distribution 4 | // To build for device with XCode you need to specify your development team. 5 | // DEVELOPMENT_TEAM = YOUR_TEAM_ID; 6 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 7 | -------------------------------------------------------------------------------- /unittest/app/app-root.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /unittest/app/app.css: -------------------------------------------------------------------------------- 1 | /* 2 | In NativeScript, the app.css file is where you place CSS rules that 3 | you would like to apply to your entire application. Check out 4 | http://docs.nativescript.org/ui/styling for a full list of the CSS 5 | selectors and properties you can use to style UI components. 6 | 7 | /* 8 | In many cases you may want to use the NativeScript core theme instead 9 | of writing your own CSS rules. You can learn more about the 10 | NativeScript core theme at https://github.com/nativescript/theme 11 | The imported CSS rules must precede all other types of rules. 12 | */ 13 | @import '@nativescript/theme/css/core.css'; 14 | @import '@nativescript/theme/css/default.css'; 15 | 16 | /* Place any CSS rules you want to apply on both iOS and Android here. 17 | This is where the vast majority of your CSS code goes. */ 18 | 19 | /* 20 | The following CSS rule changes the font size of all Buttons that have the 21 | '-primary' class modifier. 22 | */ 23 | Button.-primary { 24 | font-size: 18; 25 | } 26 | -------------------------------------------------------------------------------- /unittest/app/app.ts: -------------------------------------------------------------------------------- 1 | /* 2 | In NativeScript, the app.ts file is the entry point to your application. 3 | You can use this file to perform app-level initialization, but the primary 4 | purpose of the file is to pass control to the app’s first module. 5 | */ 6 | 7 | import { Application } from '@nativescript/core' 8 | 9 | Application.run({ moduleName: 'app-root' }) 10 | 11 | /* 12 | Do not place any code after the application has been started as it will not 13 | be executed on iOS. 14 | */ 15 | -------------------------------------------------------------------------------- /unittest/app/assets/css/local-stylesheet.css: -------------------------------------------------------------------------------- 1 | .red { 2 | margin: 0; 3 | padding: 0; 4 | font-weight: bolder; 5 | background-color: blue; 6 | color: green; 7 | font-size: 20pt; 8 | } 9 | 10 | body, 11 | html { 12 | margin: 0; 13 | padding: 0; 14 | background-color: purple; 15 | } 16 | -------------------------------------------------------------------------------- /unittest/app/assets/html/css-not-predefined.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Inject stylesheet via x-local 5 | 6 | 7 | 8 |

RED

9 | 10 | 11 | -------------------------------------------------------------------------------- /unittest/app/assets/html/css-predefined-link-tags.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Load predefined x-local stylesheet 5 | 6 | 7 | 8 |

RED

9 | 10 | 11 | -------------------------------------------------------------------------------- /unittest/app/assets/html/empty.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Blank 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /unittest/app/assets/html/javascript-calls-x-local.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Blank 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /unittest/app/assets/html/javascript-calls.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /unittest/app/assets/html/test with spaces.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | MyTitle 5 | 6 | 7 | 8 | TestÖ with Spaces 9 | 10 | 11 | -------------------------------------------------------------------------------- /unittest/app/assets/html/test.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | MyTitle 5 | 6 | 7 | 8 | TestÖ 9 | 10 | 11 | -------------------------------------------------------------------------------- /unittest/app/assets/js/local-javascript.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | function getNumber() { 4 | return 42; 5 | } 6 | 7 | function getNumberFloat() { 8 | return 3.14; 9 | } 10 | 11 | function getFalse() { 12 | return false; 13 | } 14 | 15 | function getTruth() { 16 | return true; 17 | } 18 | 19 | function getString() { 20 | return 'string result from webview JS function'; 21 | } 22 | 23 | function getArray() { 24 | return [1.5, true, "hello"]; 25 | } 26 | 27 | function getObject() { 28 | return { 29 | prop: "test", 30 | name: "object-test", 31 | values: [ 32 | 42, 33 | 3.14 34 | ] 35 | }; 36 | } 37 | 38 | function setupEventListener() { 39 | window.nsWebViewBridge.on('tns-message', function(args) { 40 | window.nsWebViewBridge.emit('web-message', args); 41 | }); 42 | } 43 | 44 | function testPromiseResolve() { 45 | return new Promise(function(resolve) { 46 | setTimeout(function() { 47 | resolve(42); 48 | }, 100); 49 | }); 50 | } 51 | 52 | function testPromiseReject() { 53 | return new Promise(function(resolve, reject) { 54 | setTimeout(function() { 55 | reject(new Error('The Cake is a Lie')); 56 | }, 100); 57 | }); 58 | } 59 | -------------------------------------------------------------------------------- /unittest/app/main-page.ts: -------------------------------------------------------------------------------- 1 | /* 2 | In NativeScript, a file with the same name as an XML file is known as 3 | a code-behind file. The code-behind is a great place to place your view 4 | logic, and to set up your page’s data binding. 5 | */ 6 | 7 | import { EventData, Page } from '@nativescript/core' 8 | import { HelloWorldModel } from './main-view-model' 9 | 10 | // Event handler for Page 'navigatingTo' event attached in main-page.xml 11 | export function navigatingTo(args: EventData) { 12 | /* 13 | This gets a reference this page’s UI component. You can 14 | view the API reference of the Page to see what’s available at 15 | https://docs.nativescript.org/api-reference/classes/_ui_page_.page.html 16 | */ 17 | const page = args.object 18 | 19 | /* 20 | A page’s bindingContext is an object that should be used to perform 21 | data binding between XML markup and TypeScript code. Properties 22 | on the bindingContext can be accessed using the {{ }} syntax in XML. 23 | In this example, the {{ message }} and {{ onTap }} bindings are resolved 24 | against the object returned by createViewModel(). 25 | 26 | You can learn more about data binding in NativeScript at 27 | https://docs.nativescript.org/core-concepts/data-binding. 28 | */ 29 | page.bindingContext = new HelloWorldModel() 30 | } 31 | -------------------------------------------------------------------------------- /unittest/app/main-page.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | 13 | 14 | 25 | 26 |