What's new
Apple iPad Forum 🍎

Welcome to the Apple iPad Forum, your one stop source for all things iPad. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Guide: Creating Safari Bookmarklets

OP
Mickey330

Mickey330

Administrator
Staff member
Joined
Aug 30, 2010
Messages
11,890
Reaction score
2,226
Location
Western NY state (USA)
I am unable to get this to work for the Photon browser. In other words, I click the bookmark but nothing at all happens. No error, no activation of Photon. Nothing.

I'm using an iPad 3 with iOS 7. Could there be a problem with the new OS? I am able to use the bookmarklet for opening iCab OK, so I think I have the bookmarklet creation procedure right. Though the post shows a smiley, I do have the proper colon and open paren in the actual code. :)

Any ideas or thoughts of what else I might check?

Thanks for a great set of procedures!~!

James

This is very odd - cause the JavaScript from the first page works for me. So, try one or both of these two things:

(1) Use this script I just put into my iPad 3 that is running iOS 7:

javascript: (function()%7Bif(document.location.href.indexOf('http')===0)document.location.href=document.location.href.replace(/%5Ehttp/,'photon');%7D)();

NOTE: Take out the space after the first colon (after the word javascript). Had to put it in to remove the forum's attempts at smiley faces...

I say to try this because when I compared the script you posted above with the script I just posted, they appeared to be different. It may be that the forum software changed it, but just in case, I know what I pasted works.

...or...

(2) Try fully closing out Safari on the iPad (do the 4-finger swipe up to reveal the cards, then swipe up to close Safari). Then, in the Safari tab of your Settings app, clear out both history and cookies.

I had to do this in order to make the above code work on my phone. I had saved it to my Favorites in Safari on the iPad, which is synced to Safari on my phone. But, it didn't work at first. So, I cleared everything out and now this bookmarklet works on both my iPad and my iPhone.

So, try again? Good luck and let us know how you get on.

Marilyn
 

brudderman

iPF Noob
Joined
Jul 14, 2012
Messages
7
Reaction score
0
This is very odd - cause the JavaScript from the first page works for me. So, try one or both of these two things:

(1) Use this script I just put into my iPad 3 that is running iOS 7:

javascript: (function()%7Bif(document.location.href.indexOf('http')===0)document.location.href=document.location.href.replace(/%5Ehttp/,'photon');%7D)();

NOTE: Take out the space after the first colon (after the word javascript). Had to put it in to remove the forum's attempts at smiley faces...

I say to try this because when I compared the script you posted above with the script I just posted, they appeared to be different. It may be that the forum software changed it, but just in case, I know what I pasted works.

...or...

(2) Try fully closing out Safari on the iPad (do the 4-finger swipe up to reveal the cards, then swipe up to close Safari). Then, in the Safari tab of your Settings app, clear out both history and cookies.

I had to do this in order to make the above code work on my phone. I had saved it to my Favorites in Safari on the iPad, which is synced to Safari on my phone. But, it didn't work at first. So, I cleared everything out and now this bookmarklet works on both my iPad and my iPhone.

So, try again? Good luck and let us know how you get on.

Marilyn

Thanks, Marilyn!

Progress, but not there quite yet. When I use the latest code, I now get an error message: "Safari cannot open the page because it it a local file." I don't know what this means. I have done as you suggested by completely closing Safari and then clearing history and cookies, but that makes no difference. When I put the new code into iCab, however, Photon opens right up from iCab, whereas it didn't before. So the code itself must work, and perhaps there's some Safari setting that's still causing the error.

Any further ideas?

Thanks for helping!
 
OP
Mickey330

Mickey330

Administrator
Staff member
Joined
Aug 30, 2010
Messages
11,890
Reaction score
2,226
Location
Western NY state (USA)
Thanks, Marilyn!

Progress, but not there quite yet. When I use the latest code, I now get an error message: "Safari cannot open the page because it it a local file." I don't know what this means. I have done as you suggested by completely closing Safari and then clearing history and cookies, but that makes no difference. When I put the new code into iCab, however, Photon opens right up from iCab, whereas it didn't before. So the code itself must work, and perhaps there's some Safari setting that's still causing the error.

Any further ideas?

Thanks for helping!

Darn it! I now have no idea how to help! Cause I was getting that message, too, which is what caused me to do (and suggest) the close Safari and delete cookies and history process.

Only thing I can think of now is to try a restart or a reset of the iPad. Cause that code works (!). Or, maybe try putting the JavaScript in your Favorites, where mine is? Grasping at straws here...

Then, try again. Other than that, I'm out of ideas, cause it works fine on mine and my Safari has no restrictions or anything.

