If I open them by Shift+Mouseklich links usually will be opened in new
tabs. Here I only get a new tab with some javascript garbage in the link.
I think it can't be too difficult to desplay the arriving site in the
new window in this case.
For example:
https://webshop.orange.at/Default.aspx?navkey=___TopNewCustomerShop___BestOffers&nav=0
(the menu on the left side is with javascript).
Summary: Yes, it is difficult. Not all JavaScript links will simply load a
new page, and those that do won't all do so in the same way.
Thankfully most sites I see now (and these things can unfortunately vary
greatly from country to country) that use JavaScript in this fashion do so
in a way where middle-clicking (and shift-clicking) either still works, or
at least where no empty page is opened.
--
Do the obvious to get the email.
Thanks for explanation.
But I think if you try to catch the standard-javascript links like
javascript:popUp('http://soil.tugraz.at/ibg/stuff/organigram.jsp')
then you might have 90% of the JS-links.
Um, what does that function do? It is not standard JavaScript, save that the call is standard.
The user-written function "popUp" could do ANYTHING. For example, it could simply return false.
How is a browser supposed to deal with that?
> Um, what does that function do? It is not standard JavaScript, save that
> the call is standard.
> The user-written function "popUp" could do ANYTHING. For example, it
> could simply return false.
>
> How is a browser supposed to deal with that?
On that note however, thanks for reminding me I wrote this a long time
ago: http://bteo.jellystyle.com/kill-macromedia-popups.js
It deals with a specific case, the functions Dreamweaver generates when
you tell it you want something that pops up a new window. I seem to recall
them being common but since I've been transparently removing them for
several years now I have no idea if they still there and I'm not seeing
them, or if times have moved on.
You could also use the script (if you have, or are willing to learn a
little JavaScript) as a template for examples on other sites you use often.
Interesting script. If you wanted to have the least impact on the UI, you might want to check
if the HREF already has a value before assigning it the contents of the onClick, though.
Especially since the onClick may contain multiple statements.
Off Topic: do you happen to know how to have an Opera script call (or at least retrieve a
handle to) an anonymous function? I am exploring some of the scripts used in Facebook apps, and
I want to be able to automate clearing their popup screens. I believe everything is attached to
the document somehow, but I can't quite figure it out.
Actually, it might not be so difficult, just need to go about it a
different way. We don't need to guess the javascript name for the pop up
function, we just need to see check if we are opening a valid link. If we
open (or are about to open) a blank window (read: a window with a URL
starting with "javascript:"), then don't try opening in a new window, just
click the link as usual.
You misunderstood the request. Rudolf wants to open the javascript results in a new tab/window,
not simply prevent popups.
In other words, if it's a valid URL, Shift+click will open it now just as he wants. And if it's
a JavaScript function, he ALSO wants Shift+click to open it in a new tab.
Many times this causes a blank page to load, because a lot of JavaScript functions are not
intended to replace the current document. But sometimes it works as he expects.
Having Opera pre-parse the function might work in many cases, but not when the function calls
an AJAX method which later comes back and opens a new URL.
There are many ways to use functions, and so it is very difficult for Opera to handle them all
the way he wants.
Ok, using the original URL provided, left-clicking on a link on the page's
navigation bar results in a blank page with
javascript:__doPostBack('ctl00$mainNavigation$repLevel1$ctl03$repLevel2$ctl01$navLink','')
in the address bar. So if we detect that a new window with "javascript" in
the address bar would be created, we instead duplicate the page and run
that javascript. I think that would work.
Do you know JavaScript? That could conceivably work in some cases, but certainly not all. Also,
in many cases, opening a new window has no meaning or is a bad idea (e.g., when filling out an
order form where money is going to be spent, you don't want to risk it happening twice).
Opera could certainly scan for anything that tries to change the URL, but everything else is a
hit or miss proposition. They would have to look for the JavaScript programmer's intent, and
that's inherently hard to write a program for successfully.
> On Tue, 15 Dec 2009 21:07:23 -0500, lies lies lies wrote:
>
>> On Tue, 15 Dec 2009 19:55:45 -0500, Naruki Bigglesworth
>> <Nar...@nothankyou.com> wrote:
>>
>> Ok, using the original URL provided, left-clicking on a link on the
>> page's
>> navigation bar results in a blank page with
>> javascript:__doPostBack('ctl00$mainNavigation$repLevel1$ctl03$repLevel2$ctl01$navLink','')
>> in the address bar. So if we detect that a new window with "javascript"
>> in
>> the address bar would be created, we instead duplicate the page and run
>> that javascript. I think that would work.
>
> Do you know JavaScript? That could conceivably work in some cases, but
> certainly not all. Also,
In which cases might it not work ? It doesn't take a JS expert to hold a
conversation on pop ups.
> in many cases, opening a new window has no meaning or is a bad idea
> (e.g., when filling out an
> order form where money is going to be spent, you don't want to risk it
> happening twice).
>
Opening a new window has no meaning? How? Opening a new window can
sometimes be a bad idea. But Opera can't be expected to block a user from
doing something bad. We allow new windows for HTML, why should the
behaviour for JS be any different? You could have a banking site in pure
HTML, opening a new window is no less a bad idea there than in JS. The
"risk" is the same.
> Opera could certainly scan for anything that tries to change the URL,
> but everything else is a
> hit or miss proposition. They would have to look for the JavaScript
> programmer's intent, and
> that's inherently hard to write a program for successfully.
It *could*. But that seems overly complex while the method I described is
quite simple. The less coding required, the higher the chance of the
feature being implemented.
>Do you know JavaScript? That could conceivably work in some cases, but certainly not all. Also,
>in many cases, opening a new window has no meaning or is a bad idea (e.g., when filling out an
>order form where money is going to be spent, you don't want to risk it happening twice).
But why would I click on that link and press the Shift+Ctrl key in that
situation?
If a user does this you can expect that he wants to open an link in a
new Tab and in that case it shouldn't be too difficult to parse that
link instead of opening an empty page.
Because the user doesn't know what the developer intended. The user tends to think in pages,
and assumes most links open new pages. Developers... well, we often forget about what the user
thinks. We'll make links that look like they should open a new page of information, but really
only run some function.
Often it is right for us to do this, and you are asking Opera to decide when the developer
should be ignored. This is not something any browser maker should do lightly and thus, as I
said at the beginning, this is not an easy task. Despite what some people assume.
But it's still no problem then. If you press Shift+Ctrl+Click and it
doesn't work like you expected than you don't click it on that site next
time.
Shift+Ctrl+Click is a function for advanced useres anyway, I'd compare
it with users who turn Java-Script off - they also usually know when
they have to turn it on.
> On Thu, 24 Dec 2009 09:09:35 +0900, Naruki Bigglesworth
> <Nar...@nothankyou.com> wrote:
>
>>Developers... well, we often forget about what the user
>>thinks.
>
> And now you think you speak for all developers.
No, I clearly don't think that. No more than you think you speak for all retarded trolls.