/    Sign up×
Community /Pin to ProfileBookmark

Execute JS in URL

I don’t know how to excecute this JavaScript in URL…
setTimeout(‘window.open(‘history.back(1);’)’,2000);

And I need to execute it using res: url…
I tryed this for example, but obviously, I didn’t write something right..

res://shdoclc.dll/HTTP_404.htm#javascript:setTimeout(‘window.open(‘history.back(1);’)’,2000);’,”,”)

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@crh3675Feb 12.2004 — <i>
</i><a href="javascript:setTimeout">javascript:setTimeout</a>('window.open(\''+document.referer+'\')',2000);
Copy linkTweet thisAlerts:
@ExtremeauthorFeb 12.2004 — It doesn't work when I putt it like this... It doesn't return to previous page...

res://shdoclc.dll/HTTP_404.htm#java script:setTimeout('window.open(''+document.referer+'')',2000);

Actually, window.open is unneccessary.. all I need is history.back(1) function executed..
Copy linkTweet thisAlerts:
@SamFeb 12.2004 — that code should work, try history.back(2). Think it counts the missed page as 1, so back(1) would just take you to the inexistant page again...
Copy linkTweet thisAlerts:
@crh3675Feb 12.2004 — I receive this in Mozilla:

<i>
</i>Error: uncaught exception: Permission denied to get property Window.setTimeout
Copy linkTweet thisAlerts:
@oleragFeb 12.2004 — Here's another way to do the same thing however the opening

of a new window has no history so there's nothing to move

back to, is there??
[code=php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<title>Sample</title>
<script type="text/javascript">
<!--
function execute() {
setTimeout("window.open('history.go(-1)','','')",2000);
}
// -->
</script>

<div style="text-align: center;">
<strong>Sample</strong>
</div>

<p style="text-align: center;">
<a href="http://www.google.com" onClick="execute()" target="_new">Google</a>
</p>
[/code]


OK - just history of the same page. Then edit the function

to only do this...
[code=php]
function execute() {
setTimeout("history.go(-1)",2000);
}
[/code]
Copy linkTweet thisAlerts:
@ExtremeauthorFeb 13.2004 — Yes, but the point is that javascript must be executed in URL... so I cannot make page and write script in it.

Because it already opens existing page and that is... res://shdoclc.dll/HTTP_404.htm

Check it.. If you are using Internet Explorer, this page will be there... Now, if you check that 404 page, you will see that there is already BACK link in the bottom of page.. Maybe URL can direct to that link???

Anyway, only thing I managed to achieve is to get script injected into res: page but you still have to click CLICKME in the page..

One more important thing.. MS has disabled " and some other characters so you have to use like this:

ORIGINAL

res://shdoclc.dll/http_404.htm#javascript:alert(location.href);//://clickme/

MODIFIED TO WORK

res://shdoclc.dll/http_404.htm#javascript:alert(String.fromCharCode(72,101,108,108,111));//://clickme/

...The only thing left is to maybe point to already existing history.back() function that already exist inside html_404.htm , but how to do that???
×

Success!

Help @Extreme spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.8,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...