직접 링크 적용되지 않습니다 https://github.com/MosheBerman/MinimalOverflow/blob/master/styleswitcher.user.js크롬 userscript 스크립트 원격 CSS 스타일 시트를
내가 https://stackapps.com/questions/2143/minimaloverflow-a-themescript-for-stack-exchange에서 스크립트를 다운로드하여 드래그 앤 * .user.js가 크롬에서 내 확장 탭에 파일을 떨어졌다. 스크립트가 실행되고 alert
을 사용하여 확인했습니다. 심지어 스크립트에서 alert
href
속성을 편집하여 올바르게 변경했는지 확인합니다. no styling applied http://i39.tinypic.com/23lo321.png
는 본질적으로 코드가 link
태그 외모와 href
속성을 변경합니다 스크립트가 CSS를 변경할 때마다
그러나, 적용된 스타일은 없다.
라인 (64)
function switchToStylesheet(sheet){
for(var i=0; i<linkElements.length; i++){
if(linkElements[i].getAttribute("rel") == "stylesheet"){
//apply the new stylesheet
linkElements[i].href = sheet;
alert(linksElements[i].href);
// shows https://github.com/MosheBerman/MinimalOverflow/raw/master/clean.css as expected
//We only want to replace the first stylesheet, so return.
//If SO decides to change any styles, just put it in a
//second stylesheet and link tag. The script should safely ignore it.
return;
}
}
}
내가 Version 25.0.1364.152
이 내가 Windows 7 64-bit
이 사람이이 Chrome
, Javascript
, 또는 Userscript
문제가 있는지 확인 할 수 실행하는거야?
이 당신이 원하는 것이 아니라 다른 방법으로 당신은 시도 할 수 있습니다 : 세련된 https://chrome.google.com/webstore/detail/stylish/fjnbnpbmkenffdnngjfgmeleoegfcffe를 (플러그인은 _ 다른 브라우저에서도 사용할 수 있습니다 _). stackoverfllow 스타일 검색 (http://userstyles.org/styles/browse/stackoverflow)은 비슷한 스타일을 찾지 못했지만 웹 사이트의 요소를 검사하여 자신의 CSS로 덮어 쓰는 것이 매우 쉽습니다. 세련된 ... – Joonas