Git Product home page Git Product logo

manifoldcordova's Issues

ios - !gap_exec requests

I'm injecting a javascript file to do some mobile-specific things like set up notifications etc...

I just noticed that I'm getting loads of HEAD requests to my wrapped site, for the URL https://mywrappedsite.com/!gap_exec

Now, as far as I can tell, this isn't affecting the app - everything seems to be running OK, but I'm still seeing a bunch of these requests for each page load. Even if I comment out the injected script so that it doesn't do anything, I'm still seeing one hit per request.

Soooooo, it would appear that gap_exec is something that cordova uses internally to talk to internal phone hardware, correct? (Source: http://stackoverflow.com/questions/16631230/phonegap-cordova-2-7-0-exec-gap-file-not-found)

So it looks like something is ammis here? I can see on the ios specific cordova.js, line 1016:

execXhr.open('HEAD', "/!gap_exec?" + (+new Date()), true);

Now, because that url is relative - / rather than file:// I can see why this potentially might upset things for a hosted web app.

Thoughts?

ManifoldCordova freeze (Android) app

On my external page i have some javascript code that creates an event.

This event is caught by some javascript within my app.

Sometimes the app freezes completely.

It also raises the error below several times when reloading the page (not sure if this is related):

// Workaround for Windows 10 in hosted environment case
// http://www.w3.org/html/wg/drafts/html/master/browsers.html#named-access-on-the-window-object
if (window.cordova && !(window.cordova instanceof HTMLElement)) {
throw new Error("cordova already defined");
}

Windows 10 UWP Support?

Does this plugin currently support creating UWP projects for Win10? I noticed in the doc only Windows 8.1 is listed as supported.

Add support in Windows to control web page requests

Cordova Android and iOS provide additional support to control which network requests triggered by the page in the webview (css, js, images, XHRs, etc) are allowed to be made; this means that any content requested by the page that does not belong to the whitelist will be blocked.

This is currently not supported by Windows

Cordova iOS 4.x support

Is there any plans to support cordova ios 4.x ? What are the issues preventing this to work ?

UWP Win 10 WinJS error

Using VS 2015 with Cordova Tools, Cordova 6.1.1:
When running UWP Win 10 version of blank app with hostedwebapp plugin installed, a WinJS error pops up:

Unhandled exception at line 9, column 9 in ms-appx://[REMOVED]/www/js/wrapper.js

0x800a1391 - JavaScript runtime error: 'WinJS' is undefined

Workaround:
I've wrapped the whole content of wrapper.js into a window.load =function() { } block to make sure it's executed only when wapper.html has loaded.
Seems to do the trick.

Just wanted to make sure that this is a correct workaround.
Thanks!

Cannot find module '../../node_modules/elementtree'

When building for ios, I get this warning:

The module "ConfigParser" has been factored into "cordova-common". Consider update your plugin hooks.

followed by this error:

Error: Cannot find module '../../node_modules/elementtree'

manifest.json is created before adding plugin and elementtree exists in platforms\ios\cordova\node_modules

Validate that the start_url member in the manifest is a full URL

Even though a relative URL is a valid start_url according to the W3C spec, ManifoldCordova requires a full URL (because the plugin cannot determine the manifest's origin once it has been downloaded).

The plugin should validate this member and issue a suitable error message if it finds a relative URL. There should be also an initial check that the start_url member actually exists in the manifest, and if not show an appropriate error message.

Support JavaScript interface of Cordova plugins in Windows

Since the Windows platform does not support remote content on the app container natively, the ManifoldCordova plugin adds a WebView to the landing page to render the website content specified in the manifest.json.

The current drawback of this approach is that there is no communication between the JavaScript running on the webview and the native code of the plugins. For example, the JavaScript interface of the plugins is not executed in the webview, so the JavaScript methods exposed by the plugins are not available.

Windows 10 UWP / Visual Studio Cordova Tools... Wrapper.js copy error

i'm using visual studio 2015 with Cordova tools installed (cordova 6.1.1). Have used Cordova CLI to add hosted webapp plugin. When trying to build Windows 10 UWP version, the build process is unable to copy wrapper.js to platforms/windows/www/js/ as the js folder does not exist.

Copying wrapper js file for the windows platform from E:[REMOVED]\plugins\cordova-plugin-hostedwebapp\assets\windows\wrapper.js to E:[REMOVED]\platforms\windows\www\js\wrapper.js.
1>MSBUILD : cordova-build error : [Error: ENOENT, open 'E:[REMOVED]\platforms\windows\www\js\wrapper.js']

My workaround:
I've updated "copyFile" function in replaceWindowsWrapperFiles.js to create the copy destination directory if it doesnt exist.

Just wanted to make sure I've not done anything wrong and my workaroudn was the correct workaround.
Thanks

[Feature] Catch non-200 HTTP responses and try to reload page (in 1 minute?)

I have deployed the manifoldjs to some installations now and it is working fine!

However, for my project it would be really helpfull if the manifold shell could detect if a page change was correct, a.k.:

first, you are on page /test
then you reload page with (location.reload()), but the server has an issue and gives back 500,
* then the script waits 1 or 5 minutes, and retries to load page again. *
The same for other non-200 responses.

Icons from manifest - wrong name in config.xml

I think this is a bug, although there is a chance it's me misunderstanding something:

  1. Create a manifest, and add a bunch of icons, for example:
    "icons": [
        {
            "src": "/content/images/mobile/icons/mdpi/harry.png",
            "sizes": "48x48",
            "type": "image/png"
        },
        {
            "src": "/content/images/mobile/icons/hdpi/harry.png",
            "sizes": "72x72",
            "type": "image/png"
        },
        {
            "src": "/content/images/mobile/icons/xhdpi/harry.png",
            "sizes": "96x96",
            "type": "image/png"
        },
        {
            "src": "/content/images/mobile/icons/xxhdpi/harry.png",
            "sizes": "144x144",
            "type": "image/png"
        }
    ],   

Notice how the name is harry.png.

Now, when you do a cordova prepare, the icons are downloaded and copied into the cordova folder into the correct paths, BUT when they get copied to the android res folder, they are all renamed to icon.png, which is at odds with the manifest and config.xml.

When you then run the resulting app (for me, on an android device), you don't see the specified icon, just the manifold logo. I'm assuming this is because it looked for, and failed to find harry.png?

Android: evaluateJavascript fallback fails

On devices that don't support the evaluateJavascript method on the WebView, the fallback using .loadUrl("javascript:" + ...) doesn't properly work either.

E/Web Console: Uncaught SyntaxError: Unexpected token % at null:1

All special chars of the script are "percent encoded" by Uri.encode() before being handed over to .loadUrl(), which seems to cause this error. I.e. it will choke on spaces in the script (%20) and such.

Simply removing the Uri.encode() call seems to fix the problem:
https://github.com/manifoldjs/ManifoldCordova/blob/master/src/android/HostedWebApp.java#L550

me.webView.getEngine().loadUrl("javascript:" + scriptToInject, false);

Tested on Android Jelly Bean 4.3, Samsung Galaxy Nexus

Update Cordova?

I'm running the latest version of Cordova, which means I get deprecation warnings because this plugin requires very outdated versions of iOS and Android.

Installing "cordova-plugin-hostedwebapp" for android
Plugin doesn't support this project's cordova-android version. cordova-android: 5.1.1, failed version requirement: <=4.1.1
Skipping 'cordova-plugin-hostedwebapp' for android
Installing "cordova-plugin-hostedwebapp" for ios
Plugin doesn't support this project's cordova-ios version. cordova-ios: 4.1.1, failed version requirement: <=3.9.2
Skipping 'cordova-plugin-hostedwebapp' for ios

Any chance of getting this updated anytime soon?

Review offline experience

This concern was raised in #23:

Currently, an offline overlay is automatically displayed when the connection is lost. However, there are scenarios when the page was properly loaded, and the user wants to continue seeing the content of the page even if the device is eventually disconnected.

The behavior should be reviewed so that:

  • When the connection is lost, let the user keep seeing the app's content and do not show the offline overlay
  • If the user performs an action that requires Internet connection and there is no connection, show the offline overlay
  • When the connection is restored, hide the offline overlay

We should look at the Cordova's ErrorUrl preference which might cover this scenario.

cordova.plugins not available in webview?

Hi and thanks for this nice plugin.

I have setup the plugin according to the tutorial.
I also included some plugins, for example the ionic-keyboard-plugin.
Now when I chrome://inspect on my device, cordova.plugins does not exist. It seems like the page is loaded without the plugins?

My manifest:

{
"lang": "en",
"name": "rd",
"short_name": "rd",
"icons": [{
"src": "icon/lowres",
"sizes": "64x64",
"type": "image/webp"
}, {
"src": "icon/hd_small",
"sizes": "64x64"
}, {
"src": "icon/hd_hi",
"sizes": "128x128",
"density": 2
}],
"scope": "/",
"start_url": "https://linkedin.com",
"display": "fullscreen",
"orientation": "landscape",
"theme_color": "aliceblue",
"mjs_api_access": { "match": "*", "platform": "android", "access": "cordova" }
}

The offline event works well!

Incompatibility with cordova-plugin-statusbar > 0.1.6

When cordova-plugin-hostedwebapp is used together with cordova-plugin-statusbar, the WebView becomes non-interactive (cannot click on links/buttons/forms) and the scrolling breaks (somehow, scrollbars can appear).

The issue is present for any version of cordova-plugin-statusbar greater than 0.1.6 (older versions will work).

Removing this last line from createOfflineView in CDVHostedWebApp.m seems to solve the issue but there is probably a better fix to be done?

[self.viewController.view sendSubviewToBack:self.webView];

Breaking changes with Cordova v5.1.1

There are some breaking changes in the Windows platform (cordova-windows 4.0.0) that need to be addressed in the plugin:

  • Cordova now updates the StarPage property for windows manifests in the "prepare" phase (using content src property from config.xml). Since the plugin sets the wrapper.html start page in the config.xml after the "prepare" phase, the changes never take effect.
  • There are new icon sizes: 44x44 and 71x71. Default icons with the manifold logo need to be provided for those sizes

Change Plugin Name

The repo for this plugin is called Manifold Cordova, and the plugin itself is called cordova-plugin-hostedwebapp. This plugin is pretty useful for a general cordova app to detect network issues and display an offline page.
Please consider re-naming this plugin to cordova-plugin-offlinepage to better reflect its purpose.

Working with Simple Cordova App

One of the hooks in this apps looks for a W3C Manifest.json. As a result, this plugin cannot be added to a regular Cordova hook.

Does it make sense to skip the manifest steps if such a file does not exist ? This way, the plugin can be added to Cordova also.

Before_prepare hook downloads icon files again on subsequent runs

The If-Modified-Since HTTP header appears to be ignored when issuing multiple requests to the same resource.

In the before_prepare hook, calling downloadImage multiple times using the same inputUri always returns "200 OK" and downloads the image every time. It should return "304 - Not Modified" for subsequent requests.

This behavior can be seen in ManifoldJS which calls cordova add platform, cordova prepare, and cordova build in quick succession. Executing the same sequence from the command line works as expected.

No return from offline on iOS

We're building a mobile app using manifoldJS. On iOS, when we lose the network (e.g. airplane mode), and then re-connect, the app never returns from the offline status page.

Just to give you a bit more context, we're using these plugins:

cordova-plugin-crosswalk-webview 1.5.0 "Crosswalk WebView Engine"
cordova-plugin-device 1.1.0 "Device"
cordova-plugin-hostedwebapp 0.2.1 "HostedWebApp"
cordova-plugin-network-information 1.1.0 "Network Information"
cordova-plugin-splashscreen 3.0.0 "Splashscreen"
cordova-plugin-statusbar 2.1.0 "StatusBar"
cordova-plugin-whitelist 1.0.0 "Whitelist"
phonegap-plugin-push 1.4.4 "PushPlugin"

We have our own offline page. We're testing this on 2 separate iphones, an iphone 4 and 6, and see the same issue on both.

iOS version is latest: 9.2.1

The offline mode works fine on android.

Any ideas?

[Windows] App Cert Kit tests not passing for UTF-8 file encoding

Error messages:

<TEST INDEX="49" NAME="UTF-8 file encoding" DESCRIPTION="Packages containing an HTML5 Windows Store app must have correct file encoding." EXECUTIONTIME="00h:00m:02s.29ms">
  <RESULT><![CDATA[FAIL]]></RESULT>
  <MESSAGES>
    <MESSAGE TEXT="File D:\Projects\MyApps\WATDocs\platforms\windows\build\windows\debug\anycpu\AppX\www\js\wrapper.js is not properly UTF-8 encoded. Re-save the file as UTF-8 (including Byte Order Mark)." />
    <MESSAGE TEXT="File D:\Projects\MyApps\WATDocs\platforms\windows\build\windows\debug\anycpu\AppX\www\wrapper.html is not properly UTF-8 encoded. Re-save the file as UTF-8 (including Byte Order Mark)." />
    <MESSAGE TEXT="File D:\Projects\MyApps\WATDocs\platforms\windows\build\windows\debug\anycpu\AppX\www\css\wrapper.css is not properly UTF-8 encoded. Re-save the file as UTF-8 (including Byte Order Mark)." />
  </MESSAGES>
</TEST>

Android (at least) Offline screen not showing when launching the app offline

First of all, great work! I'm new to this mobile world, and Manifold has been providing something that I see as a very needed glue between Cordova and a hosted web app.

So, the problem is:

on Android, when I run the application on my device with Android Studio, if I have no Internet connection, the browser's default offline page will show instead of Cordova's default message or the custom offline.html.

Launching the app online and switching to offline works as expected though

Unable to Inject scripts on remote web page

with Xcode 7 ,Cordova IOS 3.9.2 , IOS 9.2 , its keep giving error (white list rejection) on xcode console even though manifest.json has entry under mjs_extended_scope for that domain ending with "" and in config.xml domain has allow navigation plus access origin to "" .
even though xcode shows error page opens correctly in app. only problem on that page no cordova plugin is accessible.

The default security policy is restrictive for a common case

Steps to reproduce:

$ manifoldjs http://www.microsoft.com -p ios
$ cd WwwMicrosoftCom/cordova/
$ cordova run ios

The end result looks something like below:

screen shot 2015-07-16 at 12 10 47

This happens, because the cross-origin resource access to download CSS files (and other resources) is blocked, which is caused by ManifoldCordova removing the "full access" rules that are created by cordova create by default (see https://github.com/manifoldjs/ManifoldCordova/blob/8e5b457c1e16cfc9c56308c5d1f26e340f48ae62/scripts/updateConfigurationBeforePrepare.js#L139).

The best default security policy would be such that it is as close as possible to the security policy enforced in modern Web browsers and honors related standards like CORS and CSP.

Add extended splash screen for Windows

Currently, on app startup, the sample content of the index.html page generated by cordova is shown a few seconds before the webview is created and the content of the target website is shown, which causes an odd experience.

Instead, a good alternative would be to present an "extended splash screen" to the user until the plugin completes the initialization phase.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.