Sorry, but I am stumped as to why it works for me but not for you. :(

Marilyn
 

brudderman

iPF Noob
Joined
Jul 14, 2012
Messages
7
Reaction score
0
Darn it! I now have no idea how to help! Cause I was getting that message, too, which is what caused me to do (and suggest) the close Safari and delete cookies and history process.

Only thing I can think of now is to try a restart or a reset of the iPad. Cause that code works (!). Or, maybe try putting the JavaScript in your Favorites, where mine is? Grasping at straws here...

Then, try again. Other than that, I'm out of ideas, cause it works fine on mine and my Safari has no restrictions or anything.

Sorry, but I am stumped as to why it works for me but not for you. :(

Marilyn

Thanks!

I forgot to mention that I did reboot the iPad and test again before posting the error. And the bookmark is in my Favorites. So I have no idea what to do next. But what I can do is jump to iCab from Safari and then from iCab to Photon. ;) I don't really expect to be doing this much. And I may go ahead and buy Photon for my iPhone and see if it will work from there. If I find a tweak that makes it work, I'll post what I find.

One more question now, if you don't mind.

Send to Evernote

javascript
: (function()%7BEN_CLIP_HOST='http://www.evernote.com';try%7Bvar%20x=document.createEle ment('SCRIPT');x.type='text/javascript';x.src=EN_CLIP_HOST+'/public/bookmarkClipper.js?'+(new%20Date().getTime()/100000);document.getElementsByTagName('head')%5B0% 5D.appendChild(x);%7Dcatch(e)%7Blocation.href=EN_C LIP_HOST+'/clip.action?url='+encodeURIComponent(location.href )+'&title='+encodeURIComponent(document.title);%7D %7D)();

I can't get the code for sending to Evernote to work either. Nothing at all happens when I activate the bookmark as was the case with Photon. I've copied the above code from Page 1 of this thread but have put a space after the initial colon to avoid the smiley face.

Any ideas with the Evernote?

Thanks so much for helping!

James
 
OP
Mickey330

Mickey330

Administrator
Staff member
Joined
Aug 30, 2010
Messages
11,890
Reaction score
2,226
Location
Western NY state (USA)
Well, now I can't, either. But, my issue is that it keeps telling me that I have to allow third-party cookie, even though I have (via Settings). So, on this one, I dunno! The bookmarklet does give me a pop-up window where I can enter in my Evernote sign in info, but then I get that cookies notice.

So, on this one, I'm stumped. I'll keep playing with it, but it may be that the update to Safari "broke" this one.

I'm 0 for 2 on this, so I think I'll just quit now. Unless, of course, I find a solution for the Evernote... Sorry.

Marilyn
 

brudderman

iPF Noob
Joined
Jul 14, 2012
Messages
7
Reaction score
0
Well, now I can't, either. But, my issue is that it keeps telling me that I have to allow third-party cookie, even though I have (via Settings). So, on this one, I dunno! The bookmarklet does give me a pop-up window where I can enter in my Evernote sign in info, but then I get that cookies notice.

So, on this one, I'm stumped. I'll keep playing with it, but it may be that the update to Safari "broke" this one.

I'm 0 for 2 on this, so I think I'll just quit now. Unless, of course, I find a solution for the Evernote... Sorry.

Marilyn

Yes, let me know if you discover anything else. In the meantime, I now have a way to go to Photon from iCab, which is my browser of choice. So you're certainly better than 0 for 2!

Thanks for all the help!

James
 

twerppoet

iPad Fan
Joined
Jan 8, 2011
Messages
24,150
Reaction score
15,398
Location
Milton-Freewater, OR
Played with this a bit, and I think I found something that will work for re-enabling the Evernote bookmarklet, at least on a temporary basis.

Go to Settings > Safari and change the Block Cookies settings to Never. Go to Safari and try the bookmarklet. If it works, sign in (if needed). Now go back to Safari's settings and change Block Cookies back to Third Parties and Advertisers. I don't know if this works because it resets something in how Cookies are handled, or because it creates the necessary cooky in Safari. If the first, it should just keep working. If the second it will probably stop working the next time you are forced to clear cookies and data.

Some experimentation may be required.

While it's not quite the same thing there is the EverClip app. You start this app, then let it run in the background. From that point on anything you copy gets created as a note in the EverClip app, with a chime to let you know it happened. When you open the app again you can sort, combine, delete, and then send the notes on to Evernote.

It only runs for about 10 minutes, but it will let you know when it's quitting so you can start it again.
 
OP
Mickey330

Mickey330

Administrator
Staff member
Joined
Aug 30, 2010
Messages
11,890
Reaction score
2,226
Location
Western NY state (USA)
Played with this a bit, and I think I found something that will work for re-enabling the Evernote bookmarklet, at least on a temporary basis.

Go to Settings > Safari and change the Block Cookies settings to Never. Go to Safari and try the bookmarklet. If it works, sign in (if needed). Now go back to Safari's settings and change Block Cookies back to Third Parties and Advertisers. I don't know if this works because it resets something in how Cookies are handled, or because it creates the necessary cooky in Safari. If the first, it should just keep working. If the second it will probably stop working the next time you are forced to clear cookies and data.

Some experimentation may be required.

While it's not quite the same thing there is the EverClip app. You start this app, then let it run in the background. From that point on anything you copy gets created as a note in the EverClip app, with a chime to let you know it happened. When you open the app again you can sort, combine, delete, and then send the notes on to Evernote.

It only runs for about 10 minutes, but it will let you know when it's quitting so you can start it again.

See, now I know how James feels! :)

