tonistiigi / presentty

45 stars 3 forks source link

chrome extension not working for me on Chrome 71 #1

Open mco-gh opened 5 years ago

mco-gh commented 5 years ago

Hi Tonis,

Love this idea! I'm getting the remote tty to work via clicking on a link and opening a new tab but the Chrome extension does not seem to be working for me. I'm look at page.js and trying to debug it but just wondered if this is still working for you. I'm on Chrome Version 71.0.3578.98 (Official Build) (64-bit).

I've 'load uppacked' the extension, created a shape (rect) in my slides, gave it a hyperlink of '#term=dockerdemo', then go present->click on shape, nothing happens.

Any suggestions?

Thanks, Marc

tonistiigi commented 5 years ago

(Sorry, I don't have notifications set up for this repo so never saw this)

Tried with Chrome 72 and still worked without issues for me. I'd suggest opening up the developer tools while on the present view and see if there are any errors there.

Things to check are that the URL starts with https://docs.google.com/presentation/ and http://127.0.0.1:8080/?demo=dockerdemo works (if you are testing with the dockerdemo example).

mco-gh commented 5 years ago

No prob, I was pretty distracted recently anyway. Thanks for getting back to me, I'll try it again and let you know how it goes.

mco-gh commented 5 years ago

I'm on Chrome 72 as well. http://127.0.0.1:8080/?demo=dockerdemo gives me a 404, but if I s/127.0.0.1/localhost/ I get an interactive shell so I'll try hacking the extension to use the latter for loopback.

mco-gh commented 5 years ago

Even with that fix it still doesn't work. I suspect scanListener() in the extension may be brittle. Btw, I did find a typo: term._skiip_term = true. I'll fix that in a PR once I get this working.

mco-gh commented 5 years ago

Debugging content scripts seems to be a pain. Do you see the output of console.log() in the devtools console view when visiting Google presentations? I don't, which makes it kind of hard to debug this. :(

tonistiigi commented 5 years ago

Yes, I see the "setupListener" debug line. You need to be in the present view for it to show. And in the frame selector there should be "present" and "present >> presentty" options.

mco-gh commented 5 years ago

Weird, I've been using the present view. Assume by frame selector you mean the pull down menu in devtools that's labeled "top" by default. I see present there but not presentty (only password alert; see attached screenshot). It's almost like the extension isn't there, although chrome://extension says it's loaded and active. Also have all levels turned on (so not hiding info's or anything like that).

screen shot 2019-02-19 at 5 54 57 pm
tonistiigi commented 5 years ago

Yes, seems that extension is not loaded. Does the URL start with https://docs.google.com/presentation/ (window.location.href) ? You should actually see the log message every time you open something from https://docs.google.com/presentation/ (eg. even it the document list view).

mco-gh commented 5 years ago

Yes, window.location.href in present mode: "https://docs.google.com/presentation/d/15YM...". I'm loading the unpacked extension right from ~/go/src/github.com/tonistiigi/presentty/chrome_extension. Chrome seems to be happy but it kinda feels like it's not really there.

mco-gh commented 5 years ago

I'm starting to wonder if our corporate overlords have somehow locked down adding private extensions in a non-friendly way. Probably just being paranoid. :)

tonistiigi commented 5 years ago

For reference, here's what I see when opening it from chrome://extensions

screen shot 2019-02-19 at 6 23 05 pm
mco-gh commented 5 years ago

Mine looks exactly like that, except that I have two fields you don't: inspect views (no active views) and id (showing the extension id). I'm starting to suspect that injecting JS by an unofficial extension may be outlawed on my corp laptop but, if true, not sure why it's failing so deceptively. Will keep digging.

mco-gh commented 5 years ago

Confirmed. I won't say more because it's a company policy issue but suffice to say it's not you or your code. Sorry for bothering you with this. I'll find out how to get whitelisted/work around this restriction and let you know when I'm in business.

mco-gh commented 5 years ago

Ok, I found a work around for the policy issue and now the extension loads and gives me the console log as expected. Now my problem is the 127.0.0.1 link gives a 404 and the localhost link is blocked because it's not using https. :) Will keep digging.

mco-gh commented 5 years ago

One answer would be to serve the remote terminal via https, which is desirable anyway, but I wonder why you didn't bump into this.