You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code above will finally load http://www.qq.com/www.baidu.com/testproto/test.proto
I tried //www.baidu.com/testproto/test.proto and //www.baidu.com/testproto/test.proto, but neither worked.
I belive normalize function shall be rewrite.
path.normalize=functionnormalize(path){// if a path is started with http or https, it should not be normalizeif(path.indexOf('http')===0){returnpath}path=path.replace(/\\/g,"/").replace(/\/{2,}/g,"/");varparts=path.split("/"),absolute=isAbsolute(path),prefix="";if(absolute)prefix=parts.shift()+"/";for(vari=0;i<parts.length;){if(parts[i]===".."){if(i>0&&parts[i-1]!=="..")parts.splice(--i,2);elseif(absolute)parts.splice(i,1);else++i;}elseif(parts[i]===".")parts.splice(i,1);else++i;}returnprefix+parts.join("/");}
The text was updated successfully, but these errors were encountered:
protobuf.js version: 6.8.0
I am trying to load .proto file in browser.
Proto files and html file are stored in different host. However, protobufjs can not load correct path.
For example, my html is
http://www.qq.com/testhtml/index.html
Code above will finally load
http://www.qq.com/www.baidu.com/testproto/test.proto
I tried
//www.baidu.com/testproto/test.proto
and//www.baidu.com/testproto/test.proto
, but neither worked.I belive
normalize
function shall be rewrite.The text was updated successfully, but these errors were encountered: