misses links
|
|
Various of the comments here: https://addons.mozilla.org/en-US/firefox/addon/... have links but this script doesnt catch them or only linkifies it partially. In fact, this script doesnt work at all here: http://yellow5.us/firefox/testcases.txt |
|
|
Also the green addresses found on Google Images Searches for example are not linkified. |
|
|
This isn't my script. I just edited it to not linkify emails. |
![]() ![]() |
the test page at yellow5.us is not an html page, so that's why it doesn't work. |
![]() ![]() |
stibwrote:Yup that's why. Greasemonkey doesn't run on text files, or images, or anything that's not an (X|HT)ML page. |
![]() ![]() |
Yup that's why. Greasemonkey doesn't run on text files, or images, or anything that's not an (X|HT)ML page. This isn't correct. I don't use this script, but I use the original linkify_ting, and it runs on the yellow5.us text file. It just doesn't do anything. Try adding an alert or a GM_log and they work fine. The reason linkify_ting doesn't do anything is that the array altText has no members, so this "for" (which wraps everything) never executes: In this script (exclude emails), the altText array has no members either, so the line: for(var i=0,tekst; (tekst=altText.snapshotItem(i)); i++){ does not execute. I've noticed that some of my other scripts, when executed first, html-ify the yellow5.us test.txt page sufficiently so that linkify_ting *does* execute on the page. I'm not really very good at javascript or greasemonkey, but it should be possible to rewrite to solve this, if anyone cares enough. edit: It seems that the linkify_ting script is never running on the test page, it's apparently another script - Rapidshare links checker, which does similar linkify work to create the links. |
![]() ![]() |
Orthogonally... wrote:That page is actually an html page if you look in Firebug. Something in Firefox formats it into html, then Greasemonkey can run on it. |
![]() ![]() |
That page is actually an html page if you look in Firebug. That explains it. |
![]() ![]() |
That explains it. Actually, it doesn't - at least not to the extent that I thought you meant there was something special about that .txt file that caused Firefox to format it into html for GM. I did a quick test, and uploaded a no-frills ascii test file in .txt format to a web-accessible site. When I browse to it, it still runs linkify_ting and the Rapidshare links checker script still linkifies it. So it appears that any .txt file will be processed by GM scripts and it's just a matter of fixing the parsing to get the links linkified. edit: It turns out that the Rapidshare links checker script copied an older version of the linkify_ting script. That earlier version left the 'pre' tag in the processing, and apparently, Firefox wraps the text in the pre tag, causing it to linkify. Just removing 'pre' from the ikkeTilladteTags list will cause it to process .txt files, although it looks like that will have other unintended effects (which I'm too much of a beginner to figure out.) |
![]() ![]() |
Orthogonally... wrote:I'll allow pre if the url ends in a txt. I also have to rename the variables to English, because the original script was in some foreign language. Please update and try. It has problems with the email ones but it's not supposed to do those anyways. I'll fix that later. |
![]() ![]() |
I'll allow pre if the url ends in a txt. I also have to rename the variables to English, because the original script was in some foreign language. I've been modifying the original linkify_ting for my own use, adjusting the regex whenever it failed to match something I wanted it to match. I started to do the language change (I think it's Danish, and I was using Google to autotranslate some comments), but never got very far. I just switched to your version, and it seems to work well, so thanks! BTW, what is the problem with removing 'pre' entirely? |
![]() ![]() |
Orthogonally... wrote:It linkifies code blocks and sometimes it messes up code. |
![]() ![]() |
Please update and try. It has problems with the email ones but it's not supposed to do those anyways. I've updated and I like it a lot. I've tried some of my problem addresses and it handles them fine. You may want to look at: http://yellow5.us/firefox/testcases.txt as it doesn't handle them all perfectly. That doesn't bother me as I seldom run into the ones it isn't handling well. Moreover, I'm very aware of the linkification running background so I tend to look at the linkified address in the preview before clicking (which is why linkification of emails never really bugged me). Thanks for maintaining this useful script. |
![]() ![]() |
Updated. It gets all website links; not the ones that have the login @ on them but I'll get to that later, I don't anyone's going to be needing linkification of that anyways. |
![]() ![]() |
It works great for all my needs. Thanks! |


