Prevent saving page as with nextjs - javascript

I am developing a project with NextJs. The project is an editor application. That's why I want the page(editor) not to work when they save the page differently. For example Youtube, Instagram etc. applications do not work when the page is saved as. How do they do this? And what approach should I take ?
The editor should not work when the page is saved as different. So I can use this project commercially.

Youtube and Instagram work fine after saving, you just need a server to serve the files
Nothing you can do to prevent this

Related

How to show an android app which uses webview is up to date

I'm trying to develop an offline android app using simple html, css and javascript. I use website2apk software to convert the local html files to a standalone apk file.
My app contains a tariff of some random products. What i need is to notify (in-app notification) my app user if there is any update to the app.
For example, when user get connected to internet the app should automatically check for updates and if there is any update available, a warning should appear on top of the home page which says "New Update Available" which will be linked to mysite.com/newversion.apk .
Can someone suggest me what to do for this?. I can only depend Webview and pure javascript, which means no jquery.
I'm sorry for my bad English. Thanks in advance.
The site which hosts your apk should have an api so you can check from your app if there is any newer version available.
A possible solution would be to add a file (for example a json file) which contains the actual version of your app. Then you can make a web request in your app to get the file data.
Example:
get 'http://www.yourwebsite.com/appversion.json'

Launch app from webview, if it is not installed, redirect to play store

I have an application which makes some references to some other application using a webview. The behavior that I need is:
-If I have this application installed, it should launch it
-If I don't have this application installed, it should launch the Play Store in the application page.
The application list must be updatable using the html, I mean, the html page will have the applications name and packages, and can not be necessary any app update each time some application changes.
I can use JavaScript in this page, or use any android resource, since it follows the requirements(and does not interferes in the user experience).
Is there a way of doing that?
You should take a look at AppLinks by Facebook, it's a great library that does what you need, or the open source AppLinks.

How can I code my web page to download a file from a site visitor's computer?

I am creating a html5 and javascript web page that allows you to draw your own picture. The page itself works, but I want to make it so my web application will create a folder in their Appdata (or Application Data if they're on a mac) directory.
Then I also want to make it so when a user logs back on to the website, all of their work is saved and they can pick up where they left off.
So basically, I want to be able to create a file on a client's directory, then be able to download that file once they have saved a change to their drawing. Is there a way I can do this? Thanks.
All of these things can be done by using the HTML5 file APIs.
Here are some links which will help you with your task:
http://www.html5rocks.com/en/tutorials/file/dndfiles/
http://www.html5rocks.com/en/features/file_access
Storing state can be accomplished by using one of the following technologies:
Cookies
localStorage
indexeddb
WebSQL

HTML5 Mobile Web App

I've just created the required HTML5 Mobile web pages(including the CSS3 and javascript pages). I've got the apk file from build.phonegap.com as well.
But I want it to be dynamic i.e I should be able to add content from my laptop.
I've searched a lot but I'm unable to get the right info on doing this.
I just want to be adding simple text paragraphs from my local server(laptop) to the app on the go. What do I do ?
Sound like you need to set up some type of json / sql web service.
Use your machine's ip to do this.
Suppose your laptop ip is 192.168.1.1
Then from your application just use
http://192.168.1.1/your_appliction/webpage
replace http://localhost/ to http://10.0.2.2/
EDIT:
Treat your laptop as remote server and access the files in it as you normally do in website building.
From another post I think might help...
1- if you are building the whole site from scratch: You can create your site by any CMS like dotNetNuke or joomla which will allow you to login and edit what you want
2- if you are building just this page from scratch : You can build your page with online-editing in mind, in this case I recommend to build two pages one for for viewing content and the other for online-editing you can use any HTML-Editor control like FCKEditor
3- if you are dealing with already built page : it will be easier to build administration page which you can upload the new version of the content page to it, and the administration page take care of replacing the content page
Or maybe even the knockout js plugin could be something to look into http://jsfiddle.net/rniemeyer/LkqTU/

Download HTML to iOS persistent storage and load/navigate to it

I've just started using Phonegap with iOS and I'm wondering if there's a way to update the look of the application remotely (forgetting about App Store updates in this case).
I know that I can store data in a local database on the device and in files, but I'd like to navigate to that downloaded file. My app would start and check for updated HTML and JS files on my server. If there were none, it would continue to use the HTML already saved on the device. I don't want to navigate straight to a page on my server as Apple native APIs wouldn't work and I want the app to work offline too. I found this existing Stackoverflow question asking for something similar and persistent storage was mentioned by a commenter. I want to find out if it's possible to navigate to something in persistent storage.
Is it possible to download a HTML with Phonegap/Apache Cordova and then navigate to it?
The answer is YES.
You'll need a FileTransfer,
then store the file to the filesystem
You have to store the absolute path in the local-storage and navigate to it
I'am pretty sure, that this app will be removed from the apple-app store, because loading code from a server is prohibited.
Apple will remove this app from the store.

Categories