Closed eiland-asbl closed 8 years ago
Hi @wikimas.
Regarding how to package the code, use JPM (I used CFX originally, but that's been deprecated in favor of JPM). If you'd like your improvements to make into the official add-on, I'd be happy to see them as a PR. Using JPM will let you package the modified add-on in an installable format, though.
Regarding URL expansion: the full URL is stored by Twitter in various data attributes on the link elements themselves. The name of the attribute varies across their different properties, but it's almost always there. The only exception I've found so far (not having looked very far) is the cards that are embedded in tweets (news stories, etc.). Absent that, the only way to resolve the URL would be to send a HEAD
request and read the redirect URL from the location
response header, which could easily overwhelm a page.
Thanks for that, now I managed.
I hadn't noticed those url attributes, great clean solution for your add-on. I do see "data-expanded-url" in embeded urls, but then the plugin needs to be enabled for all domains, not only for *.twitter.com. Would there be the downside to that? I'm thinking of an add-on which would resolve any kind of (tracked) shortlink which redirects with a 302 header, but I see you don't think that would be a good idea. Maybe only the ones in the viewframe?
Im trying to alter your code, but cant see how to get it in a valid xpi? Also, how does the url expanding in function clean() work? where do you get the full url from?