Repo Meta
Notes
- todo with some userscripts due to some issues
- When address is begin with
//xxx.com
, the final address will bechrome-extension://xxx.com
, while it should behttp
. I try some ways but I am novice in javascript. //
only supported with server and extension actually run at local.//
img cannot loaded and the http url is wrong as well.
foo://example.com:8042/over/there?name=ferret#nose
\_/ \______________/\_________/ \_________/ \__/
| | | | |
scheme authority path query fragment
via: Is it valid to replace <script src=“http://…”>?
- todo I cannot replace target when all data has loaded. So I try to add a button to replace the RSS content, with Content Security Policy - Chrome Developers. (cordova - The Content Security Policy ‘default-src * data:;’ was delivered via a element outside the document’s - Stack Overflow)
- Cannot run inline javescript
- How does inline JavaScript work with HTML ? - GeeksforGeeks
- Solution
<button id="myButton">Click me</button>
<script src="script.js"></script>
document.getElementById("myButton").addEventListener("click", myFunction);
function myFunction(){
console.log('asd');
}
-
In chrome apps, Content Security Policy does not allow inline javascript. So you have to put your javascript in a .js file and include it in your HTML. Further reading: https://developer.chrome.com/extensions/contentSecurityPolicy via: javascript - Refused to execute inline event handler because it violates CSP. (SANDBOX) - Stack Overflow
-
Extra
-
What are Bookmarklets? How to Use JavaScript to Make a Bookmarklet in Chromium and Firefox
-
JavaScript regex group replace? regex - Javascript replace with reference to matched group? - Stack Overflow
/**
<div class="feedPreviewSummaryContent" style="max-height: 480px;">[img]https://img.imoutomoe.net/images/2022/12/06/35c17455f54a12950.jpg[/img]
[img]https://img.imoutomoe.net/images/2022/12/06/4c015ed6fd28b52d2.jpg[/img]
[img]https://img.imoutomoe.net/images/2022/12/06/52168fd40a039b8b4.jpg[/img]
[img]https://cdn.cloudflare.steamstatic.com/steam/apps/1924680/heade ..</div>
**/