Script stopped working

in Script development
Subscribe to Script stopped working 5 posts, 2 voices

Integrator Scriptwright

Hi all.

I wrote a script with your helps about a half year ago, but recently it stopped working.

var excludes = '&fromWall';
var openedLinks = {};
var theButton = document.createElement('input');
theButton.type = 'button';
theButton.value = 'Start script';
theButton.addEventListener('click', function() {
var theLinks = document.links;
var currentURL = "";
for(var i = 0; i < theLinks.length; i++) {
currentURL = theLinks[i].href;
if(currentURL.indexOf('LINK') != -1 && currentURL.indexOf(excludes) == -1 && openedLinks[currentURL] != true) {
openedLinks[currentURL] = true;
}, false);

The script only do to open all 'xy' links in new tabs in from the desired facebook groups, but in the last 4-5 days, the 'Start Script' button doesn't appear.

Can any of you help me?

Vivre Scriptwright

Hi Integrator,

I tested your script for a while and I didn't find any page where the button wouldn't show up. Even on plain-text-adresses it apears, though not on pictures.

In all but one case the button is placed bottom-left-corner. In that one case the button is centered. Maybe the page-structure of that page where you're using the script places the button out of view ?

Try if it would apear at the page top if you exchange the following code line:

document.body.insertBefore(theButton, document.body.firstChild);

If it doesn't show, test if the script works at all by changing your @include address to global @include * (so the button should come up on any page).

And/Or add the following code line underneath the script
alert(' ~ The script has been read allright ;-) ~ ');

If the message pops up the button should be somewhere.

When you say the issue started the previous couple of days it might be due to specific changes on your include-address a respectively fakebook-teasing (*?*)
... meaning - it's often handy to know where a script should work ;-)


ps: this is a follow up from: Open desired links in new tabs -

Integrator Scriptwright


I did the modification you adviced, and I got the alert, but I did not find anywhere the button. You asked for the exact place where the script should work, so here's an example:
Any idea?

Integrator Scriptwright

Ohh, and I forget to mention. I add @include * and got the alert on each page (example in google, etc.), but the button is nowhere...

Vivre Scriptwright

Hi again,
If the button doesn't apear on any page the issue is likly outside the script (any updates ? MS / FF / GM / user-scripts / new 'collaborating scripts'...)

To me the script works on your given address (though I can't step in deeper).
Maybe s.o. else jumps in with a further idea but until then I can offer you a 'workaround'.

I put up a small 'button-study':
for you to test if these show up for you.

Deactivate your current script - just enclose it by /* ... */ and paste the whole test behind it. Any button can be clicked safely.
The 4th button is prepared to quick-test with your script: just exchange the alert command (row) with the function-content of your own script.

I hope it works and enjoy designing your own ;-)