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

Per-origin noScript #21

Merged
merged 9 commits into from
May 23, 2018
Merged

Per-origin noScript #21

merged 9 commits into from
May 23, 2018

Conversation

yrliou
Copy link
Member

@yrliou yrliou commented May 2, 2018

shields

Fix brave/brave-browser/issues/6
Add a NoScript component which supports users to allow scripts from a set of origins until navigating away.
See also: brave/brave-core/pull/97

@yrliou yrliou self-assigned this May 2, 2018
@yrliou yrliou changed the title [WIP] Per origin no script [WIP] Per-origin noScript May 2, 2018
@yrliou yrliou force-pushed the per_origin_no_script branch 2 times, most recently from 41bc7d8 to 14fee84 Compare May 4, 2018 23:43
@yrliou yrliou changed the title [WIP] Per-origin noScript Per-origin noScript May 4, 2018
@yrliou yrliou requested a review from bbondy May 8, 2018 21:22
newAllowOrigins = [...this.state.allowOrigins, origin]
}

this.setState({ allowOrigins : newAllowOrigins })
Copy link
Member

Choose a reason for hiding this comment

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

We should dispatch something here that is handled in a reducer like onChangedOrigin(origin).

}

render () {
const originSwitches = this.props.blockedOrigins.map((origin) => (
Copy link
Member

Choose a reason for hiding this comment

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

We should display both allowed origins and blocked origins. I noticed on brianbondy.com after I allow brianbondy.com it no longer shows in the list on the next reload.

Example after allowing brianbondy.com, it leaves with options not so great for the next load. Also doesn't give me a full picture of what will happen on the next load.

screen shot 2018-05-11 at 10 30 55 am

</Column>
{originSwitches}
<Column align='flex-end'>
<BrowserButton id='apply' size='10px' onClick={this.onClick}> {getMessage('noScriptApplyOnce')} </BrowserButton>
Copy link
Member

Choose a reason for hiding this comment

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

consider splitting out padding and size and other formatting only to not be inline

"shieldsHeaderForSite": {
"message": "Site shield settings for",
"description": "Label for shields header near current site name"
},
"noScriptApplyOnce": {
"message": "Apply Once",
Copy link
Member

Choose a reason for hiding this comment

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

We could perhaps just call this Apply since there's only 1 option we're prioritizing for now. You can keep internal naming as is for now.

@yrliou yrliou force-pushed the per_origin_no_script branch 3 times, most recently from de6a9b4 to ecf932c Compare May 16, 2018 19:35
@yrliou
Copy link
Member Author

yrliou commented May 19, 2018

@bbondy PR is updated to address review comments, please take a look again when you're available, thanks!

<Column key={origin}>
<SwitchButton
id={origin}
checked={this.props.noScriptInfo[origin].willBlocked}
Copy link
Member

Choose a reason for hiding this comment

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

s/willBlocked/willBlock/g ?

@yrliou yrliou merged commit 2751cf4 into master May 23, 2018
@cezaraugusto cezaraugusto deleted the per_origin_no_script branch June 26, 2018 16:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants