Say I have a mobile optimized website which runs with a lot of javascript on it to create awesome effects, and a user enters the website via a mobile browser which doesn't have javascript activated.
Is it then possible to (through a button click) redirect that user to his/hers browser settings?
You need to have JavaScript activated in order to browse this site properly.
Click here to change your settings
In principle, you can create an intent: URL that references an ACTION_SETTINGS Intent, though I have not tried this. Off the top of my head, the simplest way to construct that URL is to generate a scrap Android project and call:
Log.d("Something", new Intent(android.provider.Settings.ACTION_SETTINGS).toUri(Intent.URI_INTENT_SCHEME));
then check LogCat for the URL that you would put in the Web site. Of course, this URL will only work on Android devices.
I only know Windows Mobile (and there, only up to v6.1), but I would guess your clients would have to have some app of yours prior installed to access features of the device itself.
If websites could access a device's features, it would be viewed as a virus.
Related
I was trying to make a pc application that helps people more conveniently when they are using a browser(e.g Chrome, Firefox, Edge ...)
For example, the application shows the default browser and let user can choose another browser as default if they want to, and the app shows all windows that are currently opened; Overmore, when the user clicks a specific window then app will focus the window.
user can select default browser
user can see all windows categorized by browser type
So, my initial planning was using Election js; however, I've found that there is no way to control a browser from the Electron application since Node js cannot access the users' system(this thinking could be wrong since I have poor English😥)
After some research, I'm guessing C# can do that by using windows api. I've saw this post that saying by using DDE, we can get tabs urls.
But I'm wondering if C# can fully control a browser; for instance, create a new window, notice if music or video is playing in the tab, request to browser for getting favorites list.
If it cannot, how about requesting api to the browser from pc application?
You cannot fully control a browser. Internet Explorer was the only browser that had a documented and supported API to control, inspect and automate. Internet Explorer is dead so this is a dead end. The basic DDE control interface is also outdated.
Accessing favorites and the content of open tabs is limited because evil people would use such APIs to inject and spy. If you want to access the favorites you will have to write custom code for each browser.
Using the accessibility and UI automation APIs is the only reliable and supported way of interacting with modern browsers. SetWinEventHook can be used to detect window creation and primitive state changes. MSAA/UI Automation needs to be used to get more information from each browser window.
The thumbnail API and/or magnifier API can be used to get the preview image.
To open a new tab, execute a new process with the URL on the command line. Some per-browser customization might be required (-new-tab parameter etc).
Use IApplicationAssociationRegistration::QueryCurrentDefault to detect the default browser.
I'm developing a software on C# which has to get info from a website which the user opens in chrome, the user has to input some data and then the website returns a list of different items.
What I want is a way to be able to access to the source code of the page in order to get the info, I cant open the web myself as it doesnt show anything because I didnt input any data, so I need to get it directly from chrome.
How can I achieve this ? A chrome extension ? Or can I access to chrome directly from my software ?
Off the top of my head, I don't know any application that gets data directly from an open instance of Chrome. You'd have to write your own Chrome extension.
Alternatively, you can open the web browser from your application initially.
You can look into these libraries for doing so:
Watin (My personal favourite)
Selenium
Awesomium (You'd have to roll out your own UI, it's invisible)
Cef
Essential Objects Web Browser
EDIT: I didn't think about using QA tools as the actual browser hook as #TheAnathema mentions. That would probably work for your needs.
You're going to need to create it as Chrome extension if you must be dependent on the user actually going to a specific web site (i.e. not being able to do the requests yourself with either Selenium or standard web requests in Python).
The reason why a Chrome extension would be required is because think of how bad it could be for any software to easily read the pages you browse. Banking, medical, email, etc. could all be accessed anonymously from any process if Google allowed any outside process to tap into the web page.
Even Chrome extensions have to ask for permission to be able to do what they want, but at least it is software the user knowingly installed and agreed to the permissions.
A quick search yielded this example of modifying a page's HTML with a Chrome extension: https://blog.lateral.io/2016/04/create-chrome-extension-modify-websites-html-css/
It sounds like you want to do web scraping. Here's a good tutorial to get you started: HTML Scraping.
And this answer has a good example of how to scrape data from a website where you need to submit a form to get access to the data.
I followed the guide HERE to link my app to an https URI. It works perfectly fine during testing, for both Debug and Release versions: when I click a hyperlink for the website, the app is launched instead of Edge. The OnActivated event is triggered and the app goes to the desired page, all well and good.
Keep in mind, I'm not using the LaunchUriAsync technique that opens the link only if the app is in foreground.
But when I uploaded the app to the store and downloaded it on the same device I was testing on, the app is not launched. Instead, the webpage opens in Edge. Why is this happening? Is it really mandatory to do some server-side changes to make this work? I'm afraid I don't have access to that, as my app is a third party alternative.
Can someone informed on this topic tell me how I can go about this?
Also, the app does show up under the "Apps for websites" section in Settings -> System when installed through the Store.
The document has a mistake before 8/26, The Json file name should be "windows-app-web-link", not "microsoft-app-uri-handlers". If you have referenced the previous document to lead to not work, please update.
If you still have issues after updated, please test the configuration of your app and website by running the App host registration verifier tool (Details please see the 'Test it out: Local validation tool' section of https://msdn.microsoft.com/en-us/windows/uwp/launch-resume/web-to-app-linking)
Because according to the document,
all side loaded apps with AppUriHandlers will have validated links for the host on install. You do not need to have a JSON file uploaded to test the feature. It seems may be something wrong with the JSON file so you can have a test.
I'm developing an app for Windows 8.1 called myTrip and I'm implementing my custom scheme URI for the app. I want this URI : mytrip:place:/m/0942y1 to open my app and navigate to a place with that ID. I have the logic done, it works fine if I run it from Windows + r. I want to distribute this uris in a facebook page, and when a user clicks on it, the app will open and the place shown. It's more or less the same thing that the windows store web page of your app does:
http://apps.microsoft.com/windows/en-us/app/mytrip/ae689d16-f349-4596-8bc7-e0eeab87ec24
This works in IE and Chrome, the schema that opens the store app is this:
ms-windows-store:PDP?PFN=19185FernandoUrkijoCerced.MyTrip_q1p7rzex4ekjr
If you copy and paste it on Chrome, and you have Windows 8, the app store will open. But, if I try with my custom URI:
myTrip:place:/m/0942y1
It only works on IE, not on Chrome. Why the Windows app store schema URI works with Chrome and not with my schema? Any ideas or hacks to bypass this problem?
Thanks you.
Chrome does not automatically recognize custom protocol handlers. Firefox will recognize when you are trying to use a protocol handler and offer to create a protocol handler definition for you. IE recognizes them.
On top of this, Chrome by default excludes protocol handlers it doesn't know.
In order to add your app's handler to Chrome:
With Chrome Closed
Navigate to "C:\Users\%Username%\AppData\Local\Google\Chrome\User Data"
Edit the file "Local State" with Notepad (or Notepad++)
Go down to the section marked "protocol_handler". You can also search for "ms-windows-store"
Add a line in "excluded schemes": "myTrip": false,
Save the file
Start Chrome
You should be able to use your protocol inside Chrome now.
I've just taken a Facebook app live (ie: it's a web app that lives at apps.facebook.com). The app is a simple form that allows you to vote for one of four options. When submitting the form for the vote we also capture the FB ID in order limit the user to 4 votes per day.
When testing this app in sandbox mode as well as live in any browsers, the app functions fine. It even has exception handling in the edge cases where the user is not FB authenticated etc.
The issue we have encountered is that when a user visits the app from within the iOS Facebook app, the link opens within the Facebook in app browser (based on the iOS UIWebView component I believe). When using it from this environment, when the form submits our server is producing a 500 error.
Now I know that the 500 error will be nothing to do with facebook since it is our application code, but my confusion arises from the fact that this only happens from the Facebook in app browser. We are currently going about trying to determine the nature of the 500 error (we do not have access the production environment and custom errors have been switched off).
My question is this: Does the Facebook in app browser behave differently or do things differently than the standard UIWebView or iOS Safari?
I am thinking of differences such as interfering with POST data, clearing FB login credentials etc.
In short yes the Facebook in app browser does behave differently than the standard UIWebView and iOS Safari web browser.
The Safari web browser and the UIWebView do use different user agents.
The Facebook embedded browser doesn't seem to post hidden form values. And I can't seem to find any debugging tools for the embedded browser used in the iOS app.
I might not be 100% true on this one but i think Facebook might still be using this browser for the iOS app. But support for this library has been discontinued and has not been updated in over 2 years.
https://github.com/facebook/three20/wiki/Using-integrated-web-browser-via-TTWebController
So in short the answer to your question is Yes, but finding a solution for this issue is another story.
I haven't found anything yet...
Good Luck!