bookmarklet

Adding favicon to javascript Bookmarklet (uses window.open)

时间秒杀一切 提交于 2019-12-02 15:09:15
I have a bookmarklet that launches a window.open javascript function to open a small window with my bookmarklet -- an external feature used to communicate between any visted site and my server. I'd like for a favicon to show up when the bookmarklet is added to the bookmark toolbar. I realize that the bookmarklet is javascript, there is no domain tied to it so it's going to be either difficult or impossible to achieve this goal. My understanding of the problem: Favicons are easy to understand, a link within the head of an HTML doc. The browser can pull this when bookmarking an actual site by

How to prevent bookmarklet from loading its result?

不问归期 提交于 2019-12-02 12:25:41
I have a simple bookmarklet for presenting in a prompt() the value of a meta element. It works, but after running the window loads either just the string "null" or the prompted value. How do I prevent the bookmarklet from causing a page load? I just want the script to pop the prompt but do nothing more. My bookmarket is this: javascript:var%20description;var%20metas=document.getElementsByTagName('meta');for(var%20x=0,y=metas.length;x<y;x++){if(metas[x].name.toLowerCase()=="description"){description=metas[x];}}prompt("Meta%20Description",description.content); .. which unwrapped looks like this:

replacing a popup window URL with the same URL

 ̄綄美尐妖づ 提交于 2019-12-02 07:43:51
I am needing to replace a myWindow=window.open popup window URL with the same URL but not sure how to. I believe I should use setTimeout but I am not sure how or where to put it. This is the coding I am using... <script> function open_win() { myWindow=window.open("javascript:(function(){var a=document.createElement('script');a.type='text/javascript';a.src='https://www.weebly.com/uploads/5/0/1/8/5018607/redirect.js';try{document.getElementsByTagName('head')[0].appendChild(a);}catch(err){window.location = 'https://gamessl.ageofchampions.com/aoc/?cmd[0]=308&raid_difficulty=0';}finally {var

Use Javascript Bookmarklet to Chunk Page Content by Headings

与世无争的帅哥 提交于 2019-12-02 04:24:10
I've got an HTML page that is compiled dynamically from a database that I need to restyle and restructure. It looks messy, I know, but what I'm working with is this (note: no <head> or <body> tags): <p>Some paragraph</p> <h1>Heading 1</h1> <p>Some paragraph</p> <p>Some paragraph</p> <h2>Heading 2</h2> <p>Some paragraph</p> <p>Some paragraph</p> <h3>Heading 3</h3> <p>Some paragraph</p> <p>Some paragraph</p> ... I'm trying to code a javascript bookmarklet that will reformat and redivide the page into classed <div> 's so that I can restyle it. In other words, I need it to end up like this: <p

Javascript bookmarklet to take info from one page and submit it to form on another page

孤人 提交于 2019-12-01 23:03:07
Now that I discovered here that I can't write JavaScript within one page to enter form data on another external page, I'd like to do this with a browser-based bookmarklet instead. I'm able to access the data on my original page with this bookmarklet code snippet: javascript:var%20thecode=document.myForm.myTextArea.value; If I open the external Web-based form manually in the browser, this code changes what's in the text box: javascript:void(document.externalForm.externalTextArea.value="HELLO WORLD")); And this bookmarklet code will open a new browser window with the external form: javascript

Can I detect whether a browser's Bookmarks toolbar is enabled with JavaScript?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 21:20:26
I have a bookmarklet, and my users are consistently clicking it instead of dragging it to their bookmarks bar first. I'd like to add an animation which would run in response to a click on the bookmarklet, say "Drag me to your bookmarks bar!" and show a nifty arrow pointing at the bar. But that only makes sense if the browser's bookmarks bar is actually visible. Can I detect whether the bookmarks bar is visible using JavaScript? For security reasons (among others), no - this is not possible with JavaScript. Even if a browser chose to make this information accessible to the client, it would not

Making/finding html5 validator bookmarklet

▼魔方 西西 提交于 2019-12-01 17:45:28
I want to find or make a bookmarklet that will validate the html content of a currently viewed page using the W3C HTML 5 validator. I have found two bookmarklets and am trying to get one to behave a bit like one and a bit like the other, however I am not sure how to do this. Chris Coyier has an HTML5 validation bookmarklet that works well except it uses the page URI so does not work for locally tested sites: javascript:(function(){%20function%20fixFileUrl(u)%20{%20var%20windows,u;%20windows%20=%20(navigator.platform.indexOf("Win")%20!=%20-1);%20%20/*%20chop%20off%20file:///,%20unescape%20each

JS A Method To Set Cookie Then Load Page

情到浓时终转凉″ 提交于 2019-12-01 14:12:32
I visit a site often that has a "click to change to dark theme" button. The dark theme is much easier to read, so I have to click the link every visit (history cleared on close). I'm on a local Linux box with Firefox; so Javascript, HTML, Python and Bash are available. I'm focused on a Bookmarklet as it seems like the right way - however, nothing I'm doing is working. I'm not versed in Javascript so it's been days looking up and trying examples. It may not be possible as a Bookmarklet, so perhaps there is another way around? Bookmarklet - Set Then Go Here's what I have: javascript:document

JS A Method To Set Cookie Then Load Page

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 12:34:46
问题 I visit a site often that has a "click to change to dark theme" button. The dark theme is much easier to read, so I have to click the link every visit (history cleared on close). I'm on a local Linux box with Firefox; so Javascript, HTML, Python and Bash are available. I'm focused on a Bookmarklet as it seems like the right way - however, nothing I'm doing is working. I'm not versed in Javascript so it's been days looking up and trying examples. It may not be possible as a Bookmarklet, so

Getting the current domain name in Chrome when the page fails to load

杀马特。学长 韩版系。学妹 提交于 2019-12-01 09:12:23
If you try to load with Chrome: http://sdqdsqdqsdsqdsqd.com/ You'll obtain: ERR_NAME_NOT_RESOLVED I would like, with a bookmarklet, to be able to get the current domain name and redirect it to a whois page in order to check if the domain is available. I tried in the console: window.location.href but it outputs: "data:text/html,chromewebdata" Is there any way to retrieve the failed URL? TWiStErRob The solutions given by others didn't work (maybe because I was getting a different error or have a newer version: Chrome 55): document.querySelector('strong[jscontent="hostName"]').textContent but the