Forum Posts

53118 posts

May 18, 2013
JoeSimmons 5561 posts

Topic: Script development / DeltaSearch was found on your site

We appreciate it, but to be honest, it's no help if we don't know which script is the issue.

 
May 18, 2013
JoeSimmons 5561 posts

Topic: Script development / access key letters in Stylish - how to disable / delete / edit them?

What access keys? I don't see any.

 
May 18, 2013
JoeSimmons 5561 posts

Topic: Script development / Make static email address link to Facebook search

Cletus wrote:
document.querySelector
Is that a new function or is it from an external library?
 
May 18, 2013
JoeSimmons 5561 posts

Topic: Script development / Alter this script...?

Haha, he uses my click function. Anyways... yea xpath is the way to go. I'm assuming you know JavaScript and want help because this isn't in the script requests forum.

I don't know the site, but you can use this general idea to get the job done:
var player = "aGuysName2010";

var allText = document.evaluate("//*[contains(., '" + player + "')]", document, null, 6, null);

for(var i=0, player; (player=allText.snapshotItem(i)); i++) {
	// do something with "player"
}
 
May 18, 2013
JoeSimmons 5561 posts

Topic: Script development / how to replace each individually in function

Let me try to un-confuse myself lol... Are you just trying to replace all the default.jpg with mqdefault.jpg? Is that it? If so, this code does it:
(Regular JavaScript; I don't know jQuery).

function convert() {

	// Get only images with default.jpg in them inside the related section
	var imgs = document.evaluate("//ul[@id='watch-related']//img[contains(@src, '/default.jpg')]", document, null, 6, null);

	// Iterate through each of them and replace as needed
	for(var i = 0, img; (img=imgs.snapshotItem(i)); i++) img.src = img.src.replace("/default.jpg", "/mqdefault.jpg");

}

window.addEventListener("load", function(e) {

	var r = document.getElementById("watch-related");

	// Check if the page has the related section
	if(r !== null && r !== undefined) {
		convert(); // Convert all into mq images
		r.addEventListener("DOMSubtreeModified", convert, false); // Convert any new images into mq
	}

}, false);
 
May 18, 2013
JoeSimmons 5561 posts

Topic: Script development / Auto refresh and page in the foreground

Well there you go :) Here's some code that's better for your timer (you could just type in "10m" for 10 minutes or "30s" for 30 seconds, etc).


var delay = "5m"; // time



var t = parseInt(delay.match(/\d+/)[0], 10),
	unit = "",
	d = 0;
switch(delay.match(/[ms]/i)[0]) {
	case "s":
		unit = "secondes";
		d = t * 1000;
		break;
	case "m":
		unit = "minutes";
		d = t * 60000;
		break;
}

window.setTimeout(window.location.reload, d);

alert("Vous n'aviez pas activé la page depuis " + t + " " + unit);
 
May 18, 2013
JoeSimmons 5561 posts

Topic: Script development / problem with turkish character

engelliListesi : ["ssg,kanzuk"],
Your array syntax is incorrect. What is your error, though? I can't offer a fix if I don't know what error you are getting.

if (Ayarlar.engelliListesi[i].toLowerCase() == kullanici.toLowerCase())
If you're searching for a word in the whole innerHTML (which should be .textContent btw), you will want to use indexOf instead... like this:
if (kullanici.toLowerCase().indexOf(Ayarlar.engelliListesi[i].toLowerCase()) !== -1)
That will search for just the one word in the whole section.
EDIT: Haha Wesley said that above, didn't see that.
 
May 18, 2013
Akhlan 3 posts

Topic: Script development / Auto refresh and page in the foreground

juste with a alert ;–)

// ==UserScript==
// @name Actualisation Page Web
// @description Permet de recharger la page toutes les x millisecondes afin de garder la session active
// @include http://www.tf1.fr/ // ==/UserScript==

// 1000 millisecondes = 1 seconde
// 10000 millisecondes = 10 secondes
// 60000 millisecondes = 1 minute
// 300000 millisecondes = 5 minutes
// 600000 millisecondes = 10 minutes
// 900000 millisecondes = 15 minutes
// 1200000 millisecondes = 20 minutes
// 1800000 millisecondes = 30 minutes
// 2700000 millisecondes = 45 minutes
// 3600000 millisecondes = 60 minutes

var delai = 10000; // Remplacer par le temps souhaité…
var delai_en_minute = delai/1000
var texte_a_afficher = ‘Vous n\'aviez pas activé la page depuis ’+delai_en_minute+‘ secondes’;

setInterval(“window.location.reload()”, delai); // 10 secondes

alert(texte_a_afficher);

 
May 18, 2013
JoeSimmons 5561 posts

Topic: Script development / Problem with script

Learn to use XPath (document.evaluate).

 
May 18, 2013
JoeSimmons 5561 posts

