Wikipedia --> Infogalactic redirector

Add-ons for Pale Moon and other applications
General discussion, compatibility, contributed extensions, themes, plugins, and more.

Moderators: FranklinDM, Lootyhoof

Lew Rockwell Fan

Wikipedia --> Infogalactic redirector

Unread post by Lew Rockwell Fan » 2018-08-31, 05:57

This transforms Wikipedia links into corresponding Infogalactic links. Infogalactic ( https://infogalactic.com/info/Main_Page ) is a new & still evolving fork of Wikipedia, with different editing policies. On the one hand there is no drive-by editing - you have to have an account, but on the other, I don't think they intend to let the articles become fiefdoms ruled by partisan cliques. Right now it hasn't really begun to diverge from Wikipedia yet.

This could be better. I don't speak xul yet. I just messed around with the model until I got it to work. And there aren't that many models that work in Pale Moon under a linux to choose from. I can imagine lots of features that would be nice - a WP/IG toggle button, a split page mode, a config file that accepted user written regexes so this could be used for other types of redirection . . . but I haven't the foggiest idea how to do these things yet, so if you are waiting for me to do it, it might happen, but don't hold your breath. If you can make it better, please do. If you can use it, help yourself. It works for me. I haven't made an icon for it yet. I may fiddle with a bit more before submitting it officially. I haven't figured out what to do with the hash value fields inside for one thing. Hash the whole thing? Compressed or uncompressed? Then add the values? That can't be right, they'd change. Nor how to sign it. Do we sign things or is that just a Moz thing?

Adapted from:
Smile Redirect Version 0.1.1.1-signed.1-signed
Written by T. Scott Barnes & Funded by Digital Game Museum
found here:
https://addons.mozilla.org/en-US/firefo ... /versions/
Since I can't find anything "otherwise noted" this appears to fall under this statement that appeared at the mozilla page ( https://addons.mozilla.org/en-US/firefo ... src=search ):
"Except where otherwise noted, content on this site is licensed under the Creative Commons Attribution Share-Alike License v3.0 or any later version." https://creativecommons.org/licenses/by-sa/3.0/
tldr version: you can copy and mod, must credit the original author & can't imply he's to blame for what you did with it.
You do not have the required permissions to view the files attached to this post.
Last edited by Lew Rockwell Fan on 2018-08-31, 06:04, edited 1 time in total.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35647
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Wikipedia --> Infogalactic redirector

Unread post by Moonchild » 2018-08-31, 07:07

Well if anything infogalactic's Pale Moon page is completely stale. 27.0? seriously?
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

JustOff

Re: Wikipedia --> Infogalactic redirector

Unread post by JustOff » 2018-08-31, 07:23

I strongly do not recommend using extensions created with the old version of the Add-ons SDK as the basis for creating new ones, since they have a known problem with disabling and uninstalling.

New Tobin Paradigm

Re: Wikipedia --> Infogalactic redirector

Unread post by New Tobin Paradigm » 2018-08-31, 09:05

I strongly recommend against creating new extensions using Jetpack period. The SDK serves two main purposes at this point. DevTools is one. Firefox SDK Extensions is another. There will be no new development with Jetpack and we are gonna try REALLY hard to keep it static and usable but cannot really support it going forward. Keeping Firefox extensions designed for this specific version of jetpack is the prime concern plus DevTools.

Friends don't let friends use jetpack!

Lew Rockwell Fan

Re: Wikipedia --> Infogalactic redirector

Unread post by Lew Rockwell Fan » 2018-08-31, 09:22

OK. Am I being cautioned about things I might do or chastised about things I've already done?

The model is from 2014. The description doesn't say anything about SDK, old or new, or jetpack. FWIW, I installed and uninstalled it half a dozen times getting the details right. No problem for me. I used to use the model in it's unaltered form. It's pointless now because Amazon smiles automatically, but it never gave me any trouble. Maybe I'm just lucky. If I can figure out how to give it an on/off toggle button I'll be happy with it.

Lew Rockwell Fan

Re: Wikipedia --> Infogalactic redirector

Unread post by Lew Rockwell Fan » 2018-09-02, 20:19

That was a perfectly serious (implied) question. Those 2 posts are not at all clear to me. I can't tell whether this falls in the category of dis-recommended techniques or if those are general observations. In the expanded xpi there is a directory:
resources/addon-sdk/
but all it contains is an empty, repeat - empty, subdirectory:
resources/addon-sdk/lib/

That is the only thing I've found that says anything about sdk or jetpack.

Anyway, I expect to have a kludge to make this easy to turn on and off shortly. Doing it the right way with a one-click toggle button will take more time because I'm a rank trial-and-error-amateur, so it will take 3 clicks, but OTH it will be a generalized mechanism that can toggle on/off any extension that doesn't require restarting.

JustOff

Re: Wikipedia --> Infogalactic redirector

Unread post by JustOff » 2018-09-02, 20:59

If there is a file called "harness-options.json" in the root folder of the extension, then it's created using the old version of the Add-ons SDK. And if you see a file "package.json", then it's most probably created using the new version of it. You should avoid to create new extensions based on such samples, especially the old one, for the reasons explained above.

As for a good example for your add-on, you can take a look at this one.

Lew Rockwell Fan

Re: Wikipedia --> Infogalactic redirector

Unread post by Lew Rockwell Fan » 2018-09-02, 21:09

Thank you much, JustOff. This does indeed, fall in the verbotten zone. Since it's working for me, for now, I'll finish my toggler, then study your example.

vannilla
Moon Magic practitioner
Moon Magic practitioner
Posts: 2194
Joined: 2018-05-05, 13:29

Re: Wikipedia --> Infogalactic redirector

Unread post by vannilla » 2018-09-02, 22:36

The whole META-INF folder has no value when developing extensions, it's completely a Mozilla thing.
I never put any kind of manifest and Pale Moon never complained. I also never got any notice from the PM add-ons site team, so I take it that so far I've been following the rules.
If the whole "harness-options.json"/"package.json" happen to be confusing, you can just look at the code to see if you are using the SDK (or Jetpack, or how you want to call it): if your code contains require("sdk/foo") (with "foo" being a generic name), then you are using the SDK (require isn't even a defined function in non-SDK add-ons).
Also, you are not targeting Pale Moon at all. In the install.rdf file, for the <em:id> element use {8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}, not {ec8030f7-c20a-464f-9b0e-13a3a9e97384}.
That said, since the whole thing is just the main.js, using the SDK is actually more complex than a normal overlay extension (or even a non-SDK bootstrap one).
I suggest looking in making it non-SDK as soon as you can, especially since you are learning.