How do you disable a CSS include on a custom UI Page

David Sprowls
Tera Contributor

I have a custom UI page I have created and I have my own CSS I want to use for his page but this css... <link type="text/css" href="/styles/css_includes.cssx?v=06-17-2014_1527&amp;c=04-24-2013_15:52:34_19330a326856e5006b96a676065a03..." rel="stylesheet"></link>

 

Is loading in my page automatically. Is there somewhere I can disable this from loading at all into my custom UI page only?

1 ACCEPTED SOLUTION
11 REPLIES 11

uluerje
Mega Expert

Just replace the example below with the sys_id of your stylesheet and include it in your UI page



<link href="afb993f26fdf1100ec7ba981be3ee4a9.cssdbx?" rel="stylesheet" type="text/css"/>


justin_drysdale
Mega Guru

I haven't tested this, but by just eyeballing it you could try the following DOM methods:




//Old Browsers:


var remove_me_href = '/styles/css_includes.cssx?v=06-17-2014_1527'


                          + '&amp;c=04-24-2013_15:52:34_19330a326856e5006b96a676065a03d3'


                          + '&amp;theme=',


var i=0,


var link_tags = document.getElementsByTagName("link"),


var len = link_tags.length;


for(i; i!=len; i+=1) {


  var link_href = link_tags[i].getAttribute('href');


  if(link_href == remove_me_href) {


        //clear element:


        link_tags[i].innerHTML = '';


  }


}



//Modern Browsers:


var remove_me_href = '/styles/css_includes.cssx?v=06-17-2014_1527'


                          + '&amp;c=04-24-2013_15:52:34_19330a326856e5006b96a676065a03d3'


                          + '&amp;theme=';


var css_to_remove = document.querySelector("link[href=" + remove_me_href + "]");


      //clear element


      css_to_remove.innerHTML = '';


      //or remove element:


      //css_to_remove.parentNode.removeChild(css_to_remove);


ralvarez
Tera Guru

In case is not too late and still can help anyone, the solution is to use '?sysparm_direct=true' in the url after the .do


dexter
Kilo Contributor

I am having the same problem as David Sprowls descibes.


Service Now Add their own css to 'my' UI page.



So if I use the class ".container" it inherits properties from service now I don't want.


Using '?sysparm_direct=true' doesn't solve the problem for me.


The SN css is still being loaded.


Yes we could remove the css from the DOM with javascript but I want SN not to load their css in the first place since I don't need it and it even gives interference ...



Thanks in advance!