Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 5 years ago.
Improve this question
I have found many similar questions but nothing identical to what I am asking. I am building an app using Phonegap.
It seems that Apple allow apps that request external JS (people using Google Maps and so on), So basically by using a <script> tag in the header and referencing the external js file. My problem is that I want to do something similar but via code, so using jquery getScript.
The functionality all works, but my only worry is that apple say you cannot download code to your app. Surely having a script tag in the header of the app referencing external javascript is exactly that, downloading javascript to the app.
Its basically, exactly the same in my opinion, no matter how you grab the javascript, it's still technically 'downloading' code.
Anybody know the true answer to this, if not, how do I find out? Even if the app was approved, there is nothing to stop me building 20 apps with this code just to find in future that I was lucky and they take them all down.
there are mixed opinions about it. some developers have been given a hard time for approval of the app when using phone gap. i personally prefer not to use it. here is a link to a discussion that has the opinion of many developers.
http://www.linkedin.com/groups/Anyone-uses-PhoneGap-on-iOS-72283.S.106288557
https://devforums.apple.com/message/513221
as i said there are mixed opinions about it. using phonegap does not prevent your app from being approved, but it is clearly mentioned in the doc's that apps that download codes will be rejected. according to apple there is no issue with having javascript codes inside the app but you cannot execute a set of code to download the script into the app from outside. it has to be inside your app. i hope this makes sense to you. but all in all if you are building an app that downloads codes it will be rejected, if you are building an app that has the script inside it and downloads the dialogue ( like Facebook) related to it, no problem.
apple doesn't allow you to load code later on.
Exceptions are part of every rule but the general opionen about this is clear and I wouldn't rely on that
The spirit of this 'guideline' is to ensure the functionality of the app doesn't change in any significant way after Apple's approval. Apple is even locking down ability to change screenshot after approval. This more for security, still the goal is the same. To consistently present the functionality of your app.
Inferring from the title of your question , are you are using <script> or getScript to ensure latest version to the device, as opposed to packaging the app and updating the app?
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I'm in the sort of rapid prototyping phase of my React/javascript learning experience. I was wondering when folks would reach for a framework such as Next.js or Gatsby.js vs the standard Create React App.
I really dig the page based structuring and prospect for preloading links of Next.js. However, I'm not sure when you would reach for Next as apposed to CRA or even ejected CRA.
Thanks!
I am in the same boat. I started with CRA to create a SPA which was great to start with and get over the learning curve. But I soon realized two important issues :
Sharing on social networks : I was unable to change the OGP tags per route. The effect of that is, only your base route (setup correctly with OGP tags) when shared on a social network can produce the card (twitter term), any other route you share will basically show as blank. This is true for Facebook and LinkedIn as well. See here.
Search Engine Optimization : Though there have been few articles about search engines able to crawl your SPA correctly for indexing, in my experience it hasn't been satisfactory. For e.g. in Google I noticed that only the home page is indexed and it's not parsed correctly. Separate titles from separate elements are concatenated together. Bing, doesn't seem to have indexed it. May be Google indexed it because I have indexed the home page using Google's Search Console. It's not a feasible solution if I have to re-index manually for every new page or after an update to a page.
Create-React-App : A really good bootstrapper tool to get started with to create a SPA.
Gatsby/React-Static : Similar to Create-React-App but produces HTML build output instead thus "pre-rendering". I am yet to experiment with this. I am hopeful that this would resolve (1) and (2) since I can now have different OGP tags already in the HTML being served from a static site server (S3/Azure Blobs/Github Pages) instead of them being changed locally after the fetch. I am not sure if this will work yet. The added advantage here is, since Gatsby already pre-renders during build time, the user experiences better performance. (May be someone experienced with Gatsby can clarify, or I will edit this answer after I am done.) Update (2/19/2018) : I can confirm that (1) is solved by Gatsby.js while still hosted as a static website.
Next.js : If Gatsby doesn't solve (1) and (2), Next.js will be my fall back to create a full blown SSR app. The issue here is, now I am going to have to use PaaS to host the site (e.g. Azure Web Apps or AWS ElasticBeanStalk or Heroku) instead of a static site hosting service (Azure Blob, AWS S3, Github Pages). This will be slightly costlier and bit more work to setup CI/CD pipelines.
Also see these alternatives listed on CRA's docs.
I recently did a lot of research myself about this topic especially create-react-app vs Gatsby.js and I found out that Both tools let you write react code right away without worrying too much about the setup. However, Gatsby, for example, offers on top of that, server-side rendering at build time which is crucial for SEO. You don't need any server to render your views which is the case for Next.js because they are already done at build time. when a user visits your website the HTML version will be loaded first and once the javascript is loaded your website will become a fully functional react web app.
The good thing is they all share the same view layer so you can move from one tool to another. you can check moving from create-react-app to Gatsby.js which goes into details.
I'm doing this research myself. My understanding is that Next.js provides Server-Side Rendering out of the box. Create React App does not do this so you need to provide your own solution for SSR (for things like faster page loads and SEO).
create-react-app is best for both building website and mobile apps(react native apps) because lots of learning curves available. other two are the react frameworks(we can say).
use Gatsby for single page website faster and easy to deploy.
use Next.js while working with REST APIs (i guess...)
it's up to you. a good developer always find his/her way for easy and fast work.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am building a web application for a company so they can test the app on a control group of people to see if they would like to try funding the app. Funding beforehand is not an option, however I would like to keep the code somewhat private, so that someone from an IT team can't just easily download all the app files and claim it as theirs. I have researched a little but also found little on what can be done to protect the files for the app which are written in javascript, html, css, ect. basic web development languages. i was just curious if anyone knew of a way to somehow protect these files if it is even possible. I'm not against sharing my code, however for a business opportunity I prefer that it remain private for the time being.
This question has been answered before: How can I obfuscate (protect) JavaScript?
But anyway, here's my take on the question:
You don't need to protect your HTML/CSS code, unless that aspect of the app is what is so proprietary. If that is so, obfuscate your code (there are many websites online that will do this for you).
From the information you gave me, I can infer that it's not the styling or the UI you want to protect, it's the application's logic. In that case, you can obfuscate and then minify the JS code such that it's very hard to deconstruct (although some web browsers do pretty-print the code). To see an example of this, go to Google, open the dev tools, and look at any JS file under the Sources.
I also saw another interpretation to your question. If you meant "to protect the application from being downloaded and then reuploaded", that sadly isn't possible with web apps (unless you explicitly check the domain that the app is running on and restrict the app from running on domains other than yours).
An implementation of the domain-protection would look something like this:
if (window.location.hostname !== "yourwebsite.com") {
alert("Invalid domain, redirecting to official app...");
document.location = "http://www.yourwebsite.com/app/";
}
After adding this protection, you can stop it from being removed by minifying and obfuscating the JS code.
For the css and Js a lot of people use minification. This makes your code really hard to read and finding the business logic in your code. As for the HTML you could uglify it. There is no real way to hide HTML,CSS, JS in your browser because the browser dev tools would reveal all of the code. There are only ways to make it unreadable.
JS minification tool : https://javascript-minifier.com/
Css minification tool : https://cssminifier.com/
https://developers.google.com/speed/docs/insights/MinifyResources
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm a newbie developing a small web application that uses HTML, JavaScript (Angular 1.5.0) & CSS. I am using Grunt to process, jslint, minify my javascript and CSS files. This front-end communicates via HTTP Rest calls to a Django application that is also running locally (which has its own database)
This webapp currently lives only on my laptop (MacBook Pro) and I use the PyCharm IDE to edit the files. When I want to test out the app, I simply go to http://localhost:63342/myapp/index.html#. PyCharm's built-in webserver serves it up for me and I can play with it there.
However, I want to allow a select few people to also access the webapp from other locations on the internet. When they try to access http://MyPublicIpAddress:63342/myapp/index.html, they get connection denied.
What is the quickest/easiest/simplest way I can share my webapp with those other people? I do not know much about setting up and configuring Webservers, so if you can give me the simple/easy instructions (or point me to a doc!) that would be most appreciated.
I posted this question to the PyCharm community forum here, but got no response.
Edit
Many answers say I need hosting service. Yes, If I want to deploy my website to a fixed IP address. But is there no way to simply allow them to briefly visit my webapp while temporarily running a toy web-server on my laptop? This is not a long-term solution I understand. But just to give them a peek. If possible I would like to avoid the effort and learning-curve involved in pushing it to a hosting service. I would have to setup the back-end API, database, etc (which are all currently running locally)
There's many services that allow you to host your project online.
For small projects
CodePen: http://codepen.io/
Plunker: http://plnkr.co/
kodeWeave: http://kodeweave.sourceforge.net/
For large projects
Cloud9IDE: https://c9.io/
Koding: http://koding.com/
Github: https://pages.github.com/
Sourceforge: https://sourceforge.net/
Heroku: https://www.heroku.com/
BTW: kodeWeave is my project. It uses Github Gists to save and retrieve your weaves online, thus is not actually saved on the site plus it's a very reliable host when it comes to small projects like it is. (Inspiration from Dabblet.)
It's being made kind of as a JSFiddle alternative for mobile devices, except without all the http requests.
It has many libraries built in (Such as JQuery, Angular, Font Awesome, etc:) in addition when you export as a zip file you will get all those libraries (Hence the except without all the http requests comment). You can also export your weave as a Windows, Linux, Mac, Chrome Application, and/or as a Chrome popup extension.
You can watch this video I made that explains how to use kodeWeave for desktop exportation.
I've listed services I use and recommend. I will not list something I haven't tried without warning.
If you have a spare laptop you can use that as a web server. I've never done it myself because it's not worth the this for me. However something you may want to look into
Lastly you can read Creating a Local Server Configuration with PyCharm which maybe the option you're looking for.
Use localtunnel to expose your localhost- https://github.com/localtunnel/localtunnel
You need hosting, or try codepen.io for small project.
Change the configuration in PyCharm to host at 0.0.0.0. You will also need to port forward your router... I would strongly suggest not using this as any sort of long, medium or short term solution.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have made a website wich uses HTML, PHP, Javascript and Ajax and is working based on MySQL database. My question is if there is a way to make this whole website run as a program with no need to open browser. Like outlook or filezilla where both are programs involving servers and web but they need no browser.
I dont expect you to give me a step by step guide but only to tell me if this is possible.
You can use a headless browser, like Zombie.js that will allow you to browse your app programatically without employing a graphical browser. It supports AJAX call and everything.
This is usually done for testing whether the web app works as expected.
Anyway, if you want your app to be used without a browser, best you can do is transforming it into a console app.
If you want the app to be used from both the web and console, or other environment, you can make it work RESTful, and develop 2 interface layers: web, console or whatever you need, all of them consuming the same services so the functionality will be the same.
Sure,
you can develop a java application which uses for example JavaFX on the presentationlayer and there you'll have a class called WebView within you can display your HTML pages.
But you need to run your PHP Application on a WebServer which renders the page on runtime / calltime and serves the data. On this server you also run your MySQL Server.
You could try HTA (HTML Applications). Note that its a product of Microsoft and I have tried this only in Windows.
It acts as an stand-alone application and you can do that just by changing the extension from .html to .hta for your main file.
From Wiki:
An HTML Application (HTA) is a Microsoft Windows program whose source
code consists of HTML, Dynamic HTML, and one or more scripting
languages supported by Internet Explorer, such as VBScript or JScript.
The HTML is used to generate the user interface, and the scripting
language is used for the program logic. An HTA executes without the
constraints of the internet browser security model; in fact, it
executes as a "fully trusted" application.
The usual file extension of an HTA is .hta.
More Links:
http://en.wikipedia.org/wiki/HTML_Application
http://www.htmlgoodies.com/beyond/reference/article.php/3472841
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 6 years ago.
Improve this question
From the best I know, if you use AJAX or javascript links in your website, it hurts SEO as the google bot has troubles crawling your site, basically it likes anchor tags.
So it's a general saying to avoid AJAX or Flash in your website, though some saying that the google bot knows to read javascript links.
Now i believe it's possible to manipulate the google bot somehow, and when meaning manipulate i DON'T mean anything illegal or black hatting, I just want to Ajaxise my website.
My question is divided to 2:
Is it possible to "present" google bot with 1 version of the site, and users with another? I've read Here that base64 encoding your content may confuse the bot, but that seems like a bad solution to me.
Likewise, the possibilities you can add to robot.txt file is only no index and no follow, as far as i know.
Is it possible to output the HTML as regular unajaxised website with Anchor links and after window finishes loading, then edit the anchor tags to preform dynamic content loading? i mean i know that it is possible, but will the google bot scan the after that event or before? on the same weight is it possible to block that parts of Javascript code from the google bot?
You can't manipulate search engine bots to do things they don't normally do. You either work within their capabilities or not. Although search engines are getting better at handling JavaScript as a general rule dynamic content is not something they're going to be able to handle well or at all in most circumstances.
As far as getting search engines to read dynamic content created by JavaScript you have two options:
Build the site the right way from the beginning and use progressive enhancement. Your site should work without JavaScript enabled. In fact, it should be built that way first. Then you can go back and add JavaScript that enhances the experience for users who have JavaScript enabled. That way your content is accessible to everybody.
Use Google's Crawlable Ajax standard. This will allow Google to crawl content generated via Ajax. Keep in mind this only work for Google and leaves out other search engines and users without JavaScript enabled. So it is a bad idea.
Build your site using Progressive Enhancement and Unobtrusive JavaScript.
When you do significant Ajax stuff, use the history API.
Then you have real URLs for everything and Google won't be a problem.