how to open tronlink wallet from chrome browser programmatically - google-chrome

I have installed tron link wallet extenstions in google chrome browser. I have a web application. I need to open this tron wallet from browser to do transaction. I do not need to open tronlink extension in pop-up window. It is OK if it is opening in either new tab or in the same tab. This question might be duplicate of How can I open my extension's pop-up with JavaScript? or Activate popup.html from Content Script: Chrome Extension Development. But I am not getting clear answer there. My question is, Is it possible to open tronlink wallet from chrome browser by a click ? If we can, how to do it.

If you have a web application that need do Tron transaction (called DAPP) you can use Tron web API ( in javascript ) :
tronWeb.transactionBuilder.sendTrx(to, amount, from, options);
Full API reference

Related

Google OAuth UWP App - Close Browser Tab

Using this example here works well for me to add Google authentication to my UWP app (more specifically, to my UWP project in a Xamarin Forms app). However, after authenticating and automatically going back to the app via the redirect URL, the browser tab that was opened for the google log-in remains opened (it gets navigated to google.com and doesn't close after switching back to the app). Anyone know how to close it (just that tab, of course) automatically?

Chrome custom tabs cookies, storage APIs and service worker

I tried to lookup many answers from stackoverflow but couldnt find anything specific to this, I am implementing payment app and I want to display custom-tab in my app to record user visit by storing user-id, either by setting a cookie or using localstorage or by installing a service worker for the domain that custom tabs opens.
Can a https page loaded in custom-tab write cookies that are also
available when visiting the same page from Chrome?
Is localstorage API available for my domain in custom-tab? if yes,
is stored value available from Chrome?
Is installing service worker allowed from Custom-tab? So I have
access to S/W from Chrome browser?
If none of this possible, how could I record the visit from custom-tab and have it available in Chrome when user opens the domain from chrome browser?
Thanks in advance
Chrome Custom Tabs uses the same Cookie jar as Chrome. So, if a Cookie is created when a user accesses the page from a Custom Tab and Chrome is the Custom Tabs provider, it is also available when the user goes to the same domain from Chrome (outside Custom Tabs).
Same as above.
Yes, it is possible to install a service-worker from a Chrome Custom Tab.
You can check all the above by opening the URL that adds the cookie, install the service-worker or writes to the local store inside a Custom Tab, setup the device for debugging, connecting it to your computer and navigating to chrome://inspect/#devices in Chrome. Then choose the device and inspect the cookies, local storage, service-workers, etc.

How do I launch a URL in a specific user instance of Chrome?

I'm looking to intercept a web request and launch that URL in another instance of Chrome. We have a Google Apps for Business account. And I regularly receive emails with Google Drive links. But they open in the last browser that had focus, which can be my personal user window. I'm looking to have Chrome get that web request, then either automatically open the link in the right window, or prompt for a choice. Is that possible?

Can you still create a Chrome packaged app in the browser with manifest 2.0?

All of the examples I've seen show apps launching in their own windows. This may be great an all for chromebook/chrome os, but is there still an option to launch in a browser tab?
No, there is no way to do that. Chrome Packaged Apps are not supposed to run inside a browser. You can, however, open URLs in a browser tab using window.open. But you won't have control of that tab after you issue the command.
If you need some sort of integration/control between your Chrome Packaged App and the browser, you can create an extension and make a communication pipe between the extension and the app - as long as both are running, using the chrome.runtime.sendMessage API.
See this sample for a simple code that does exactly that (two apps and one extension exchanging messages directly, without any server component).
chrome.app.window.create will create a new Window for an App.
If you want window manipulation, you should switch to chrome.tabs API and look for an extension instead of an App.
Reference
chrome.tabs
chrome.app.window

How to open links using a chrome app? (Similar to how Android prompts you on what app you want to use to handle certain URLs)

I have a chrome app which displays data pulled from website A.
If a user has the app installed, and is on website A, how can I make the chrome app detect that the user is on website A and then prompt the user to open website A in the chrome app?
I'm trying to mimic how Android does this if you try to open a Google Play Store URL for example.
Thanks in advance,
Dimitry
Your app needs to define a webRequest (part of permissions) in the manifest file. You might use the blocking response to then handle all the stuff yourself.