mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-23 02:42:41 +01:00
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."
|
||||
// It's a lie, fragment identifiers ARE matched. So we need to remove the
|
||||
// fragment.
|
||||
var targetURLWithoutHash = targetURL;
|
||||
var pos = targetURL.indexOf('#');
|
||||
if ( pos !== -1 ) {
|
||||
targetURLWithoutHash = targetURL.slice(0, pos);
|
||||
}
|
||||
var targetURLWithoutHash = pos === -1 ? targetURL : targetURL.slice(0, pos);
|
||||
|
||||
chrome.tabs.query({ url: targetURLWithoutHash }, function(tabs) {
|
||||
var tab = tabs[0];
|
||||
|
@ -470,8 +470,9 @@ var uBlockCollapser = (function() {
|
||||
if ( shadow !== null && shadow.className === sessionId ) {
|
||||
continue;
|
||||
}
|
||||
// https://github.com/w3c/webcomponents/issues/102
|
||||
// not all nodes can be shadowed
|
||||
// https://github.com/gorhill/uBlock/pull/555
|
||||
// Not all nodes can be shadowed:
|
||||
// https://github.com/w3c/webcomponents/issues/102
|
||||
try {
|
||||
shadow = elem.createShadowRoot();
|
||||
shadow.className = sessionId;
|
||||
|
@ -181,8 +181,9 @@ var hideElements = function(selectors) {
|
||||
if ( shadow !== null && shadow.className === sessionId ) {
|
||||
continue;
|
||||
}
|
||||
// https://github.com/w3c/webcomponents/issues/102
|
||||
// not all nodes can be shadowed
|
||||
// https://github.com/gorhill/uBlock/pull/555
|
||||
// Not all nodes can be shadowed:
|
||||
// https://github.com/w3c/webcomponents/issues/102
|
||||
try {
|
||||
shadow = elem.createShadowRoot();
|
||||
shadow.className = sessionId;
|
||||
|
Loading…
Reference in New Issue
Block a user