Access page content from browserActiononClick within Chrome Extension not workingChrome Extension - Content Security Policy - executing inline codeis Content Security Policy 'unsafe-inline' deprecated?How do I remove a property from a JavaScript object?How do I remove a particular element from an array in JavaScript?How do I return the response from an asynchronous call?Chrome extension Content Security Policy directive errorChrome Extension - Content Security Policy - executing inline codeHow to allow inline scripts chrome extensionHow to white-list inline script in the content security policy (CSP) of a Chrome extension?Chrome extension permissions got errors while loadingchrome extensions with javascriptHow do I create a button that runs my javascript function?

Is there any word or phrase for negative bearing?

How hard would it be to convert a glider into an powered electric aircraft?

Movie where a boy is transported into the future by an alien spaceship

Why did a party with more votes get fewer seats in the 2019 European Parliament election in Denmark?

Is it legal in the UK for politicians to lie to the public for political gain?

How to pass a regex when finding a directory path in bash?

Are there cubesats in GEO?

Will TSA allow me to carry a Continuous Positive Airway Pressure (CPAP)/sleep apnea device?

How can this map be coloured using four colours?

Finding the constrain of integral

Function to extract float from different price patterns

Did Darth Vader wear the same suit for 20+ years?

Smooth switching between 12v batteries, with toggle switch

Why don't B747s start takeoffs with full throttle?

Who operates delivery flights for commercial airlines?

Implement Homestuck's Catenative Doomsday Dice Cascader

Importance sampling estimation of power function

PC video game involving floating islands doing aerial combat

C SIGINT signal in Linux

How to skip replacing first occurrence of a character in each line?

Is it a problem that pull requests are approved without any comments

Does the growth of home value benefit from compound interest?

Payment instructions from HomeAway look fishy to me

Word for a small burst of laughter that can't be held back



Access page content from browserAction


onClick within Chrome Extension not workingChrome Extension - Content Security Policy - executing inline codeis Content Security Policy 'unsafe-inline' deprecated?How do I remove a property from a JavaScript object?How do I remove a particular element from an array in JavaScript?How do I return the response from an asynchronous call?Chrome extension Content Security Policy directive errorChrome Extension - Content Security Policy - executing inline codeHow to allow inline scripts chrome extensionHow to white-list inline script in the content security policy (CSP) of a Chrome extension?Chrome extension permissions got errors while loadingchrome extensions with javascriptHow do I create a button that runs my javascript function?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I'm currently working on an extension for Google Chrome which should extract all links from the web page the user is currently on and list them in the window that is opened upon clicking the icon. For that I need to access the complete DOM page content of the active tab from the browserAction html, which is what I can't really make up.



I already took a look at this repository https://github.com/dvidsilva/chrome-ext-sample which should basically be what I want but when I try to use it in my browser I get an error:




Refused to execute inline script because it violates the following
Content Security Policy directive: "script-src 'self'". Either the
'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce
('nonce-...') is required to enable inline execution.




  • Now my first attempt was to use the mentioned unsafe-inline keyword but it is blocked in browser extensions from what I can tell (is Content Security Policy 'unsafe-inline' deprecated?, Chrome Extension - Content Security Policy - executing inline code).

  • Afterwards I tried using the hash from the text but it is ignored, as an insecure CSP value.

  • I can't really find an example on how to use the nonce tag on the web.

Now my question is how do I access the page content from the browser action or how do I set the CSP to run my scripts?



Thanks for your help










share|improve this question
























  • Are you using an inline script? Then don't. Use a separate js file as shown in the extension you've linked. More info. As for the web page, it's a separate page, not related to the browserAction popup so you need a content script, see How to access the webpage DOM rather than the extension page DOM?

    – wOxxOm
    Mar 24 at 20:53


















0















I'm currently working on an extension for Google Chrome which should extract all links from the web page the user is currently on and list them in the window that is opened upon clicking the icon. For that I need to access the complete DOM page content of the active tab from the browserAction html, which is what I can't really make up.



I already took a look at this repository https://github.com/dvidsilva/chrome-ext-sample which should basically be what I want but when I try to use it in my browser I get an error:




Refused to execute inline script because it violates the following
Content Security Policy directive: "script-src 'self'". Either the
'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce
('nonce-...') is required to enable inline execution.




  • Now my first attempt was to use the mentioned unsafe-inline keyword but it is blocked in browser extensions from what I can tell (is Content Security Policy 'unsafe-inline' deprecated?, Chrome Extension - Content Security Policy - executing inline code).

  • Afterwards I tried using the hash from the text but it is ignored, as an insecure CSP value.

  • I can't really find an example on how to use the nonce tag on the web.

Now my question is how do I access the page content from the browser action or how do I set the CSP to run my scripts?



Thanks for your help










share|improve this question
























  • Are you using an inline script? Then don't. Use a separate js file as shown in the extension you've linked. More info. As for the web page, it's a separate page, not related to the browserAction popup so you need a content script, see How to access the webpage DOM rather than the extension page DOM?

    – wOxxOm
    Mar 24 at 20:53














0












0








0








I'm currently working on an extension for Google Chrome which should extract all links from the web page the user is currently on and list them in the window that is opened upon clicking the icon. For that I need to access the complete DOM page content of the active tab from the browserAction html, which is what I can't really make up.



I already took a look at this repository https://github.com/dvidsilva/chrome-ext-sample which should basically be what I want but when I try to use it in my browser I get an error:




Refused to execute inline script because it violates the following
Content Security Policy directive: "script-src 'self'". Either the
'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce
('nonce-...') is required to enable inline execution.




  • Now my first attempt was to use the mentioned unsafe-inline keyword but it is blocked in browser extensions from what I can tell (is Content Security Policy 'unsafe-inline' deprecated?, Chrome Extension - Content Security Policy - executing inline code).

  • Afterwards I tried using the hash from the text but it is ignored, as an insecure CSP value.

  • I can't really find an example on how to use the nonce tag on the web.

Now my question is how do I access the page content from the browser action or how do I set the CSP to run my scripts?



Thanks for your help










share|improve this question
















I'm currently working on an extension for Google Chrome which should extract all links from the web page the user is currently on and list them in the window that is opened upon clicking the icon. For that I need to access the complete DOM page content of the active tab from the browserAction html, which is what I can't really make up.



I already took a look at this repository https://github.com/dvidsilva/chrome-ext-sample which should basically be what I want but when I try to use it in my browser I get an error:




Refused to execute inline script because it violates the following
Content Security Policy directive: "script-src 'self'". Either the
'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce
('nonce-...') is required to enable inline execution.




  • Now my first attempt was to use the mentioned unsafe-inline keyword but it is blocked in browser extensions from what I can tell (is Content Security Policy 'unsafe-inline' deprecated?, Chrome Extension - Content Security Policy - executing inline code).

  • Afterwards I tried using the hash from the text but it is ignored, as an insecure CSP value.

  • I can't really find an example on how to use the nonce tag on the web.

Now my question is how do I access the page content from the browser action or how do I set the CSP to run my scripts?



Thanks for your help







javascript google-chrome-extension






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 24 at 18:09







writzlpfrimpft

















asked Mar 24 at 14:42









writzlpfrimpftwritzlpfrimpft

4217




4217












  • Are you using an inline script? Then don't. Use a separate js file as shown in the extension you've linked. More info. As for the web page, it's a separate page, not related to the browserAction popup so you need a content script, see How to access the webpage DOM rather than the extension page DOM?

    – wOxxOm
    Mar 24 at 20:53


















  • Are you using an inline script? Then don't. Use a separate js file as shown in the extension you've linked. More info. As for the web page, it's a separate page, not related to the browserAction popup so you need a content script, see How to access the webpage DOM rather than the extension page DOM?

    – wOxxOm
    Mar 24 at 20:53

















Are you using an inline script? Then don't. Use a separate js file as shown in the extension you've linked. More info. As for the web page, it's a separate page, not related to the browserAction popup so you need a content script, see How to access the webpage DOM rather than the extension page DOM?

– wOxxOm
Mar 24 at 20:53






Are you using an inline script? Then don't. Use a separate js file as shown in the extension you've linked. More info. As for the web page, it's a separate page, not related to the browserAction popup so you need a content script, see How to access the webpage DOM rather than the extension page DOM?

– wOxxOm
Mar 24 at 20:53













0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55324937%2faccess-page-content-from-browseraction%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55324937%2faccess-page-content-from-browseraction%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript