To prevent cross-page leaks we need to create/copy prefs and cachedStyles inside the background page context. * storage.js is now used only in the background page * messaging.js now contains less bg-specific methods and more common methods. Added saveStyleSafe, deleteStyleSafe which automatically invoke onRuntimeMessage of the current page or just handleUpdate/handleDelete when notify:false * prefs.js with 'prefs' for background and UI pages: separate objects because a UI page may load before the background page and it can read prefs from localStorage/sync/defaults
		
			
				
	
	
		
			88 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			88 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<!DOCTYPE html>
 | 
						|
<html id="stylus">
 | 
						|
<head>
 | 
						|
  <title i18n-text-append="optionsHeading">Stylus </title>
 | 
						|
  <link rel="stylesheet" href="index.css">
 | 
						|
  <script src="/dom.js"></script>
 | 
						|
  <script src="/localization.js"></script>
 | 
						|
  <script src="/messaging.js"></script>
 | 
						|
  <script src="/prefs.js"></script>
 | 
						|
  <script src="/apply.js"></script>
 | 
						|
</head>
 | 
						|
 | 
						|
<body>
 | 
						|
  <div id="ui">
 | 
						|
    <h1 i18n-text="optionsCustomize"></h1>
 | 
						|
    <table>
 | 
						|
      <tr>
 | 
						|
        <td i18n-text="prefShowBadge"></td>
 | 
						|
        <td>
 | 
						|
          <div class="onoffswitch">
 | 
						|
            <input type="checkbox" class="onoffswitch-checkbox" id="show-badge">
 | 
						|
            <label class="onoffswitch-label" for="show-badge"></label>
 | 
						|
          </div>
 | 
						|
        </td>
 | 
						|
      </tr>
 | 
						|
      <tr>
 | 
						|
        <td i18n-text="popupStylesFirst"></td>
 | 
						|
        <td>
 | 
						|
          <div class="onoffswitch">
 | 
						|
            <input type="checkbox" class="onoffswitch-checkbox" id="popup.stylesFirst">
 | 
						|
            <label class="onoffswitch-label" for="popup.stylesFirst"></label>
 | 
						|
          </div>
 | 
						|
        </td>
 | 
						|
      </tr>
 | 
						|
      <tr>
 | 
						|
        <td i18n-text="optionsBadgeNormal"></td>
 | 
						|
        <td><input type="color" id="badgeNormal"></td>
 | 
						|
      </tr>
 | 
						|
      <tr>
 | 
						|
        <td i18n-text="optionsBadgeDisabled"></td>
 | 
						|
        <td><input type="color" id="badgeDisabled"></td>
 | 
						|
      </tr>
 | 
						|
      <tr>
 | 
						|
        <td i18n-text="optionsPopupWidth"></td>
 | 
						|
        <td><input type="number" id="popupWidth" min="200" max="800"></td>
 | 
						|
      </tr>
 | 
						|
      <tr>
 | 
						|
        <td i18n-text="optionsUpdateInterval"><sup>1</sup></td>
 | 
						|
        <td><input type="number" min="0" id="updateInterval"></td>
 | 
						|
      </tr>
 | 
						|
    </table>
 | 
						|
    <div id="reset">
 | 
						|
      <button data-cmd="reset" i18n-text="optionsReset"></button>
 | 
						|
    </div>
 | 
						|
  </div>
 | 
						|
 | 
						|
  <div id="actions">
 | 
						|
    <h1 i18n-text="optionsActions"></h1>
 | 
						|
    <table>
 | 
						|
      <tr>
 | 
						|
        <td i18n-text="optionsOpenManager"><sup class="chromium-only">2</sup></td>
 | 
						|
        <td><button type="button" data-cmd="open-manage" i18n-text="optionsOpen"></button></td>
 | 
						|
      </tr>
 | 
						|
      <tr>
 | 
						|
        <td i18n-text="optionsCheckUpdate"></td>
 | 
						|
        <td>
 | 
						|
          <button type="button" data-cmd="check-updates" i18n-text="optionsCheck"></button>
 | 
						|
          <div id="update-counter"></div>
 | 
						|
        </td>
 | 
						|
      </tr>
 | 
						|
    </table>
 | 
						|
  </div>
 | 
						|
 | 
						|
  <div id="notes">
 | 
						|
    <ol>
 | 
						|
      <li i18n-text="optionsUpdateIntervalNote"></li>
 | 
						|
      <li class="chromium-only">
 | 
						|
        <a data-cmd="open-keyboard"
 | 
						|
           i18n-text="optionsOpenManagerNote"
 | 
						|
           href="chrome://extensions/configureCommands"></a>
 | 
						|
      </li>
 | 
						|
    </ol>
 | 
						|
  </div>
 | 
						|
 | 
						|
  <script src="index.js"></script>
 | 
						|
</body>
 | 
						|
</html>
 |