<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>19492</bug_id>
          
          <creation_ts>2012-10-12 03:05:31 +0000</creation_ts>
          <short_desc>Javascript URI Consumption and Composition</short_desc>
          <delta_ts>2013-11-21 12:59:17 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>URL</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows 3.1</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>13720</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael A. Puls II">shadow2531</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>mike</cc>
          
          <qa_contact>sideshowbarker+urlspec</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>76061</commentid>
    <comment_count>0</comment_count>
    <who name="Michael A. Puls II">shadow2531</who>
    <bug_when>2012-10-12 03:05:31 +0000</bug_when>
    <thetext>Not sure if these will help with your Javascript URI research, but here it is anyway:
 
Create Javascript URIs:
&lt;http://shadow2531.com/js/jsuri.html&gt;
&lt;http://shadow2531.com/js/jsuri.js&gt; (that jsuri.html uses)
 
It does two things to the JS code you type:
 
* Normalizes newlines to \r\n.
 
* UTF-8-percent-encodes the code (using encodeURIComponent() on UTF-8 page).
 
That&apos;s basically how you properly-encode a Javascript URI (for bookmarklet or other use).
 
The percent-encoding is very important as browsers always percent-decode first and if you have %HH is URIs in JS code literal strings for example, they will be damaged when the browser percent-decodes the Javascript URI before it&apos;s executed.
 
&apos;#&apos; isn&apos;t special in Javascript URIs. They&apos;re treated as just &apos;#&apos; by browsers (not necessarily the URI parser though, but the end result).
 
Also, I haven&apos;t messed with these in a long time, but I once played around with creating a JS Javascript URI handling library.
 
&lt;http://shadow2531.com/js/javascript_uri_tools.js&gt;
&lt;http://shadow2531.com/js/javascript_uri_tools.html&gt;
&lt;http://shadow2531.com/js/js_uri_tools.js&gt;
 
getLiteralCodeStringFromURI() in js_uri_tools.js might be of interest from a consumption standpoint. (The URI isn&apos;t parsed with a URI parser to get the JS code for example as a URI parser isn&apos;t needed.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80478</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-12-21 14:23:49 +0000</bug_when>
    <thetext>http://wiki.whatwg.org/wiki/URL_schemes#javascript:_URLs</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96636</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-11-21 12:59:17 +0000</bug_when>
    <thetext>This is HTML&apos;s problem now.

*** This bug has been marked as a duplicate of bug 13720 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>