Extension generated data URI cannot run inline javascript

RESOLVED DUPLICATE of bug 1324406

Status

RESOLVED DUPLICATE of bug 1324406
a year ago
5 months ago

People

(Reporter: danny0838, Unassigned)

Tracking

53 Branch

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

a year ago
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:53.0) Gecko/20100101 Firefox/53.0
Build ID: 20170518000419

Steps to reproduce:

Run the below code in an extension page (e.g. options.html):

function stringToDataURI(str, mime, charset) {
  return 'data:' + mime + (charset ? ';charset=' + charset : "") + ',' + encodeURIComponent(str);
}

var content = '<script>alert("Hello world");</script>';
var url = stringToDataURI(content, "text/html", "UTF-8");
window.open(url);


Actual results:

The alert does not run.


Expected results:

The alert inside the data URI should run.
(Reporter)

Updated

a year ago
Component: Untriaged → WebExtensions: General
Product: Firefox → Toolkit
Status: UNCONFIRMED → RESOLVED
Last Resolved: a year ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1324406

Updated

5 months ago
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.