Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Should avoid the all-hosts permission #4

Open
jyasskin opened this issue May 21, 2014 · 6 comments
Open

Should avoid the all-hosts permission #4

jyasskin opened this issue May 21, 2014 · 6 comments

Comments

@jyasskin
Copy link

This extension should use the activeTab permission with a browser action instead of a content script that runs on all origins. That'll both speed up browsing when we aren't trying to use the extension and increase the extension's security by not running it on sensitive pages without an explicit request.

@zenorocha
Copy link
Member

Browser actions are supposed to execute after the user hits the button and that's not what we want here. The reason why this is a Chrome Extension and not a Bookmarklet is the ability to run some code in order to detect custom elements in every page you visit.

screen shot 2014-05-20 at 10 26 09 pm

Page actions with content scripts is exactly what we need because it acts in the page scope and is able to read/edit the DOM.

@zenorocha
Copy link
Member

If you're worried about security or browsing speed I recommend you to use @ebidel's bookmarklet. Although I'm pretty sure you'll end up forgetting that it exists and will not notice when navigating on websites that contains custom elements.

@zenorocha
Copy link
Member

I guess what we could do to improve the browsing speed is store the hasElements variable in Session Storage. Or use document_idle for run_at attribute.

What do you think?

@ebidel
Copy link

ebidel commented May 21, 2014

I do think a browser action might be better. They can inject content into the page too. Instead of having this run on all pages :(, it seems better for developers to explicitly click a button to discover what's on the page.

@lrsjng
Copy link

lrsjng commented Jul 5, 2014

@jyasskin @zenorocha @ebidel Hi, since my patch might be a bit too match for a patch as it actually rewrites the background.js and content.js, I uploaded some code to a new repo.

This uploaded code differs from the patch. It actually uses a browser action instead of a page action as @jyasskin and @ebidel proposed. I think it's a cleaner solution.

I can't provide you with a link to the Chrome Web Store (don't have a credit card) but if you wan't you can check and test the code from the repo. Any feedback would be very appreciated!

@lrsjng
Copy link

lrsjng commented Jul 5, 2014

@jyasskin @zenorocha @ebidel and I hope you don't mind that I included your icon there. If that is any problem I will remove it asap..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants