userscripts

Ajax: How to know if a user script implementation doesn't set the Origin header?

倖福魔咒の 提交于 2020-01-30 12:09:07
问题 Some user script implementations (like Google Chrome) allow direct cross AJAX requests, but some others don't, and use Same Origin Policy restrictions. Here's a part of code: /* * Get the size of the file. * @Button the current button for downloading the video. * @Url the http url of the video. */ function SetFileSize(Button, Url) { var ajax = new XMLHttpRequest(); ajax.onloadend = function () { GetResolution(Button, Url, ' - ' + (parseInt(this.getResponseHeader("Content-Length")) / 1048576)

Ajax: How to know if a user script implementation doesn't set the Origin header?

冷暖自知 提交于 2020-01-30 12:08:44
问题 Some user script implementations (like Google Chrome) allow direct cross AJAX requests, but some others don't, and use Same Origin Policy restrictions. Here's a part of code: /* * Get the size of the file. * @Button the current button for downloading the video. * @Url the http url of the video. */ function SetFileSize(Button, Url) { var ajax = new XMLHttpRequest(); ajax.onloadend = function () { GetResolution(Button, Url, ' - ' + (parseInt(this.getResponseHeader("Content-Length")) / 1048576)

Sharing variables between 2 separate scripts [duplicate]

浪子不回头ぞ 提交于 2020-01-25 00:22:22
问题 This question already has an answer here : Get 2 userscripts to interact with each other? (1 answer) Closed 2 years ago . I'm trying to share variable between 2 different Tampermonkey scripts running in 2 separate tabs. I tried using GM_setValue in one script then retrieving it with GM_getValue in the other one but without any success, so I assume there's separate storage for each script. Is there any easy way to do this? Am I just missing something simple? Can I somehow make both scripts

Programmatically fill reactjs form

帅比萌擦擦* 提交于 2020-01-23 01:37:52
问题 I am writing an userscript and I can't manage to fill a form made by reactjs. My code: document.querySelector("#id-username").value = "name@domain.xx"; // Attempt to notify framework using input event document.querySelector("#id-username").dispatchEvent(new Event("input", {data:"name@domain.xx"})); // Attempt to notify framework using change event document.querySelector("#id-username").dispatchEvent(new Event("change")); // This doesn't help either document.querySelector("#id-username")

Remove part of title of website via userscript

混江龙づ霸主 提交于 2020-01-21 19:44:06
问题 I try to code a userscript that removes everything from the title of a website (flash browsergame) but the countdown that appears when starting an action. I'm new to Javascript and need some help. UPDATE The regexp problem is solved but I still need some help getting this script to "monitor" the title so everytime it's changes by the game the script runs again. The main title looks like this: Shakes & Fidget - The Game (buffed buffed) As soon as an action is started a countdown is added to

Remove part of title of website via userscript

丶灬走出姿态 提交于 2020-01-21 19:43:12
问题 I try to code a userscript that removes everything from the title of a website (flash browsergame) but the countdown that appears when starting an action. I'm new to Javascript and need some help. UPDATE The regexp problem is solved but I still need some help getting this script to "monitor" the title so everytime it's changes by the game the script runs again. The main title looks like this: Shakes & Fidget - The Game (buffed buffed) As soon as an action is started a countdown is added to

Does Microsoft Edge support userscripts? [closed]

試著忘記壹切 提交于 2020-01-14 07:48:07
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago . Did Microsoft announce whether Edge supports userscripts? Doesn't matter if via plugins (similar to Greasemonkey in Firefox or Tampermonkey in Chrome) or as an out-of-the-box feature. 回答1: April 2016: Windows 10 Build 14291 now supports Extensions in Microsoft Edge As

How to get video height and width from a MP4 URL with pure ecmascript and without browser support for h.264?

♀尐吖头ヾ 提交于 2020-01-13 02:44:29
问题 I'm writing a user script for downloading videos. The flash player of the web site use a JSON file. The purpose of my script is to get the url of the video by downloading and parsing the video according to the web page. Currently it can download an extract the URL of the videos successfully. The important part of the JSON file look like this : { "ammProfile": "AMM-HBBTV", "version": "VF", "versionProg": "1", "VFO": "HBBTV", "VMT": "mp4", "VUR": "http://vo.llnwd.net/v2/am/HBBTV/051332-074-A_SQ

Adding a custom keyboard shortcut using userscript to Chrome with Tampermonkey

旧城冷巷雨未停 提交于 2020-01-12 20:19:17
问题 I would like to add some custom keyboard shortcuts to a certain web page. Using the accepted answer from this question as a guide: How can I add a JavaScript keyboard shortcut to an existing JavaScript Function? I made my own little function and added a listener: // ==UserScript== // @name ChartGame // @namespace http://www.chartgame.com/ // @version 0.1 // @description enter something useful // @match http://www.chartgame.com/play* // @copyright 2012+, You // ==/UserScript== function doc

Adding a custom keyboard shortcut using userscript to Chrome with Tampermonkey

為{幸葍}努か 提交于 2020-01-12 20:19:16
问题 I would like to add some custom keyboard shortcuts to a certain web page. Using the accepted answer from this question as a guide: How can I add a JavaScript keyboard shortcut to an existing JavaScript Function? I made my own little function and added a listener: // ==UserScript== // @name ChartGame // @namespace http://www.chartgame.com/ // @version 0.1 // @description enter something useful // @match http://www.chartgame.com/play* // @copyright 2012+, You // ==/UserScript== function doc