Chrome 扩展帮助,chrome.storage

问题描述

我需要为 chrome 扩展程序创建一个身份验证系统。我需要知道如何仅在用户第一次打开密钥验证弹出窗口时才显示它,但是如果他第二次打开它,它仍然会向他显示该弹出窗口。所以基本上他只有通过身份验证才能访问扩展。我也需要知道如何将用户提供的输入存储在 chrome 扩展输入字段中并在我的脚本中使用它们。我需要知道的最后一件事是在用户通过身份验证后如何将用户重定向到另一个扩展选项卡。对于存储过程,我想收到一个适合我的代码代码,而不是 chrome storage api 的链接,因为我已经尝试使用它但它从未奏效。这是我的代码: HTML:

<html>
    <head>
        <style>
            body {
                width: 400px;
                height: 300px;
            }
        </style>
        <style>
     
            .testo {
                text-align: center;
                font-size: 25px;
                color: rgb(77,162,211);
            }
            
            
            
            .image {
                width: 50px;
                height: 50px;
                text-align: center;
            }
            
            .rounded-input {
                position: absolute;
                color: rgb(77,211);
                bottom: 126px;
                left: 20px;
                right: 20px;
                width: 77%;
                padding: 20px;
                border-radius: 30px;
                border-color: rgb(77,211);
                background-color: rgb(17,13,13);
                font-size: 20px;
                text-align: center;
            }
            
            .btn {
                padding: 15px;
                border-color: rgb(77,211);
                background-color: rgb(39,33,33);
                color: rgb(77,211);
                border-radius: 15px;
                width: 40%;
                position: absolute;
                right: 10%;
                left: 30%;
                bottom: 37px;
                font-family: 'Courier New',Courier,monospace;
                font-size: 14px;
            }

            .twlogo {
                position: absolute;
                bottom: 7px;
                width: 30px;
                height: 20px;
            }


        </style>
    </head>
    <body style="background-color: black;">
        <img src="logoVERO.png" class="image" alt="logo">
        <h1 class="testo">Enter your key:</h1>
        <p><input type="text" class="rounded-input" id="key"></input></p>
    </style>
        <p><button class="btn" id="save">AUTHENTICATE</button></p>
        <a href="https://twitter.com/home">
    <img src="tw.png" class="twlogo">
</a>
    </body>

<script src="./background.js"></script>
</html>```

**Another thing that i want to kNow is how can i let the user pass the auth only if the key he entered is present in an array with all the keys**

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...