I'm making an Unofficial Tek Syndicate Forum Chrome Extension!

Any chance of developing a firefox addon in the future once the chrome extension is working correctly?

One solution is the video name on youtube is always* the url for the page on the website. You could use that as a fallback if it's not in the description.

I THINK youtube is using popstate. if so, then:

window.onpopstate = function (event) {

}

1 Like

Yep, the first stable version of the Chrome extension will be ported to Firefox provided I have enough time. If for whatever reason I can't, the source code is on GitHub for others to port.

1 Like

Implementing a fallback is definitely a must, so that's something I'm going to be looking into soon. Popstate isn't something I'm aware of, so I'm off to investigate that, cheers!

Figuring out the users location can be done by the timezone information in the browser in a lot of cases.

<script language="javascript">
    function getTimezoneName() {
        timezone = jstz.determine()
        return timezone.name();
    }
</script>
1 Like

Maybe, maybe not. I don't want to include any additional libraries besides jQuery right now though.

In my testing I found popstate only fired when either back/forward were used, I'm testing other window events now.

EDIT: After some testing, window.ontransitionend seems to be a good event to fire on.

Popstate is part of the HTML5 navigation api, so something in there should definitely grab it. I've personally never used it, just hash change. I was just playing around with some code and you should be able to run an ajax request to grab the comments and then inject the response vs opening a new tab, etc. Granted I did that real quick while on a conference call, so there maybe some cross domain/https issues, but running it locally worked fine for me.

EDIT: Oh nice. Glad you found a listener.

I've been working on this extension for a few more hours today. The extension is now actually compatible with the way YouTube navigates, meaning the extension actually works now. Also I rewrote the way most JavaScript is injected to be a bit more elegant.

I've also been spending a lot of time experimenting, trying to get the forum comments without opening another window, here are my findings for anybody interested:

teksyndicate.com/video/.. has an iframe in it that's created by a Javascript file (https://forum.teksyndicate.com/javascripts/embed.js). This iframe contains the comments for the video, BUT its origin needs to be teksyndicate.com or it won't display anything. The only way to get the contents of the iframe is to have an origin of teksyndicate.com. The only way (as far as I know) to have the origin of teksyndicate.com is to actually open the page and inject some Javascript there, which requires opening a Chrome window in the background.

If anybody has any ideas on how (with the Chrome extension API) I can open an invisible window, or otherwise get around the cross-origin rules, this extension would be a lot more user friendly.