Jump to content
Sign in to follow this  
K4iTO

_IENavigate open in new window

Recommended Posts

K4iTO

Hello

I have using a very simple code from autoit1-2-3 demos ; Mini Pandora Radio

I have modified a link in it.

Now i whant to open links what are runing in side window in new IE window.

; Mini Pandora Radio
; Created By: Frostfel

#include <GUIConstants.au3>
#include <IE.au3>

$PanTask2 = _IECreateEmbedded()
GUICreate("Reklama - otwierają się w przeglądarce", 336, 280, 100, 100)
$PanGUI = GUICtrlCreateObj($PanTask2, -840, -203, 1390, 1024)
GUISetState()
_IENavigate ($PanTask2, "http://rozrywka.nazwa.pl/wektor/wordpress/", 0)

While 1
    $GUI = GUIGetMsg()
    Select
    Case $GUI = $GUI_EVENT_CLOSE
        
            Exit
    EndSelect
WEnd

I'll try to be clearly on it.

I don't whant to open http://rozrywka.nazwa.pl/wektor/wordpress/ address but I whant to open links under this link in new browser!

Edited by K4iTO

Share this post


Link to post
Share on other sites
Steveiwonder

The only way i can think of doing it would be by altering the HTML code on the webpage a link that looks like this...

<a href="www.google.com"> Google </a>

to

<a href="www.google.com" target="_blank"> Google </a>

You can use HTMLRead and then some StringReplace to alter the code and then iedocwritehtml to rewrite the links inside the page, but it isn't that simple a task for what i can see is someone who's just learning autoit.

If this is your site and it will be only use via a program your creating with AutoIt then... the easier option would be to change the code on your webpage adding target="_blank" to each link element.

There may ofcourse be an alternative way to mine and much simpler, but i wouldn't know.

Steveiwonder

Edited by Steveiwonder

They call me MrRegExpMan

Share this post


Link to post
Share on other sites
K4iTO

It's no way to make it happend from Auto it bette mod rewrite... :/

I'll try... But maybe somone has any idea how to make link's to change.. :mellow:

Share this post


Link to post
Share on other sites
K4iTO

I don't work even when i;m using a script

<script type="text/javascript"><!--//--><![CDATA[//><!--
function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=anchors.length-1; i>=0; i--) {
var anchor = anchors[i];
if (anchor.href && anchor.href.substr(0,7) == "http://")
anchor.target = "_blank";
}
}
window.onload = externalLinks; 
//--><!]]></script>

It works for all links but not for google :/

HELP!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.