tksugimoto / chrome-extension_open-local-file-link

ローカルファイルへのリンク(file://~)を開けるようにするChrome拡張
https://chrome.google.com/webstore/detail/nikfmfgobenbhmocjaaboihbeocackld
MIT License
96 stars 38 forks source link

Target property #5

Open vlesieur opened 7 years ago

vlesieur commented 7 years ago

Hi, it's again me. Target property is not taken into account. I try all theses links and they all act like "_blank" target property.

<!doctype html>
<head>
</head>
<html>
    <body>
        <ul>
            <li><a href="file://C:/Temp" target="_blank">_blank</a>
            <li><a href="file://C:/Temp" target="_self">_self</a>
            <li><a href="file://C:/Temp" target="_parent">_parent</a>
            <li><a href="file://C:/Temp" target="_top">_top</a>
            <li><a href="file://C:/Temp" target="framename">framename</a>
        </ul>
        <iframe id="framename" name="framename">
        </iframe>
    </body>
</html>

The last kind of target should load the directory view into the frame, as in IE :

image

But it is load in a new tab in Chrome with this extension, not in the frame :

image

The same thing happen when I create another page which is a frame of the first one and when i use _self target value.

tksugimoto commented 7 years ago

Target property is not taken into account. I try all theses links and they all act like "_blank" target property.

Yes, now this extension is made that way.

target="framename" But it is load in a new tab in Chrome with this extension, not in the frame

Chrome does not allow local files to be displayed as frames in http pages for security reasons. Even if you use Chrome extensions, it seems to be impossible to display them in frame.

vlesieur commented 7 years ago

I am trying to find a solution.

For the _TOP target value, we can use this : chrome.tabs.update(baseTab.id, {url: localFileUrl});

For other target values based on frame, I do not find any solution.

Chrome does not allow local files to be displayed as frames in http pages for security reasons. Even if you use Chrome extensions, it seems to be impossible to display them in frame.

After a lot of tests, I have to agree with you ! Maybe there is a trick but I do not find it.