5

The code I'm trying to use is

data:text/html,
<body contenteditable style="font: 2rem/1.5 monospace;
                             max-width:60rem;
                             margin:0 auto;
                             padding:4rem;">

I found it on a webiste. I'm suppose to just place it on the URL and hit enter but only for Chrome, Firefox and Opera. It won't work on IE. How can I make a notepad on IE?

More info: Im using a work pc and I can't access any website nor programs. No file explorer, right click context menu, only has IE.

Greg
  • 9,068
  • 6
  • 49
  • 91
Pacdizzle
  • 53
  • 1
  • 5
  • 1
    what exactly is that code, and what exactly you want to do? test a website or what? – HKK Jun 07 '14 at 20:45
  • What does Notepad have to do with this? – j08691 Jun 07 '14 at 22:57
  • If you place that code on the address bar on a new tab it turns your tab into a notepad. You can write on the page. It works for Chrome Firefox and Opera but not on Internet Explorer it just gives an error. Im just want to know if there's a way to do this on IE – Pacdizzle Jun 08 '14 at 04:28
  • http://stackoverflow.com/questions/7405345/data-uri-scheme-and-internet-explorer-9-errors `For security reasons, data URIs are restricted to downloaded resources. Data URIs cannot be used for navigation, for scripting, or to populate frame or iframe elements.` – Cheery Oct 06 '14 at 20:10
  • You're missing a close `>` btw. It didn't work until chrome until I added that character to the end – nzifnab Oct 06 '14 at 20:10
  • This answer is a solution I think - http://stackoverflow.com/a/16409572/1366216 – divyenduz Oct 06 '14 at 20:20

2 Answers2

5

You can try using the javascript engine to create a similar execution.


From the URL bar:

javascript:window.document.write('<body contenteditable style="font: 2em/1.5 monospace;max-width:60em;margin:0 auto;padding:4em;">');

If you copy and paste you will need to manually type javascript: in front of it since the browser trims that part of on paste.


If you want to execute a new window as an editor then try this:

<script>
    function myFunction() {
        var myWindow = window.open("", "MyEditorWindow");
        myWindow.document.write("<body contenteditable style=\"font: 2em/1.5 monospace;padding:40px;\">");
}
</script>

Check out this jsFiddle example

Luis
  • 789
  • 9
  • 9
1
  1. Data URIs: Internet Explorer does not support data URIs. Data URIs For security reasons, Data URIs are restricted to downloaded resources. Data URIs cannot be used for navigation, for scripting, or to populate frame or iframe elements.
  2. REM CSS: The CSS3 rem, which is always relative only to the root html element, is too new to rely on. As of July 2012, around 75% of all browsers in use support the rem.

Reference Link:

Conclusion: Please refer to the first link to achieve this as IE not started supporting it.

  • IE doesn't support Data URI tag. Hence you have to use it in javascript or in html tag.
  • IE doesn't support REM CSS3 Attribute rem as a unit. Hence you have to use em or px instead.
Rajesh Ujade
  • 2,715
  • 19
  • 39
  • Im trying to open a data URI in a new tab which is well under 32 KB but it wont render.Im trying to extract a canvas chart as PNG – techie_28 Jul 22 '16 at 06:42
  • You've misinterpreted that link. Internet Explorer **does** support `data:` URIs, but not as places to link to. – Quentin Aug 02 '20 at 16:29
  • @Quentin At the time of answer in 2014, Internet browser doesn't support in 2014. – Rajesh Ujade Aug 27 '20 at 06:11
  • @rajeshujade — Support for `data:` scheme URLs hasn't changed since before that answer. The last version of Internet Explorer was released in 2013. – Quentin Aug 27 '20 at 08:11