bookmarklet

Change youtube video ID without page reloading

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-02 10:34:28
问题 This question is about scripting the main youtube site, client side from javascript. While it looks easy as a click, I found no way to change the current video by a new non in context video ID without reloading. This seems to be related with the polymer library in use, with a lot of shadow dom and some special behavior. Here is the context: I am making for my own use a bookmarklet that load videos from the reddit json api , wich supports CORS calls. So far so good, I can load many videos,

Javascript for conditional URL append or redirect based on window.location.href

自闭症网瘾萝莉.ら 提交于 2020-01-01 14:45:13
问题 I am trying to make a bookmarklet that when clicked will check the URL of the current tab/window to see if it contains 'char1' and/or 'char2' (a given character). If both chars are present it redirects to another URL, for the other two it will append the current URL respectively. I believe there must be a more elegant way of stating this than the following (which has so far worked perfectly for me) but I don't have great knowledge of Javascript. My (unwieldy & repetitive) working code

Bookmarklet which captures selected content including html tags

喜你入骨 提交于 2020-01-01 00:44:11
问题 I'm building a JS bookmarklet which allows me to capture text that a user has selected in their browser and sends it off to a web app. I've currently checked out a couple of tutorials and have a script which looks like this: javascript:var t;try {t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));}catch(e){t="";}alert(t); To make it a bit easier, here's

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

扶醉桌前 提交于 2019-12-31 03:14:06
问题 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

Auto Click With Type or Value Tag

六月ゝ 毕业季﹏ 提交于 2019-12-30 10:59:09
问题 Dear friends i have site for which i would like to create javascript bookmarklet for autoclick, but the site does not use ID tag. here is the code of site :- <input type="submit" name="Submit" value="Find Product" onclick="return incrementClicksTest('2','true')" class="buttonSubmit"> I used this JavaScript bookmarklet javascript:document.getElementById('any_id_here').click() workes fine for id, how do i go about making bookmarklet using name,value and type tag thanks dvance!! 回答1: Use the

Allowing cross-origin requests in Yesod

本秂侑毒 提交于 2019-12-30 00:56:08
问题 My application uses a bookmarklet, and I need to allow CORS for MyRouteR so my bookmarklet code can use this route for AJAX requests. In my first draft of config/routes I gave MyRouteR support for only one request method, PUT. But it turned out (duh) that I'd need to support the OPTIONS method as well, which browsers use for CORS preflight requests. I ended up with the following in config/routes: /myroute MyRouteR PUT OPTIONS I was kind of hoping there would be some relevant machinery in the

How can I remove an inline onclick attribute with a bookmarklet?

眉间皱痕 提交于 2019-12-29 08:56:17
问题 There is an annoying website out there that foils attempts to "open in new tab" by using <div onclick=> instead of <a href=> . I've written a bookmarklet, using jQuery, that creates a wrapper <a> tag and inserts it within the <div> around its content. How can I remove the original onclick handler? 回答1: Not mentioned yet: $('#myId')[0].onclick = null; // remove the inline onclick() event 回答2: Untested, but... $("selector").removeAttr("onclick"); I guess you have already tried to $("selector")

Bookmarklet: Click All Like Buttons On Tumblr

情到浓时终转凉″ 提交于 2019-12-25 02:14:07
问题 Similar to this Follow all users on a twitter page, I am trying to change this to click all the "like" hearts on a Tumblr page instead of the follow button: javascript:$('.button.follow-button').click() Thanks 回答1: javascript:var a = document.getElementsByTagName('a'); var b = []; for(var i=0, len = a.length; i < len; i++){ if(a[i].id.indexOf('like_button') !== -1){b.push(a[i]) } }; for(var i=0, len = b.length; i < len; i++){ b[i].onclick() }; There. What it does is gets all the a tags on the

Bookmarklet: Click All Like Buttons On Tumblr

老子叫甜甜 提交于 2019-12-25 02:12:51
问题 Similar to this Follow all users on a twitter page, I am trying to change this to click all the "like" hearts on a Tumblr page instead of the follow button: javascript:$('.button.follow-button').click() Thanks 回答1: javascript:var a = document.getElementsByTagName('a'); var b = []; for(var i=0, len = a.length; i < len; i++){ if(a[i].id.indexOf('like_button') !== -1){b.push(a[i]) } }; for(var i=0, len = b.length; i < len; i++){ b[i].onclick() }; There. What it does is gets all the a tags on the

JavaScript Bookmarklet; click button, reload page, then open page

故事扮演 提交于 2019-12-25 00:28:25
问题 I am trying to create a bookmarklet that follows this process: From any page, click the bookmarklet load a specific page. Trigger an input button which causes page to reload Once reloaded; open a new page; in this case a social media page. This is what I've written so far: if (!($ = window.jQuery)) { // Inject jQuery to make life easier script = document.createElement( 'script' ); script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'; script.onload=SocialCredentials;