user3612765
user3612765

Reputation: 1

How to get the current page URL using GWT in a Chrome extension?

I'm developing a Chrome extension using GWT. I have to get the URL of the page when I open the extension. I have to do this because I need to read the page's contents to take some data.

Any ideas?

Thanks.

Upvotes: 0

Views: 621

Answers (1)

Braj
Braj

Reputation: 46841

Try with GWT.getModuleBaseURL() and GWT.getModuleName() and GWT.getHostPageBaseURL().

Look at other methods available in GWT class for this purpose.


Output in DEV mode:

GWT.getModuleBaseURL(); 
GWT.getHostPageBaseURL();
GWT.getModuleName(); 

output:

http://127.0.0.1:8899/gwtproject/
http://127.0.0.1:8899/
gwtproject

Upvotes: 1

Related Questions