Topic: Script development / How would I make a auto click for something like this

Joel gonzalez` wrote:
To where every time I click an ad it will get merited.
Merited? Oh you're auto-clicking a PTC site? Your best bet would be to use XPath to grab the links as best as possible.
 
May 18, 2013
JoeSimmons 5561 posts

Topic: Script development / French encoding problem

Can you provide the site and (part) of the script?

 
May 18, 2013
JoeSimmons 5561 posts

Topic: Script development / Auto refresh and page in the foreground

I tested for a while and couldn't find a working way to focus the window in Chrome.

Akhlan wrote:
If we can’t put the web page in the foreground, may be we can open a “pop-up” ?
Like what, alert()?
 
May 18, 2013
Guri 1 post

Topic: The Banana Bar / Script that filters out articles in newspapers I don't want to see

Hello :)

Had a "block Bieber" script, but is there a configurable script I can use, or can I use that Bieber-script?

 
May 18, 2013
Mark Space 25 posts

Topic: Ideas and script requests / Image Zoom

Can anyone help me with this please? Thanks!

 
May 18, 2013
JoeSimmons 5561 posts

Topic: Script development / Problem with script (jquery?)

If you want to use jQuery in your userscript, you need to @require it.

 
May 18, 2013
Akhlan 3 posts

Topic: Script development / Auto refresh and page in the foreground

Hy Joe,

  • in my job, we can use only Chrome and Internet Explorer, not Firefox…
    and with a “window.focus” or somethink like that ? If we can’t put the web page in the foreground, may be we can open a “pop-up” ?

  • For the second remark, i’m stupid ;–) It’s good like that ;)

 
May 18, 2013
JoeSimmons 5561 posts

Topic: Script development / function in callback creates endless loop

I don't know much about jQuery, but can you post your whole script? Or at least the part that handles the div.

Does the div always exist? Or are you monitoring when it gets created?
 
May 18, 2013
JoeSimmons 5561 posts

Topic: Script development / Is it possible for my script to be "undeleted" by admins?

I don't think you can get that URL back unless an admin wants to intervene.

 
May 18, 2013
JoeSimmons 5561 posts

Topic: Script development / Please fix

You need to post this on the script's discussion, not the general forum.

 
May 18, 2013
JoeSimmons 5561 posts

Topic: Script development / 502 bad gateway

It's a site problem. This is not the correct forum.

 
May 18, 2013
JoeSimmons 5561 posts

Topic: Script development / Auto refresh and page in the foreground

Akhlan wrote:
- put the web page in the foreground when the timeout is done
As far as I know (with Firefox anyway), you can't do that.

Akhlan wrote:
- restart counter if we update this page manually before the timeout
I'm not understanding this. If the page reloads, the script will run again and the timer will start over naturally.
 
May 18, 2013
JoeSimmons 5561 posts

Topic: Ideas and script requests / How do I block specific function within specific js file?

var funcName = function() {return true;}

That will overwrite it to a function that does nothing. Of course, if you're doing it with GM, use unsafeWindow.funcName... etc.

 
May 18, 2013
Akhlan 3 posts

Topic: Script development / Auto refresh and page in the foreground

Hi,

currently we use this script with tampermonkey

// ==UserScript==
// @name Actualisation Page Web
// @description Permet de recharger la page toutes les x millisecondes afin de garder la session active
// @include http://www.tf1.fr/
// ==/UserScript==

//1 minute = 60000 ms - 1 seconde = 1000 ms
//setInterval("window.location.reload()", 1000); // 1 seconde
setInterval("window.location.reload()", 10000); // 10 secondes
//setInterval("window.location.reload()", 300000); // 5 minutes
//setInterval("window.location.reload()", 600000); // 10 minutes
//setInterval("window.location.reload()", 900000); // 15 minutes
//setInterval("window.location.reload()", 1200000); // 20 minutes
//setInterval("window.location.reload()", 1800000); // 30 minutes
//setInterval("window.location.reload()", 2700000); // 45 minutes
//setInterval("window.location.reload()", 3600000); // 60 minutes

And this isn't top...

We would like the script:
- put the web page in the foreground when the timeout is done
- restart counter if we update this page manually before the timeout

Could you help me?

Rgds
Akhlan

 
May 18, 2013
John12341234 6 posts

Topic: Ideas and script requests / How do I block specific function within specific js file?

I want to skip, delete, or overwrite a specific function within a specific javascript file that is loaded when a page loads (not my website) so that it was like the function never ran. (the function I want to block/omit stops the control and alt keys from working) I want it to happen automatically whenever I'm on that domain using firefox. How would I do this specifically?

 
May 18, 2013
Jefferson Scher 1663 posts

Topic: Script development / Firefox 22 Update - Scripts gone?

Are you on the beta channel? You should be able to install the release version (Firefox 21) over the beta. Not sure how that works on Mac...