mirror of https://github.com/gorhill/uBlock.git
minor code review
This commit is contained in:
parent
6ea3338f26
commit
980125b8af
|
@ -375,11 +375,8 @@ vAPI.tabs.open = function(details) {
|
||||||
// "Note that fragment identifiers are not matched."
|
// "Note that fragment identifiers are not matched."
|
||||||
// It's a lie, fragment identifiers ARE matched. So we need to remove the
|
// It's a lie, fragment identifiers ARE matched. So we need to remove the
|
||||||
// fragment.
|
// fragment.
|
||||||
var targetURLWithoutHash = targetURL;
|
|
||||||
var pos = targetURL.indexOf('#');
|
var pos = targetURL.indexOf('#');
|
||||||
if ( pos !== -1 ) {
|
var targetURLWithoutHash = pos === -1 ? targetURL : targetURL.slice(0, pos);
|
||||||
targetURLWithoutHash = targetURL.slice(0, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
chrome.tabs.query({ url: targetURLWithoutHash }, function(tabs) {
|
chrome.tabs.query({ url: targetURLWithoutHash }, function(tabs) {
|
||||||
var tab = tabs[0];
|
var tab = tabs[0];
|
||||||
|
|
|
@ -470,8 +470,9 @@ var uBlockCollapser = (function() {
|
||||||
if ( shadow !== null && shadow.className === sessionId ) {
|
if ( shadow !== null && shadow.className === sessionId ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// https://github.com/w3c/webcomponents/issues/102
|
// https://github.com/gorhill/uBlock/pull/555
|
||||||
// not all nodes can be shadowed
|
// Not all nodes can be shadowed:
|
||||||
|
// https://github.com/w3c/webcomponents/issues/102
|
||||||
try {
|
try {
|
||||||
shadow = elem.createShadowRoot();
|
shadow = elem.createShadowRoot();
|
||||||
shadow.className = sessionId;
|
shadow.className = sessionId;
|
||||||
|
|
|
@ -181,8 +181,9 @@ var hideElements = function(selectors) {
|
||||||
if ( shadow !== null && shadow.className === sessionId ) {
|
if ( shadow !== null && shadow.className === sessionId ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// https://github.com/w3c/webcomponents/issues/102
|
// https://github.com/gorhill/uBlock/pull/555
|
||||||
// not all nodes can be shadowed
|
// Not all nodes can be shadowed:
|
||||||
|
// https://github.com/w3c/webcomponents/issues/102
|
||||||
try {
|
try {
|
||||||
shadow = elem.createShadowRoot();
|
shadow = elem.createShadowRoot();
|
||||||
shadow.className = sessionId;
|
shadow.className = sessionId;
|
||||||
|
|
Loading…
Reference in New Issue