Invoking Browser via application Icon Like Youtube Application Without Showing My Application - browser

i want to invoke browser with a specific url like youtube application. I've try using Navigator Invoke but, its show my application. i dont want to show my application just show browser when user click the application icon, can anybody help me please ..

Put this into your main() in main.cpp
QDesktopServices::openUrl(QUrl("http://example.com",QUrl::TolerantMode));
But you MUST remove (comment) the following lines:
new ApplicationUI(&app);
return Application::exec();
Otherwise application will open anyway

Related

how Can I I embed instagram code in flutter web project?

I am searching for a way in which I can include the embed code from Instagram to fetch public post and display it on my screen...I tried many packages from pub.dev like flutter_html_view and in this package, you have to run the project without null safety so I skipped it.
I tried this method too ui.platformViewRegistry.registerViewFactory () but there is no response and nothing to display to the browser.
so how can I implement this embed code and show it on the screen of my browser? please help!
This is what is shown whenever I tried to fetch the embed code
This is the embed code that I meant which I want to implement

How to fill login prompt with Webdriver IO?

I'm working on a CLI with OCLIF. In one of the commands, I need to simulate a couple of clicks on a web page (using the WebdriverIO framework for that). Before you're able to reach the desired page, there is a redirect to a page with a login prompt. When I use WebdriverIO methods related to alerts such as browser.getAlertText(), browser.sendAlertText() or browser.acceptAlert, I always get the error no such alert.
As an alternative, I tried to get the URL when I am on the page that shows the login prompt. With the URL, I wanted to do something like browser.url(https://<username>:<password>#<url>) to circumvent the prompt. However, browser.url() returns chrome-error://chromewebdata/ as URL when I'm on that page. I guess because the focus is on the prompt and that doesn't have an URL. I also don't know the URL before I land on that page. When being redirected, a query string parameter containing a token is added to the URL that I need.
A screenshot of the prompt:
Is it possible to handle this scenario with WebdriverIO? And if so, how?
You are on the right track, probably there are some fine-tunings that you need to address to get it working.
First off, regarding the chrome-error://chromewebdata errors, quoting Chrome DOCs:
If you see errors with a location like chrome-error://chromewebdata/
in the error stack, these errors are not from the extension or from
your app - they are usually a sign that Chrome was not able to load
your app.
When you see these errors, first check whether Chrome was able to load
your app. Does Chrome say "This site can't be reached" or something
similar? You must start your own server to run your app. Double-check
that your server is running, and that the url and port are configured
correctly.
A lot of words that sum up to: Chrome couldn't load the URL you used inside the browser.url() command.
I tried myself on The Internet - Basic Auth page. It worked like a charm.
URL without basic auth credentials:
URL WITH basic auth credentials:
Code used:
it('Bypass HTTP basic auth', () => {
browser.url('https://admin:admin#the-internet.herokuapp.com/basic_auth');
browser.waitForReadyState('complete');
const banner = $('div.example p').getText().trim();
expect(banner).to.equal('Congratulations! You must have the proper credentials.');
});
What I'd do is manually go through each step, trying to emulate the same flow in the script you're using. From history I can tell you, I dealt with some HTTP web-apps that required a refresh after issuing the basic auth browser.url() call.
Another way to tackle this is to make use of some custom browser profiles (Firefox | Chrome) . I know I wrote a tutorial on it somewhere on SO, but I'm too lazy to find it. I reference a similar post here.
Short story, manually complete the basic auth flow (logging in with credentials) in an incognito window (as to isolate the configurations). Open chrome://version/ in another tab of that session and store the contents of the Profile Path. That folder in going to keep all your sessions & preserve cookies and other browser data.
Lastly, in your currentCapabilities, update the browser-specific options to start the sessions with a custom profile, via the '--user-data-dir=/path/to/your/custom/profile. It should look something like this:
'goog:chromeOptions': {
args: [
'--user-data-dir=/Users/iamdanchiv/Desktop/scoped_dir18256_17319',
],
}
Good luck!

Flutter Web - How to reload currently Active Page

I am using Flutter for developing a website. Everything is working fine with Flutter except when it comes to reloading the page. When I press the refresh button in the browser, the whole web app gets reloaded.
For example, if I have navigated to four pages from the initial page, when I press the refresh button from the fourth page, the initial page gets loaded and I'll have to manually browse all the way to the fourth page again.
Is there any way to load the currently active page in Flutter?
Or you can just use this as it refreshes the whole window natively
import 'dart:html' as html;
html.window.location.reload();
Check out navigation with named routes as it maps URLs seamlessly when using Flutter Web.
EDIT : If you want URL parameters (like an id, a token...), check out this article.
Use Navigator to push to the same page. .ie.
If CurrentPage() is your page that needs to be refreshed then use:
Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) => CurrentPage()));
This will reload the page.
import 'dart:html' as html;
html.window.location.reload();
as this is not allowed according to
https://dart-lang.github.io/linter/lints/avoid_web_libraries_in_flutter.html
this is how i have resolved my issue:
import this package
https://pub.dev/packages/universal_html/install
import whereever you want to use
import 'package:universal_html/html.dart' as html;
and you can use it like this
html.window.location.reload();

Corona net::ERR_CACHE_MISS comes when loading an external url in Corona

I am using Corona to make an app. I have implemented following code to open a website/a page inside my app view instead of browser:
function openLink(event)
if(event.phase == "ended")then
print("btn clicked")
local webView = native.newWebView( display.contentCenterX, display.contentCenterY, 320, 480 )
webView:request( "http://www.coronalabs.com/" )
local text1 = display.newText("",100,100,native.systemFontBold,20)
text1.text = "native should come"
end
end
btn:addEventListener("touch", openLink)
Its giving me following error on device when button is tapped:
net::ERR_CACHE_MISS
Please help me out with this. Also, I have few questions regarding feasibility of this function.
Can I access full interactivity of website inside app view? i.e. scroll through pages, open other pages, navigate to other elements of website etc.
If I can't access complete website with ease, is there any possibility that I can open multiple pages one after another of same website on click of various buttons created by me inside app?
Any help is greatly appreciated.
The ERR_CACHE_MISS error comes from Chrome. To avoid it, check the following:
Make sure you can get to the URL from a browser on the mobile
device to ensure the issue isn't with your Internet connection.
Make sure that your build.settings file in your Corona app allows for Internet
permissions. For Android, this means including the following in build.settings:
-- Android permissions
androidPermissions = {
"android.permission.INTERNET",
},

Windows phone app link

So - I want to make a windows phone app that links to my webpage when I open it - how do i do that? I have the SDK, and tried with the browser, but I can't seem to find anyway to set a homepage?
You could use the WebBrowser control, placing it on an otherwise empty page. This may allow you to fine tune the experience if wish.
But what would be even easier is to just use the WebBrowserTask. This would launch you right back out of your app and into OS's true browser experience. In the App.xaml.cs file, just add the following code:
private void PhoneApplicationService_Launching(object sender, LaunchingEventArgs e)
{
WebBrowserTask webBrowserTask = new WebBrowserTask();
webBrowserTask.Uri = new Uri("http://my.superawesomewebsite.com", UriKind.Absolute);
webBrowserTask.Show();
}
You app will immediately launch the browser an you don't have to do anything else.

Resources