Jump to content

_IENavigate open in new window


 Share

Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...