Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Add extension inspect views #10163

Merged
merged 1 commit into from
Aug 31, 2017
Merged

Add extension inspect views #10163

merged 1 commit into from
Aug 31, 2017

Conversation

evq
Copy link
Member

@evq evq commented Jul 27, 2017

Fixes #8012

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.

Test Plan:

Reviewer Checklist:

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

chrome.tabs.query(
{currentWindow: true, active: true},
function (tabArray) {
chrome.ipcRenderer.send('load-url-requested', tabArray[0].id, 'chrome-extension://' + extensionId + '/_generated_background_page.html')
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure why this ipc message even exists, but please use appActions.loadURLRequested instead. Sending ipc messages directly is deprecated. However, I don't think this will work correctly in either case because it will create a new background page instead of opening the existing one

Copy link
Collaborator

@bridiver bridiver left a comment

Choose a reason for hiding this comment

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

see comments

@@ -20,3 +20,22 @@ html, body, #appContainer, #appContainer > div {
body {
font-size: 100%;
}

.linkText {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please use Aphrodite, so move this css into js file. More info here: https://github.com/brave/browser-laptop/wiki/Refactoring-styles-to-Aphrodite. Thank you 😃

Copy link
Contributor

Choose a reason for hiding this comment

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

@evq ping me if you want me to do

@evq evq changed the title Add extension inspect views (_generated_background_page.html only) Add extension inspect views Jul 29, 2017
@evq
Copy link
Member Author

evq commented Jul 29, 2017

@bridiver @NejcZdovc I uploaded a second commit which should address both of your comments :)

color: globalStyles.color.braveOrange,
cursor: 'pointer',
margin: '0',
':hover': {
Copy link
Contributor

Choose a reason for hiding this comment

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

@evq could you add a blank line between margin and :hover?

Copy link
Contributor

@NejcZdovc NejcZdovc left a comment

Choose a reason for hiding this comment

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

@evq Please squash commits and add auto closing tag to the new commit, other than that it looks good to me. Also please provide test plan for it

}
},

linkTextSmall: {
Copy link
Contributor

Choose a reason for hiding this comment

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

@evq would you please change linkTextSmall into linkText_small based on our guideline, which is available here? https://github.com/brave/browser-laptop/blob/master/docs/style.md#defining-our-blocks-elements-and-modifiers thanks!

@NejcZdovc
Copy link
Contributor

@evq if I click on Torrent Viewer there is no dev tools opened, I just get normal blank tab with this url chrome-extension://fmdpfempfmekjkcfdehndghogpnpjeno/_generated_background_page.html. Is this correct?

@evq
Copy link
Member Author

evq commented Jul 30, 2017

@NejcZdovc Weird, thanks for testing! I don't seem to be able to get the dev tools to open by manually typing the url for the torrent viewer extension either. It doesn't seem like the manifest specifies a background page, so I would expect _generated_background_page.html to work. I will have to dig deeper.

@@ -607,15 +607,15 @@ class SecurityTab extends ImmutableComponent {
</SettingItem>
{
getSetting(settings.ACTIVE_PASSWORD_MANAGER, this.props.settings) === passwordManagers.BUILT_IN
? <label className='linkTextSmall' data-l10n-id='managePasswords'
? <label className={css(commonStyles.linkText, commonStyles.linkTextSmall)} data-l10n-id='managePasswords'
Copy link
Contributor

Choose a reason for hiding this comment

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

@evq please update this as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

oops! same issue in js/about/extensions.js as well

onClick={aboutActions.createTabRequested.bind(null, {
url: 'about:passwords'
})} />
: null
}
{
getSetting(settings.ACTIVE_PASSWORD_MANAGER, this.props.settings) === passwordManagers.LAST_PASS
? <label className='linkTextSmall' data-l10n-id='preferences'
? <label className={css(commonStyles.linkText, commonStyles.linkTextSmall)} data-l10n-id='preferences'
Copy link
Contributor

Choose a reason for hiding this comment

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

@evq ditto.

@evq
Copy link
Member Author

evq commented Jul 30, 2017

@NejcZdovc I have made changes such that the inspect views are not shown if the extension is disabled or does not specify background scripts or pages (this was the case for torrent viewer).

All comments should be addressed at this point.

@codecov-io
Copy link

codecov-io commented Jul 31, 2017

Codecov Report

Merging #10163 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master   #10163      +/-   ##
==========================================
+ Coverage   53.67%   53.67%   +<.01%     
==========================================
  Files         238      238              
  Lines       21049    21053       +4     
  Branches     3256     3256              
==========================================
+ Hits        11297    11301       +4     
  Misses       9752     9752
Flag Coverage Δ
#unittest 53.67% <100%> (ø) ⬆️
Impacted Files Coverage Δ
app/renderer/components/styles/commonStyles.js 100% <ø> (ø) ⬆️
js/about/preferences.js 42.91% <ø> (ø) ⬆️
.../components/preferences/payment/disabledContent.js 100% <100%> (ø) ⬆️
app/renderer/components/preferences/pluginsTab.js 49.01% <100%> (+3.18%) ⬆️

Copy link
Contributor

@luixxiul luixxiul left a comment

Choose a reason for hiding this comment

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

The test plan works.

@luixxiul luixxiul added this to the 0.21.x (Nightly Channel) milestone Jul 31, 2017
Fixes #8012

Auditors: @luixxiul

Test Plan:

Ensure extension links work when presented and are not present for
disabled / invalid:
1. Go to `about:extensions`
2. Click on the pdf viewer inspect view and confirm dev tools are launched
3. In another tab go to `about:preferences#extensions` and enable 1password
4. Click on the 1password inspect view and confirm dev tools are launched
5. In another tab go to `about:preferences#extensions` and enable bitwarden
6. Confirm the dev tools pane for 1password has closed
7. Confirm that `about:extensions` no longer shows inspect views for 1password
8. Click on the bitwarden inspect view and confirm dev tools are launched
9. Confirm that `about:extensions` has no inspect views for torrent viewer

Ensure the following appear as orange anchor links:
1. Payment FAQ on `about:preferences#payment`
2. Adobe and wiki `about:preferences#plugins`
3. Release notes and revision on `about:brave`
4. Inspect pages on `about:extensions`
5. Manage passwords on `about:preferences#security`
@luixxiul
Copy link
Contributor

luixxiul commented Aug 10, 2017

@bridiver would you please review the change again and make sure your comments were addressed? thanks!

@bsclifton
Copy link
Member

@bridiver can you please review (per the feedback above). Thanks! 😄

Copy link
Collaborator

@bridiver bridiver left a comment

Choose a reason for hiding this comment

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

++

@luixxiul luixxiul merged commit a2d9ecb into master Aug 31, 2017
@bsclifton bsclifton deleted the inspect_views branch September 4, 2017 07:12
@bbondy bbondy modified the milestones: 0.21.x (Developer Channel), 0.20.x (Beta Channel) Oct 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants