Skip to content
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

Support content blocking #11413

Merged
merged 4 commits into from May 30, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Handle origin when blocking content

  • Loading branch information
nox committed May 30, 2016
commit a09773e819d5c5529e27502c808afb6ee3da6586
@@ -862,10 +862,15 @@ pub fn load<A, B>(load_data: &LoadData,

let mut block_cookies = false;
if let Some(ref rules) = *http_state.blocked_content {
let same_origin =
load_data.referrer_url.as_ref()
.map(|url| url.origin() == doc_url.origin())
.unwrap_or(false);
let load_type = if same_origin { LoadType::FirstParty } else { LoadType::ThirdParty };
let actions = process_rules_for_request(rules, &CBRequest {
url: &doc_url,
resource_type: to_resource_type(&load_data.context),
load_type: LoadType::FirstParty, //FIXME need request origin
load_type: load_type,
});
for action in actions {
match action {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.