How to Open a URL from Background Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2017 03:37 AM
Hi Everyone,
Can I open a URL from background script or script include. For example I want to open www.google.com in a new tab from background script. Is it
possible ?. I know its possible from Client script but I have a certain requirement in which I have to open the URL from backgdoun script
( script include). Thanks in advance everyone.
Thanks with regards,
Rahul Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2017 11:18 AM
Rahul Sharma wrote:
Hi Everyone,
Can I open a URL from background script or script include. For example I want to open www.google.com in a new tab from background script. Is it
possible ?
Yes, it is. The question is... what do you want to do with it once "opened"...? You're basically connecting to a web page but unable to display the content (it's running in the background).
Are you after parsing the content then doing something with it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2017 03:11 AM
Thanks Dave for the reply.
Actually I wanted to download an attachment. Is there a way to hit a URL from the background script.
Thanks with regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2017 06:17 AM
Actually I wanted to download an attachment. Is there a way to hit a URL from the background script.
Yes - there will be various ways to obtain content held remotely.
However, are you going to parse this attachment in any way? It sounds like Import Sets may be the thing you're after - but you've not really described your problem, just help with your considered solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2017 11:41 AM
You can open URL via script include.
Please see example below.
var url = 'https://www.google.com/';
gs.setRedirect(url);
Regards,
Sachin