Skip to content

feat: [extensions] implement a couple of tabs APIs#21779

Merged
nornagon merged 10 commits intomasterfrom
extensions-executescript
Jan 15, 2020
Merged

feat: [extensions] implement a couple of tabs APIs#21779
nornagon merged 10 commits intomasterfrom
extensions-executescript

Conversation

@nornagon
Copy link
Copy Markdown
Contributor

@nornagon nornagon commented Jan 15, 2020

Description of Change

This (sort of) implements chrome.tabs.executeScript. It only works with non-negative tab IDs (i.e. the default of "active tab" will throw a validation error), and it makes no special effort to prevent extensions from accessing "tabs" they haven't requested permission to (though there does seem to be at least some protections in place in the code I've added, mostly copied from Chrome. I'm not sure if those are watertight though.)

Also implements chrome.tabs.sendMessage, which the Ember DevTools extension depends on.

This is enough to get the React and Ember DevTools extensions working when enable_electron_extensions = true.

Ref #19447

Checklist

Release Notes

Notes: none

@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Jan 15, 2020
@nornagon nornagon changed the title feat: [extensions] implement tabs.executeScript feat: [extensions] implement a couple of tabs APIs Jan 15, 2020
Copy link
Copy Markdown
Member

@samuelmaddock samuelmaddock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! 👍

IDR_IME_SERVICE_MOJOM_JS);
source_map->RegisterSource("chromeos.ime.service",
IDR_IME_SERVICE_BINDINGS_JS);
#endif // defined(OS_CHROMEOS)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could remove this section since it's related to Chrome OS

Copy link
Copy Markdown
Contributor

@zcbenz zcbenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Copy link
Copy Markdown
Member

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM assuming lint issues are addressed.

@nornagon
Copy link
Copy Markdown
Contributor Author

win32 failure unrelated

@nornagon nornagon merged commit b9eb68c into master Jan 15, 2020
@release-clerk
Copy link
Copy Markdown

release-clerk bot commented Jan 15, 2020

No Release Notes

@nornagon nornagon deleted the extensions-executescript branch January 15, 2020 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-pr 🌱 PR opened recently

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants