- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
} else if(hostname.indexOf('.google.')>-1){
/* Google */
if(hostname.startsWith('docs.google.') || hostname.startsWith('drive.google.')){
document.addEventListener('DOMContentLoaded', function() {
var target = document.querySelector('#drive_main_page [aria-live="assertive"]');
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if(mutation.type == 'childList' &&
mutation.addedNodes.length == 1 &&
mutation.addedNodes[0].innerHTML.match(/\/\/support.google.com\/drive\/\?p=system_requirements"/)){
mutation.target.innerHTML = '';
observer.disconnect();
}
});
});
console.log('Google, please make sure your obfuscator does not change class names, so our patch continues working (or stop browser-sniffing as we both use and contribute to Blink!) - love, Opera.');
observer.observe(target, {childList: true, subtree:true});
}, false)
log('PATCH-1191, Still an "unsupported browser" according to Google');
}
if(hostname.startsWith('mail.google.')){
addCssToDocument2('div.n6 {display: block !important} table.cf.hX{display:inline-table}');//"more", labels
log('PATCH-1163, No "More" button in Gmail and misaligned labels');
}
if(hostname.startsWith('translate.google.')){
document.addEventListener('DOMContentLoaded',
function(){
var obj = '<object type="application/x-shockwave-flash" data="//ssl.gstatic.com/translate/sound_player2.swf" width="18" height="18" id="tts"><param value="//ssl.gstatic.com/translate/sound_player2.swf" name="movie"><param value="sound_name_cb=_TTSSoundFile" name="flashvars"><param value="transparent" name="wmode"><param value="always" name="allowScriptAccess"></object>';
var aud = document.getElementById('tts');
if(aud && aud instanceof HTMLAudioElement && aud.parentNode.childNodes.length == 1){
aud.parentNode.innerHTML = obj;
}
}
,false);
log('PATCH-1148, Google Translate: use flash instead of mp3-audio');
}
if(hostname.startsWith('www.google.') || hostname.startsWith('google.')){
addCssToDocument2('#prt {visibility:hidden}')
log('PATCH-1197, Hide Chrome ad from main Google page');
}
if(pathname.indexOf('hangouts')==-1){
var _newUA = navigator.userAgent.replace(/ ?OPR.[0-9.]*/, '');
Object.defineProperty(window.navigator, "userAgent", {
get: function() {return _newUA}
});
log('PATCH-1176, Navigation keys are not working on Google - hide Opera tag from userAgent for all sites except hangouts');
}
} else if(hostname.indexOf('.youtube.com')>-1){
addCssToDocument2('#movie_player { z-index: 100 !important; }');
log('PATCH-1185, youtube.com - show video above playlist');
}
Кажется, кто-то продолжает есть меня, несмотря на колючки. Кто угадает, откуда этот код, тому ничего.
kaktus 16.05.2015 01:29 # 0
bormand 16.05.2015 09:08 # 0
kegdan 16.05.2015 10:22 # 0
Прорвемся - ответит опера!
kaktus 16.05.2015 11:39 # +1