Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>On the css way... I tried inserting some css on an allready loaded page and the scrollbars never changed?</p> <pre><code>chrome.tabs.insertCSS(tab.id,{code:"::-webkit-scrollbar {width: 0 !important; height: 0 !important}"}); </code></pre> <p>...even tried attaching it to the head and that didnt work either....</p> <pre><code>insertNoScrollBars=function (){ if(document.getElementById('HideScrollBars') == null){ var headID = document.getElementsByTagName("head")[0]; var cssNode = document.createElement('style'); cssNode.setAttribute('id','HideScrollBars'); cssNode.innerText="::-webkit-scrollbar {width: 0 !important; height: 0 !important}" headID.appendChild(cssNode); } } chrome.tabs.query({'active': true, 'windowId': chrome.windows.WINDOW_ID_CURRENT}, function(tab){ chrome.tabs.executeScript(tab.id,{code:"("+insertNoScrollBars+")()"}); //chrome.tabs.insertCSS(tab.id,{code:"::-webkit-scrollbar {width: 0 !important; height: 0 !important}"}); } ); </code></pre> <p>Looking around it seems the scrollbars wont get updated unless theres some kind of refresh?....<br> <a href="http://userscripts.org/scripts/show/117089" rel="nofollow">http://userscripts.org/scripts/show/117089</a> </p> <p>One thing that did work tho (altho it might not suit your needs) was to inject the css using content script settings in the manifest....<br> <strong>manifest.json</strong></p> <pre><code>{ "name": "Hide scrollbars", "version": "1.0", "description": "As the name says", "permissions": [ "bookmarks", "tabs", "&lt;all_urls&gt;" ], "content_scripts": [ { "matches": ["&lt;all_urls&gt;"], "css": ["mystyles.css"], "run_at" : "document_start" } ] } </code></pre> <p><strong>mystyles.css</strong></p> <pre><code>::-webkit-scrollbar {width: 0 !important; height: 0 !important} </code></pre> <p><strong>Or</strong><br> If the only reason you want to inject it programmaticly is so you only inject it if your settings say to then you could inject it with a content script at document start.....<br> <strong>manifest.json</strong> </p> <pre><code> { "name": "Hide scrollbars", "version": "1.0", "description": "As the name says", "permissions": [ "&lt;all_urls&gt;" ], "content_scripts": [ { "matches": ["&lt;all_urls&gt;"], "js": ["content.js"], "run_at" : "document_start" } ] } </code></pre> <p><strong>content.js</strong></p> <pre><code>// Do a check here to see if your settings say to hide the scrollbars or not if(document.getElementById('HideScrollBars') == null){ var headID = document.documentElement; var cssNode = document.createElement('style'); cssNode.setAttribute('id','HideScrollBars'); cssNode.innerText="::-webkit-scrollbar {width: 0 !important; height: 0 !important}" headID.appendChild(cssNode); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload