在background.js中获取标签的元素

时间:2019-10-17 10:33:23

标签: javascript html google-chrome-extension

在我的chrome扩展程序中,我想获取输入值,例如:

background.js:

# First stage: build and download wheels
FROM python:3 AS build

# Bootstrap some Python dependencies.
RUN pip install --upgrade pip \
 && pip install wheel

# This stage can need some extra host dependencies, like
# compilers and C libraries.
RUN apt-get update && \
    apt-get install -qy python-dev libmysqlclient-dev

# Create a directory to hold built wheels.
RUN mkdir /wheel

# Install the application's dependencies (only).
WORKDIR /app
COPY requirements.txt .
RUN pip wheel --wheel-dir=/wheel -r requirements.txt \
 && pip install --no-index --find-links=/wheel -r requirements.txt

# Build a wheel out of the application.
COPY . .
RUN pip wheel --wheel-dir=/wheel --no-index --find-links=/wheel .

# Second stage: actually run the application.
FROM python:3

# Bootstrap some Python dependencies.
RUN pip install --upgrade pip \
 && pip install wheel

# Get the wheels from the first stage.
RUN mkdir /wheel
COPY --from=build /wheel /wheel

# Install them.
RUN pip install --no-index --find-links=/wheel /wheel/*.whl

# Standard application metadata.
# The application should be declared as entry_points in setup.py.
EXPOSE 3000
CMD ["the_application"]

Options.html

chrome.downloads.onCreated.addListener(
    function foo(e) {
        var address = document.getElementById("server-adrress").value;
        console.log(address );
    }
);

但是我得到了错误:

  

事件处理程序中的错误:TypeError:无法读取null的属性“值”

在这一行:

...
<input id="server-adr-txt" type="text" placeholder="Server Address">

0 个答案:

没有答案