完善页内页打开功能。

main
PJ568 2 years ago
parent bc2ce96691
commit 23ef4c3692

@ -402,7 +402,4 @@ ins.adsbygoogle[data-ad-status="unfilled"]{
}
#rcb_menu>#rcb_t6{
display: none
}
#rcb_menu>#rcb_t7{
display: none
}

@ -44,11 +44,11 @@
<li id="rcb_t4">&nbsp;前进</li>
<li id="rcb_t5">&nbsp;重载</li>
<li id="rcb_t6">🆕&nbsp;新标签页打开</li>
<li id="rcb_t7">📖&nbsp;在页内页打开</li>
<li style="display:none" id="rcb_t7">📖&nbsp;在页内页打开</li>
</ul>
</body>
</html>
<script src="/lib/js/api.js"></script>
<script src="/js/popup.js"></script>
<script src="/js/contextmenu.js"></script>
<script src="/js/openLink.js"></script>
<script src="/js/openLink.js"></script>
<script src="/js/contextmenu.js"></script>

@ -6,7 +6,8 @@ function RightClickMenu(e) {
rightMenu.style.display = 'block';
if (e.target.closest('a')) {
newTab.style.display = 'block';
if (document.write(location.href)=='https://tools.pj568.eu.org/') {document.querySelector('#rcb_t7').style.display = 'block'}
// if (document.write(location.href)=='https://tools.pj568.eu.org/') {document.querySelector('#rcb_t7').style.display = 'block'}
document.querySelector('#rcb_t7').style.display = 'block';
} else {
newTab.style.display = 'none';
document.querySelector('#rcb_t7').style.display = 'none';
@ -46,6 +47,9 @@ rightMenu.addEventListener('click', function (e) {
window.open(url);
}
break;
case "rcb_t7":
openBtnLink();
break;
default:
console.error(e.target.id);
break;

@ -1,8 +1,19 @@
function openLink() {
var iframe = document.getElementById("myFrame");
var iframeSrc = iframe.getAttribute("src");
var encodedSrc = encodeURIComponent(iframeSrc);
var link = "/incert/?link=" + encodedSrc;
window.location.assign(link)
}
function openLink () {
var iframe = document.getElementById("myFrame");
var iframeSrc = iframe.getAttribute("src");
encode_and_open (iframeSrc)
}
function openBtnLink () {
var a = document.closest ('a');
var aSrc = a.getAttribute ("src");
var encodedaSrc = encodeURIComponent (aSrc);
var url = "/incert/?link=" + encodedaSrc;
document.querySelector('#myFrame').src = url;
document.querySelector('#myFrame').scrollIntoView({ behavior: 'smooth' });
}
function encode_and_open (event) {
var encodedSrc = encodeURIComponent (event);
var link = "/incert/?link=" + encodedSrc;
window.location.assign (link)
}
Loading…
Cancel
Save