No matter what I do (never block cookies and even turning off the "do not track button), the Evernote bookmark let tells me that I must allow third-party cookie. Grrrrrrrrr.

So, I've given up on that bookmarklet for now.

I have used the EverClip app and James, if you're still reading this, it does work wonderfully well, especially if you are in an intensive Evernote clipping mode.

I'd forgotten about that one, TBH. Okay, if truthful, I'd forgotten about the Evernote bookmarklet, also. :) Guess I don't do enough clipping on my iPad. Still annoyed the bookmarklet won't work, though... :)

Thanks for the reminder of the app, twerppoet.

Marilyn
 

twerppoet

iPad Fan
Joined
Jan 8, 2011
Messages
24,150
Reaction score
15,398
Location
Milton-Freewater, OR
See, now I know how James feels! :)

No matter what I do (never block cookies and even turning off the "do not track button), the Evernote bookmark let tells me that I must allow third-party cookie. Grrrrrrrrr.

So, I've given up on that bookmarklet for now.

I have used the EverClip app and James, if you're still reading this, it does work wonderfully well, especially if you are in an intensive Evernote clipping mode.

I'd forgotten about that one, TBH. Okay, if truthful, I'd forgotten about the Evernote bookmarklet, also. :) Guess I don't do enough clipping on my iPad. Still annoyed the bookmarklet won't work, though... :)

Thanks for the reminder of the app, twerppoet.

Marilyn

No problem.

I did one other thing before the bookmarklet started working, but I did not mention it because I don't see how it would make a difference, but I'll mention it now, just incase. I went to Safari on my iMac and used the bookmarklet there to sign in. I wanted to be sure that the bookmarklet wasn't completely broken before I kept trying to fix it on the iPad.

My bookmarks are synced between the two browses, so this is fairly easy for me to do.
 

brudderman

iPF Noob
Joined
Jul 14, 2012
Messages
7
Reaction score
0
Played with this a bit, and I think I found something that will work for re-enabling the Evernote bookmarklet, at least on a temporary basis.

Go to Settings > Safari and change the Block Cookies settings to Never. Go to Safari and try the bookmarklet. If it works, sign in (if needed). Now go back to Safari's settings and change Block Cookies back to Third Parties and Advertisers. I don't know if this works because it resets something in how Cookies are handled, or because it creates the necessary cooky in Safari. If the first, it should just keep working. If the second it will probably stop working the next time you are forced to clear cookies and data.

Some experimentation may be required.

While it's not quite the same thing there is the EverClip app. You start this app, then let it run in the background. From that point on anything you copy gets created as a note in the EverClip app, with a chime to let you know it happened. When you open the app again you can sort, combine, delete, and then send the notes on to Evernote.

It only runs for about 10 minutes, but it will let you know when it's quitting so you can start it again.

Thanks for the suggestion. I couldn't get it to work and am ready to give it up since further effort isn't justified compared to my relatively small usage of Evernote on the iPad. :rolleyes:
 

brudderman

iPF Noob
Joined
Jul 14, 2012
Messages
7
Reaction score
0
See, now I know how James feels! :)

No matter what I do (never block cookies and even turning off the "do not track button), the Evernote bookmark let tells me that I must allow third-party cookie. Grrrrrrrrr.

So, I've given up on that bookmarklet for now.

I have used the EverClip app and James, if you're still reading this, it does work wonderfully well, especially if you are in an intensive Evernote clipping mode.

I'd forgotten about that one, TBH. Okay, if truthful, I'd forgotten about the Evernote bookmarklet, also. :) Guess I don't do enough clipping on my iPad. Still annoyed the bookmarklet won't work, though... :)

Thanks for the reminder of the app, twerppoet.

Marilyn

Thanks, Marilyn, for all of the ideas. I also am giving this one up for now but am glad to have the Photon working, at least from iCab. So all of this hasn't been a loss at all. If I come up with a revelation that actually works, I'll post it here! ;)

James
 

twerppoet

iPad Fan
Joined
Jan 8, 2011
Messages
24,150
Reaction score
15,398
Location
Milton-Freewater, OR
Thanks for the suggestion. I couldn't get it to work and am ready to give it up since further effort isn't justified compared to my relatively small usage of Evernote on the iPad. :rolleyes:

No problem. I'm sorry it didn't work.

Don't forget you can also email the site's link using your Evernote email address. While this only sends the link, you can open the link in Evernote's built in browser at a later time and create another note with all or selected portions of the site. Awkward, but the link is enough to remind you of what you need to do, and better than nothing.
 

Most reactions

Latest posts

Top