nntoan / scriptify

Automatically exported from code.google.com/p/scriptify
MIT License
0 stars 0 forks source link

Scriptify addons do not run on pages if the page is opened via a target="_blank" link #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Scriptify generated addons won't run on pages specified in their include list, 
if the link you click to get to the specified page has the target="blank" 
attribute set.

What steps will reproduce the problem?

1) Create a scriptify addon from the following code (or use the ready made one 
that i've attached)

// ==UserScript==
// @name            Tab Opener Bug Tester
// @description     Tab Opener Bug Tester
// @author          S Fernandez
// @version         1.0 - 21/8/14
// @namespace       http://fburity.com
// @include         http://www.fbpurity.com/test/*
// ==/UserScript==

if(location.href.match(/test\=1/))
  alert('If you see this the script worked');

2) go to the following page in your browser 
http://www.fbpurity.com/test/tabopen.htm

3) click the first link on the page (it has the target='_blank' attribute set)

What is the expected output? What do you see instead?

The alert should popup. It doesn't pop up. It only pops up if you right click 
the first link and select "open in new tab", or middle click the link.

What version of the product are you using? On what operating system?

scriptify 0.2.7 windows 7

Please provide any additional information below.

Original issue reported on code.google.com by st3...@gmail.com on 21 Aug 2014 at 10:44

Attachments:

GoogleCodeExporter commented 9 years ago
Works as expected for me.

Original comment by maglion...@gmail.com on 3 Sep 2014 at 12:56

GoogleCodeExporter commented 9 years ago
OK this is very weird. it seems that it works as it should do if the latest 
version of the greasemonkey extension is also installed (v2.2 released August 
28, 2014)

If the GM extension is not installed, the error occurs as described in my issue.

I cannot understand why this would be the case, got any ideas?

Original comment by st3...@gmail.com on 9 Sep 2014 at 11:58

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
OK this is even weirder, having the greasemonkey extension installed along side 
the simple test case extension makes it work ok. But it doesnt stop the tab 
opener bug in my actual extension that i am seeing the problem in. this is so 
odd.

Original comment by st3...@gmail.com on 25 Sep 2014 at 1:01

GoogleCodeExporter commented 9 years ago
can you please look into this bug again

Original comment by st3...@gmail.com on 9 Oct 2014 at 12:29

GoogleCodeExporter commented 9 years ago
suggestion: try running it on a fresh firefox profile, with no other extensions 
etc installed, that should isolate the bug

Original comment by st3...@gmail.com on 9 Oct 2014 at 3:22

GoogleCodeExporter commented 9 years ago
I've decided i will have to workaround the bug as its been so long since its 
been reported, I am going to scan for any links with target="_blank" and remove 
the target attribute, that should fix the issue. But in order not to disturb 
the normal behaviour for the users using the greasemonkey version of the script 
that works fine, i need some way in the code of determining whether the script 
is running as a greasemonkey script or as a scriptif-ied extension, any ideas 
on how this can be achieved?

Original comment by st3...@gmail.com on 9 Oct 2014 at 4:29