open pop up after clicking bookmark link - javascript

I am working on a short application. In which I have followiing things.
move a link something from my page to Bookmark Toolbar of Browser- Done.
After clicking on the bookmark link pop should open. (user can be at any other website). he will click on the bookmark link and then pop up should open -- NOT DONE
that pop should fetch the title,meta,description of parent window (users current opened website).--DONE
Obviously My question is about 2 Point. I cant figure out how to make this bookmark link to an absolute css/javascript so that it can open on any website.

You can add javascript to URLs like so:
Bookmarklet
Note that I have prepended the URL with javascript: to indicate the browser that it should execute the URL as javascript.
So for a pop it would be something like:
Bookmarklet
Here is a jsFiddle with the code above for you to test.
For more information about bookmarklets you might like the following article: http://betterexplained.com/articles/how-to-make-a-bookmarklet-for-your-web-application/

Related

Is there a way of exiting Google Translate's iframe?

In our website we have a link that allows people to view the page using Google Translate, e.g. https://translate.google.com/translate?sl=auto&tl=fr&js=n&prev=_t&ie=UTF-8&layout=2&eotf=1&u=http%3A%2F%2Fwww.example.com. Google Translate wraps our page in an iframe and does its magic.
We open this link in a new tab. Once the user has finished we'd like to provide an easy way for the user to get back to what they were doing. They can close the tab themselves, but their focus is on the content rather than on browser controls. Is there any way for us to provide a button on the page that will close the tab? I'm thinking something like window.close() would do for a normal tab.

how to open aliexpress app in browser?

I have a link like this:
Click me
in the linkHere section, its link that comes from the back-end (in the link the redirector on aliexpress web site).
If you click on this link from mobile browser, a window will open (native), which will prompt you to open the link (in the browser or if the person has an aliexpress application, then he will offer the same).
What is the complexity. There is a timer in a few seconds, if a person has not clicked on the link I wrote above, then you also need to show the native window (by which to open the link: browser or application ali). The hours of google did not help ... Can someone come across this? Thank you!

Can I display a popup over a CFDOCUMENT page?

Here's what I'd like to do in Coldfusion:
On a webpage there is a "Download" href link and I want another browser tab to open when the user clicks this link. In the new tab, I am creating a PDF via CFDOCUMENT in Coldfusion. This in of itself works.
However, since the PDF has a delay before it loads in the tab, I want to display a popup to the user that the PDF may take a few moments to load.
So what I tried to do was this sequence:
User clicks "Download" ->
On the same page, I trapped the link with jquery and displayed a popup
window alerting the user there may be a delay ->
User clicks OK on the popup ->
Using javascript window.open, redirected to a new browser window for the PDF.
This was unsuccessful because using window.open in javascript is not trusted by browsers and the new tab doesn't show up because of popup blockers.
So then I thought I'd create a popup in the new browser tab instead before the PDF loads, but discovered I can't use javascript on a page with CFDOCUMENT.
Any ideas as to how to best accomplish this if anything can be done?
I think iframe might be your friend here. It allows you to display another document in the pdf page.
Using your example in the comment, I created two files: one to display the prompt message and one to display the PDF.
cfprompt.cfm
<body>
<div> this is a test </div>
</body>
<cfflush>
<iframe src="pdf.cfm" >
</iframe>
pdf.cfm
<cfdocument format="pdf">
<h1>Hello ColdFusion</h1>
<p>This is <strong>PDF</strong> example document.</p>
<p>Genereated at: <cfoutput>#TimeFormat(Now())# on #DateFormat(Now())#</cfoutput></p>
</cfdocument>
You're still going to have to play with the formatting/sizing of the iframe so that it displays correctly, but hopefully this allows you to display the PDF.

Executing code to an other window through window.open()

I making this bot in JavaScript in the chrome console. And one of the lines in my script is window.open('thewebsite','_self') so it opens a different website in the same window. However I cant seem to execute code on that new website that I opened with window.open(). For example I want to do document.getElementById().click() however its not clicking on the new website I made.
For example:
If I was on google.com the script would open googleimages. But I want the next line of code for example typing in the search bar to happen on google images.
window.open refreshes console, so you can't execute any code after.
You could try to get target url content and replace first page content, but you'll be blocked with Access-Control-Allow-Origin
What you're trying to achieve is indeed a macro. You should take a look at iMacros and see how they chain instructions from page to page.

Show popup and redirect to the link

I have been looking in too many links but I am not getting the desired results, although it is a very basic question to ask but i am unable to find some useful help.
I have a hyperlink pointing to the external link like google,
Now I want to show a popup when somone clicks on this link, I can fire up a jquery modal or fancybox on onclick event, thats not the problem.
I assume that it is not possible to show my own window on external link?
I need to fire up a modal and after closing of modal, the external link should be opened in new tab.Thanks for help.
I don't know what code to share here as i have only hyperlink
If I am getting you right, solution
in your home page add the link to the popup window
Open
in the popup window add the following link
<a href='http://google.com' onclick='window.close();' target='_blank'>LINK</a>
if it is not what you want, I hope it is a starting point to the solution

Categories