How to use browser-sync just for ghost mode - javascript

I'm using browserify and amok to hot-reload my project during development. This way I can build my project continuously and get all live changes whenever i edit & save my html, js or css and I serve my project on localhost using the static http server ecstatic
I open my website in an android emulator, on a usb connected mobile device and in several web browsers
What I would like to add is the option to "synchronize" the navigation (clicking, scrolling, etc...) the way browser-sync does, without all the other capabilities that come with it.
Is there a stand-alone project, that just does the "ghost mode" feature of browser-sync?
If not, can browser-sync be used in a way that it does just that?

Related

How do I use universal links with Expo?

We have the server set up and configured to return certain paths under /.well-known/apple-app-site-association. When we publish our app, the "associatedDomains" key in our app.json instructs iOS to give us a chance to open links in app.
That all, more or less, works. What we can't figure out is how to productively test universal links during local development. The expo app won't have our app.json and its a horrendous flow to make an independent build for this purpose (we lose hot reloading and frankly it just doesn't seem to work regardless)
This wouldn't be the end of the world if our product didn't require opening a link in email to log in, but it does and that requirement isn't going anywhere.
Expo does not support Universal links in development. They can only be tested in production and standalone builds. One work around for this is to use something like branch.io to conditionally send the user to a different url depending on the device they are using.

Google sign-in in an Electron.js application not working

I'm making a desktop app version of a website with electron. The desktop app itself works, but the google sign in does not work because "this browser is not secure."
Opening the sign-in page in a secure browser will not work here because i did not make the actual sign-in version itself, I am only making the desktop app version.
I've seen other posts where they say to change the userAgent, but Google has disabled that, so it will not work.
I also have used a solution with nativefier app --userAgent..., but the Windows and Linux versions become messy with a bunch of extra files after building. I would like to get a single .exe file for Windows and a single .AppImage or .deb file or similar for Linux if possible.
If you have any solutions or workarounds for this, please let me know. Thanks!
I managed to log in with Google using this package: getstation/electron-google-oauth2. This package will open a browser window for the log in, then successfully pass it to Electron app. There are examples in the readme demonstrating how to make it work.
Also make sure that you configure a desktop OAuth 2.0 Client ID for the app:

Can I publish a Cordova app for browser

I'm on a project cross-platform where the client wants a website, an iOS application and an android app. I chose cordova to realise it.
But I have one question, can I host my application like a classic website on a distant server ?
Maxime
While you might be able to reuse parts of your HTML, CSS and JavaScript for the website, Cordova apps run on physical devices like phones and tables and interact
(access device capabilities) with the underlining operating system like Android and iOS.
When you have an existing server-based web app, and you want it running in a Cordova app, you'll have to migrate it. Depending on what your application does you could use a thin Cordova client (think of it as a web browser embedded in a native app) that automatically redirects to your web site.
Link to officially supported platforms.
https://cordova.apache.org/docs/en/latest/guide/support/index.html
EDIT: the following is only for testing, not production
Cordova supports the browser platform.
By running cordova platform add browser you add it to your project and with cordova run browser you run your app in a browser. To run it in a specific port, you need to run cordova run browser -- --port=1234.
You can add, build and run the iOS and Android platforms in the same project.
Take a look here https://www.raymondcamden.com/2016/03/22/the-cordova-browser-platform/

How to get the title of the foreground process/window

I am developping a crossplatform desktop application using Electron, nodeJs and angular2.
My application needs to know, at all time, which foreground process/window is running on the computer.
Do you have any idea on how to achieve such a task ?
First of all you need to detect platform which runs Node app:
os.platform() - https://nodejs.org/dist/latest-v5.x/docs/api/os.html#os_os_platform
Then you need to run platform specific command for getting process info with child_process.exec().
https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback
To get metadata on active window you can use sindresorhus/active-win: it is multi platform (win, osx, linux) and very easy to implement

Source visibility in ionic hybrid apps

I've just started learning ionic framework. It uses web browser capabilities for building apps.
These capabilities namely HTML, javascript and CSS are client side stuff. Which on browsers can be seen with view source.
My questions is how will be the visibility of the source? Will the end user be able to see the source of the app?
If yes, is it normal for any app? Shall one be worried about the security of the source?
The visibility of the source in chrome://inspect#device , is pretty much the whole application. And no, end user cannot see the source of your application once you set and push the project to production mode.
Well, since you are developing a hybrid application, there are of course, pros and cons for each. Security might not be as strong as native apps, but development time is greatly reduced to push the app to different platforms.
If you would to do something would requires high security and non-visibility of your source , then native is the way to go. As for hybrid apps,if you need somewhere to store your data securely, you will need plugins to communicate with native platform's secure storage which might pose a security risk. But then again, even native applications can be de-compiled. The way developers tries to make it harder is via obfuscation methods.
Once u set your application to production mode, you will not be able to inspect your application anymore.
To show your web-app on chrome://inspect/#devices :
1) Make sure your web-app is running and your phone is plugged into your computer via usb with USB debugging on and your PC is trusted by the phone.
2) Under device manager, you should not have missing phone drivers. (it would look something like this)
3) ADB should not be running co-currently. And you should be able to see something like this on ur inspect page:
4) Click on inspect button and you're done! (:
You have a signed apk, when you install it on a device and inspect the device on google chrome the inspect option will not be available. Theres an easy way to do that decompile the signed apk using apktools you will get the AndroidManifest.xml file. simply add android:debuggable="true" to the tag and recompile it resign it and you will be able to inspect it. If you check the main.js file in the inspect section the source code is visible.
Hence you can use Jscrambler to prevent this (Its a paid service i too am new to it)

Categories

Resources