Open a URL in same window / tab
-
TrulsF last edited by
How can I open a URL in same window / tab?
I am using Dropbox, and for each file there I can obtain a Dropbox link like "https://www.dropbox.com/s/xxxxxxxxxxx/yyyyy.pdf?dl=0".
This link results in that the file opens in a new window / tab.
Is there a way I can modify this url so that it opens in the same window / tab? -
alobpreis last edited by alobpreis
Whether a link is opened in the same tab or not it's AFAIK up to the current page's html code. If you want a link to open in a new tab, you have to include
target="_blank"
in thea href
tag. I don't think the link itself has any relation to this behavior. Where are these links exactly?You can do some tests of the above here:
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_a_targetI did and after removing the target attribute, the link opened right there.
-
TrulsF last edited by
@alobpreis Thank you for looking into my case.
I realize I must be more precise.
I use an Excel spreadsheet that contains the code. When I save it as pdf (not print to pdf) the resulting pdf contains valid url's.
You can see it all live here (link obtained from Dropbox): https://www.dropbox.com/s/plkk5pnde9b1qw6/101.pdf?dl=0
On this page you will see two red arrow-fields up and down. You will also find a red line in the lower part pointing at other information.
If I click on either of these three, the next page opens in a new window / tab. My hope is to find a solution to open them in the same window / tab, so that I don't consume too many windows / tabs. -
alobpreis last edited by alobpreis
Oh, then it's a bit tricky because what you have there is the PDF reader inside Dropbox, and that reader converts PDF links to html that opens in a new tab. For example:
<a aria-label="External link" href="https://www.dropbox.com/s/15vfmbaoldh8llp/R1101.pdf?dl=0" rel="noreferrer noopener" target="_blank" style="position: absolute; bottom: 76.584px; left: 53.4px; width: 580.06px; height: 12.48px;"></a>
Note -of course- the
target="_blank"
there.Normally I'd say you can't do anything, because that's how Dropbox and its PDF reader work, but you could try modifying the html either by manually running some Javascript, or maybe having a browser's extension which automatically runs your Javascript code.
An example of such code using jQuery:
$('a[href*="dropbox.com"]').attr('target', '')
-
TrulsF last edited by
@alobpreis I understand that this is quite complicated, and since I cannot control the browsers of the users accessing my web I just have to leave it as it is. It works OK, and the only catch is that there might be some extra tabs to close for the users after they have finished using my web.
-
TrulsF last edited by
@alobpreis I do have another issue in case you have the opportunity to help me.
It is regarding the print options in Excel.
I have a long spreadsheet consisting av around 150 sections.
Each section contains all the information the I want to print, but for each section I only want to print a certain number of rows.
This number varies for each section, but it is found within the data.
I found a way to do this using the OFFSET and the Ctrl + F3 key (Name...) and combine this with modifying the Print Area.
=OFFSET(INDIRECT("$A"&RankingDetails!$X21);0;0;INDIRECT("AD"&RankingDetails!W14)+1;18)
But it very unstable in the way that if I try to automate it, it is easily disturbed if anything else happens on my computer.
So my question is; do you know a way to print a spreadsheet, with header and footer, for any part of the spreadsheet, limited by start row and number of rows? -
alobpreis last edited by
@trulsf said in Open a URL in same window / tab:
@alobpreis I do have another issue in case you have the opportunity to help me.
It is regarding the print options in Excel.
...Are you asking about an Excel formula in a topic about a PDF link from within Opera? Kind of weird. Unless it's related to Opera somehow, but I think it's not.
I don't have the answer, but I guess you should ask somewhere else, like in superuser.com (from the Stack Overflow platform).
-
TrulsF last edited by
@alobpreis Yes, You are correct. It is a totally different matter, and it does not belong to this case. Thank you anyway. I have really appreciated your efforts.
-
burnout426 Volunteer last edited by
An Opera/Chrome user can drag the link upwards and drop it on the current tab in the tab bar and it won't open in a new tab.
Users of browsers that support extensions can use an extension like https://chrome.google.com/webstore/detail/death-to-blank/gneobebnilffgkejpfhlgkmpkipgbcno/related to remove target="_blank" so the links open in the current tab.
I'm assuming Dropbox doesn't support anything for Dropbox pdf URLs in the query string like
https://www.dropbox.com/s/plkk5pnde9b1qw6/101.pdf?dl=0&sametab=1
. But, you can search the net to see if any thing comes up. -
TrulsF last edited by
@burnout426 said in Open a URL in same window / tab:
Thank you for the tip "drag the link upwards and drop it".
This worked very fine.
For the moment I just have to accept that there are no other ways. -
-