-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move the vomnibar to an iframe #1139
Conversation
287b6ca
to
6d58cba
Compare
5604da8
to
de016dc
Compare
@@ -53,5 +54,12 @@ | |||
|
|||
<div id="output-div"></div> | |||
|
|||
<div id="vomnibar" class="vimiumReset"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need to be here now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't work out how to run the tests in the vomnibar iframe, so I injected the iframe script directly into the page and use this in place of the iframe's dom.
It's a hack, any idea how best to fix it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be helpful to add a comment in this regard, so we know in the future why it's here.
Cool change. In terms of weight, I don't like the extra iframe machinery, but I do like that this decouples the vomnibar resources (css and some of the js) into other files outside of the content script and main vimium css file. |
7752cf7
to
4ed778d
Compare
@philc I've added some comments to the code, as per your suggestions, and will look into tidying up the tests. |
Hey @mrmr1993, I'm just about ready to merge this in. Two requests:
|
Use the `openUrlInCurrentTab` message to open bookmarklets so they are opened via `chrome.tabs.update` instead of an injected script element. This allows bookmarklets to open popups.
4ed778d
to
a005b6a
Compare
Hi @philc, I've tried to address your comments:
|
@mrmr1993: Is the problem with clicking below the vomnibar because the iframe is bigger than its contents? If so, might we dynamically adjust the iframe's height: |
@smblott-github originally it was adjusted dynamically, but I just changed it to be
Before it was set by passing a message via the background page, which was causing the lag. I'll look into accessing |
No joy; going both ways we get
The options we are left with then are:
Since I can think of no good reason why the user would want to be clicking around on the underlying page while the vomnibar is open, my instinct is to go with 2, but I'm open to discussion. |
OK. Thanks for looking into it. |
a005b6a
to
d65f265
Compare
Hi @mrmr1993. Unfortunately, this doesn't fix #1210. Vomnibar scripts are still executed in the security context of the host page. The issue is to do with the mechanism by which our scripts are injected into the page. See here for details. And that may be why you're seeing:
If the vomnibar page were restructured such that FYI: I migrated your PR here to |
This PR
hasChromePrefix
, where any string starting with"about"
,"view-source"
,"chrome-extension"
or"data"
would be passed to the tab opening functions without being converted to a search URL.